@@ -99,14 +99,11 @@ fun node_type_compare (Or_N, Or_N ) = EQUAL
9999 | node_type_compare (O2A_E i1, O2A_E i2) = Int.compare (i1, i2)
100100 | node_type_compare (O2A_E _, _ ) = GREATER;
101101
102- fun term_compare (trm1, trm2) =
103- Term_Ord.term_ord ((Top_Down_Util.standardize_vnames trm1), (Top_Down_Util.standardize_vnames trm2))
104-
105102(* PGraph_Key *)
106103structure PGraph_Key =
107104 struct
108105 type key = (node_type * terms(* normal terms not thms*) )
109- val ord = prod_ord node_type_compare (list_ord term_compare)
106+ val ord = prod_ord node_type_compare (list_ord Top_Down_Util. term_compare)
110107 end :KEY
111108
112109(* PGraph *)
@@ -134,14 +131,23 @@ fun equal_keys key_pair = PGraph_Key.ord key_pair = EQUAL;
134131type is_final_goal = bool;
135132
136133fun mk_ornode (is_final_goal:is_final_goal) (lemma_name:string) (goal:term) =
134+ let
135+ val standardized_goal = Top_Down_Util.standardize_vnames goal;
136+ in
137137 (
138- (Or_N, [goal]): key,
139- Abduction_Node.mk_ornode is_final_goal lemma_name goal: abduction_node
140- );
138+ (Or_N, [standardized_goal]): key,
139+ Abduction_Node.mk_ornode is_final_goal lemma_name standardized_goal: abduction_node
140+ )
141+ end ;
141142
142143fun mk_andnode (goals:terms) =
143- ((And_N, goals): key,
144- Abduction_Node.mk_andnode goals);
144+ let
145+ val standardized_terms = map Top_Down_Util.standardize_vnames goals;
146+ val sorted_terms = sort Term_Ord.term_ord standardized_terms;
147+ in
148+ ((And_N, sorted_terms): key,
149+ Abduction_Node.mk_andnode sorted_terms)
150+ end ;
145151
146152(* key to term *)
147153fun orkey_to_term (Or_N, [orleaf_term]) = orleaf_term
0 commit comments