Skip to content

Commit 6fc6e0e

Browse files
committed
the type of proof in or2and_edge is now string.
Since we produce and-nodes only when we manage to prove the parental or-node assuming and-node, we do not have to use the option type anymore.
1 parent bc42ca5 commit 6fc6e0e

4 files changed

Lines changed: 10 additions & 27 deletions

File tree

Abduction/Abduction_Graph.ML

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ val grand_children : abduction_graph -> key -> key
5858
val all_gg_parents_are_proved : abduction_graph -> key -> bool;
5959

6060
(* query on abduction_node for or2and_edge *)
61-
val ornode_proved_assmng_andnodes : abduction_graph -> key -> bool;
6261
val or2and_edge_to_proof : abduction_graph -> key -> string;
6362

6463
val is_worth_proving : Proof.context -> abduction_graph -> key -> bool;
@@ -289,10 +288,6 @@ fun orkeys_tobe_expanded_in (ctxt:Proof.context) (graph:abduction_graph): keys =
289288
result
290289
end;
291290

292-
(* ornode_proved_assmng_andnodes *)
293-
fun ornode_proved_assmng_andnodes (graph:abduction_graph) (key:key) =
294-
Abduction_Node.ornode_proved_assmng_andnodes (PGraph.get_node graph key);
295-
296291
(* or2and_edge_to_proof *)
297292
fun or2and_edge_to_proof (graph:abduction_graph) (key:key) =
298293
Abduction_Node.or2and_edge_to_proof (PGraph.get_node graph key);

Abduction/Abduction_Node.ML

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ val lemma_name_of : abduction_node -> string;
3636
val is_worth_proving : Proof.context -> abduction_node -> bool;
3737

3838
(* query on abduction_node for or2and_edge *)
39-
val ornode_proved_assmng_andnodes: abduction_node -> bool;
4039
val or2and_edge_to_proof : abduction_node -> string;
4140

4241
(* destructors of abduction_node *)
@@ -104,11 +103,6 @@ fun is_branch (Or_Node or_nd) = #is_branch or_nd
104103
fun is_final_goal (Or_Node or_nd) = #final_goal or_nd
105104
| is_final_goal _ = error "is_final_goal. This is not Or_Node."
106105

107-
(* ornode_proved_assmng_andnodes *)
108-
fun ornode_proved_assmng_andnodes (Or_To_And or2and_edge:abduction_node) =
109-
#proof_of_ornode_assmng_andnodes or2and_edge |> is_some
110-
| ornode_proved_assmng_andnodes _ = error "ornode_proved_assmng_andnodes";
111-
112106
(* or2and_edge_to_proof *)
113107
fun or2and_edge_to_proof (Or_To_And or2and_edge:abduction_node) = Or2And_Edge.or2and_edge_to_proof or2and_edge
114108
| or2and_edge_to_proof _ = error "or2and_edge_to_proof failed. This is not or2and_edge."

Abduction/Or2And_Edge.ML

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,9 @@ fun proof_is_from_tactic (Tactic _) = true
3737
(* or2and_edge *)
3838
type or2and_edge = {
3939
how_to_get_andnodes_from_ornode: how_to_get_andnodes_from_ornode,
40-
proof_of_ornode_assmng_andnodes: string option}(*NONE: we cannot prove the or-node.*)
40+
proof_of_ornode_assmng_andnodes: string}(*NONE: we cannot prove the or-node.*)
4141

4242
(* or2and_edge_to_proof *)
43-
fun or2and_edge_to_proof ({proof_of_ornode_assmng_andnodes, ...}:or2and_edge) =
44-
if is_some proof_of_ornode_assmng_andnodes
45-
then the proof_of_ornode_assmng_andnodes
46-
else error "edge_to_final_proof failed. We do not know how to prove the or-node assuming the subgoals of the and-node.";
43+
fun or2and_edge_to_proof ({proof_of_ornode_assmng_andnodes, ...}:or2and_edge) = proof_of_ornode_assmng_andnodes;
4744

4845
end;

Abduction/Seed_Of_Or2And_Edge.ML

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ val print_seed_of_or2and_edge: Proof.context -> seed_of_or2and_edge -> unit list
2323
val seed_is_from_tactic : seed_of_or2and_edge -> bool;
2424

2525
val apply_PSL_to_get_seeds_of_or2and_edges: Proof.state -> seeds_of_or2and_edge;
26-
val filter_out_bad_seeds_of_or2and_edge: term (*parental or-node*) -> Proof.state -> abduction_graph -> seeds_of_or2and_edge -> seeds_of_or2and_edge
27-
val conjectures_to_seeds_of_or2and_edge: (Proof.state (*default pst*) * Proof.state (*chained pst to proved the parental ornode*)) -> (string * term) list -> seeds_of_or2and_edge;
28-
val seed_has_counterexample : Proof.state -> seed_of_or2and_edge -> bool;
29-
val seeds_to_updated_graph : key -> seeds_of_or2and_edge -> Update_Abduction_Graph.update_abduction_graph;
26+
val filter_out_bad_seeds_of_or2and_edge : term (*parental or-node*) -> Proof.state -> abduction_graph -> seeds_of_or2and_edge -> seeds_of_or2and_edge
27+
val conjectures_to_seeds_of_or2and_edge : (Proof.state (*default pst*) * Proof.state (*chained pst to proved the parental ornode*)) -> (string * term) list -> seeds_of_or2and_edge;
28+
val seed_has_counterexample : Proof.state -> seed_of_or2and_edge -> bool;
29+
val seeds_to_updated_graph : key -> seeds_of_or2and_edge -> Update_Abduction_Graph.update_abduction_graph;
3030

3131
end;
3232

@@ -170,19 +170,16 @@ fun add_or2and_edge_and_connect_it_to_parental_ornode
170170
if proved_parent_or
171171
then
172172
let
173-
val how_we_got_andnode = Or2And_Edge.how_to_get_andnodes_from_ornode_of proof: string;
174-
val script_to_prove_andnd = the script_opt_gen : string;
175-
val script_to_prove_ornd = how_we_got_andnode ^ script_to_prove_andnd : string;
173+
val how_we_got_andnode = Or2And_Edge.how_to_get_andnodes_from_ornode_of proof : string;
174+
val script_to_prove_andnd = the script_opt_gen : string;
175+
val script_to_prove_ornd = how_we_got_andnode ^ script_to_prove_andnd : string;
176176
val or2and_edge_val = Abduction_Node.Or_To_And {
177177
how_to_get_andnodes_from_ornode = proof,
178-
(*TODO: Should we really need to use the option type here?*)
179-
proof_of_ornode_assmng_andnodes = SOME script_to_prove_ornd} : abduction_node;
178+
proof_of_ornode_assmng_andnodes = script_to_prove_ornd} : abduction_node;
180179
val or2and_edge_key = ((O2A_E (serial())), []) : key;
181180
val thy = Proof.theory_of state : theory;
182181
val used_cnjctr_names = Top_Down_Util.get_lemma_names_from_sh_output thy script_to_prove_andnd : strings;
183-
184182
val used_name_term_pairs = filter (fn (name, _) => member (op =) used_cnjctr_names name) name_term_pairs: (string * term) list;
185-
186183
val relevant_name_term_pairs = if Or2And_Edge.how_to_get_andnodes_from_ornode_of proof = "" (*if this is the result of tactic application*)
187184
then used_name_term_pairs
188185
else name_term_pairs;

0 commit comments

Comments
 (0)