Skip to content

Commit a6b2439

Browse files
committed
more cleaning.
1 parent 0e6c73f commit a6b2439

2 files changed

Lines changed: 11 additions & 29 deletions

File tree

Abduction/Seed_Of_Or2And_Edge.ML

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fun condition_to_filter_out (parent_or:term) (pst:Proof.state) (ag:abduction_gra
116116
let
117117
val prems = Logic.strip_imp_prems term: terms;
118118
in
119-
exists (Shared_State.is_refuted pst) prems: bool
119+
Shared_State.any_of_these_is_refuted pst prems: bool
120120
end;
121121
fun terms_have_counter_example_in_prems (pst:Proof.state) (terms:terms) =
122122
exists (has_counter_example_in_prems pst) terms: bool;

Abduction/Shared_State.ML

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ sig
99

1010
type 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-
2412
val any_of_these_is_refuted: Proof.state -> terms -> bool;
2513

2614
end;
@@ -30,32 +18,25 @@ struct
3018

3119
type 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*)
3725
type 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;
3929
val 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.*)
4632
fun 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

6041
fun 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

7557
end;

0 commit comments

Comments
 (0)