in
aux term
;;
+*)
+(*
let restore_metas (* context *) term =
let module C = Cic in
let rec aux = function
in
aux term
;;
+*)
-
+(*
let rec restore_subst (* context *) subst =
List.map
(fun (i, (c, t, ty)) ->
| Cic.Meta (i, l) -> check_irl 1 l
| Cic.Rel _ -> true
| Cic.Const _ -> true
+ | Cic.MutInd (_, _, []) -> true
+ | Cic.MutConstruct (_, _, _, []) -> true
| _ -> false
;;
let unification metasenv context t1 t2 ugraph =
(* Printf.printf "| unification %s %s\n" (CicPp.ppterm t1) (CicPp.ppterm t2); *)
let subst, menv, ug =
- if not (is_simple_term t1) || not (is_simple_term t2) then
+ if not (is_simple_term t1) || not (is_simple_term t2) then (
+ debug_print (
+ Printf.sprintf "NOT SIMPLE TERMS: %s %s"
+ (CicPp.ppterm t1) (CicPp.ppterm t2));
CicUnification.fo_unif metasenv context t1 t2 ugraph
- else
+ ) else
unification_simple metasenv context t1 t2 ugraph
in
let rec fix_term = function
(* let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in *)
let (head, newmetas, args, newmeta) =
ProofEngineHelpers.saturate_term newmeta []
- context (S.lift index term)
+ context (S.lift index term) 0
in
let p =
if List.length args = 0 then
"cic:/Coq/Init/Logic/sym_eq.con";
(* "cic:/Coq/Logic/Eqdep/UIP_refl.con"; *)
(* "cic:/Coq/Init/Peano/mult_n_Sm.con"; *)
+
+ (* ALB !!!! questo e` imbrogliare, ma x ora lo lasciamo cosi`...
+ perche' questo cacchio di teorema rompe le scatole :'( *)
+ "cic:/Rocq/SUBST/comparith/mult_n_2.con";
]
;;
let candidates =
List.fold_left
(fun l uri ->
+ let suri = UriManager.string_of_uri uri in
if UriManager.UriSet.mem uri equations_blacklist then
l
else
| (term, termty)::tl ->
debug_print (
Printf.sprintf "Examining: %s (%s)"
- (CicPp.ppterm term) (CicPp.ppterm termty));
+ (UriManager.string_of_uri (CicUtil.uri_of_term term))(* (CicPp.ppterm term) *) (CicPp.ppterm termty));
let res, newmeta =
match termty with
| C.Prod (name, s, t) ->
let head, newmetas, args, newmeta =
- ProofEngineHelpers.saturate_term newmeta [] context termty
+ ProofEngineHelpers.saturate_term newmeta [] context termty 0
in
let p =
if List.length args = 0 then
| None ->
aux newmeta tl
in
- aux maxmeta candidates
+ let found, maxm = aux maxmeta candidates in
+ (List.fold_left
+ (fun l e ->
+ if List.exists (meta_convertibility_eq e) l then (
+ debug_print (
+ Printf.sprintf "NO!! %s already there!" (string_of_equality e));
+ l
+ )
+ else e::l)
+ [] found), maxm
;;