99
1010type abduction_graph ;
1111
12- type term_refute_table ;
13-
14- type synched_refutation_table ;
15-
16- val defined: term_refute_table -> term -> bool;
17-
18- val lookup: term_refute_table -> term -> bool;
19-
20- val insert: term * bool -> term_refute_table -> term_refute_table;
21-
22- val is_refuted: Proof.state -> term -> bool;
23-
2412val any_of_these_is_refuted: Proof.state -> terms -> bool;
2513
2614end ;
@@ -30,32 +18,25 @@ struct
3018
3119type abduction_graph = Abduction_Graph.abduction_graph;
3220
33- structure Term_Refuted_Table = Table (type key = term val ord = Term_Ord.term_ord);
34-
35- type term_refute_table = bool Term_Refuted_Table.table; (* true = refuted, false = not refuted*)
21+ local
3622
23+ structure Term_Refuted_Table = Table (type key = term val ord = Term_Ord.term_ord);
24+ type term_refute_table = bool Term_Refuted_Table.table; (* true = refuted, false = not refuted*)
3725type synched_refutation_table = term_refute_table Synchronized.var;
3826
27+ val defined = Term_Refuted_Table.defined;
28+ val lookup = Utils.the' " lookup in Shared_State failed." oo Term_Refuted_Table.lookup;
3929val refutation_table = Synchronized.var " refutation_table" Term_Refuted_Table.empty: synched_refutation_table;
4030
41- val defined = Term_Refuted_Table.defined;
42-
43- val lookup = Utils.the' " lookup in Shared_State failed." oo Term_Refuted_Table.lookup;
44-
4531(* Once we refute a term. The term remains refuted in the table forever.*)
4632fun insert (cnjctr:term, refuted:bool) (table:term_refute_table) =
4733 case try (Term_Refuted_Table.insert (op =) (cnjctr, refuted)) table
4834 of NONE => table
4935 | SOME new_table => new_table;
5036
51- fun update_refutation_table (pairs: (term * bool) list) (old_tb:term_refute_table) =
52- fold insert pairs old_tb: term_refute_table;
37+ in
5338
54- fun update_synched_refutation_table (pairs: (term * bool) list) =
55- Synchronized.change refutation_table (update_refutation_table pairs): unit;
56-
57- fun update_synched_refutation_table (pair: (term * bool)) =
58- Synchronized.change refutation_table (insert pair): unit;
39+ fun update_synched_refutation_table (pair: (term * bool)) = Synchronized.change refutation_table (insert pair): unit;
5940
6041fun is_refuted (pst:Proof.state) (cnjctr:term) =
6142 let
@@ -69,7 +50,8 @@ fun is_refuted (pst:Proof.state) (cnjctr:term) =
6950 result
7051 end ;
7152
72- fun any_of_these_is_refuted (pst:Proof.state) (terms:terms) =
73- exists (is_refuted pst) terms;
53+ fun any_of_these_is_refuted (pst:Proof.state) (terms:terms) = exists (is_refuted pst) terms;
54+
55+ end ;
7456
7557end ;
0 commit comments