File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 7
7
module StateSet = Set. Make (Model )
8
8
module StateSetFP = Fixpoint. MakeSet (StateSet )
9
9
10
-
10
+ let f states =
11
+ StateSet. elements states
12
+ |> List. concat_map Model. step
13
+ |> StateSet. of_list
11
14
12
15
(* * Tagastab kõik saavutatavad olekud. *)
13
16
let all_states () : StateSet.t =
14
- failwith " TODO "
17
+ StateSetFP. closure f ( StateSet. singleton Model. initial)
15
18
16
- (* * Tagastab kõik saavutatavad veaolekud. *)
19
+ (* * Tagastab kõik saavutatavad veaolekud.
20
+ Vihje: StateSet.filter. *)
17
21
let error_states () : StateSet.t =
18
- failwith " TODO "
22
+ StateSet. filter Model. is_error (all_states () )
19
23
20
24
(* * Kas mõni veaolek on saavutatav? *)
21
25
let has_error () : bool =
22
- failwith " TODO "
26
+ not ( StateSet. is_empty (error_states () ))
23
27
24
28
(* * Kas veaolekud on mittesaavutatavad? *)
25
29
let is_correct () : bool =
26
- failwith " TODO "
30
+ not (has_error () )
27
31
end
28
32
29
33
You can’t perform that action at this time.
0 commit comments