;;
let check_for_duplicates metas msg =
-let _ =
- try
- ignore(CicUtil.lookup_meta 190 metas);
- prerr_endline ("eccoci in " ^ msg);
- with
- CicUtil.Meta_not_found _ -> () in
-if List.length metas <>
+ if List.length metas <>
List.length (HExtlib.list_uniq (List.sort Pervasives.compare metas)) then
begin
prerr_endline ("DUPLICATI " ^ msg);
;;
let check_target context target msg =
- let w, proof, (eq_ty, left, right, order), metas, args = target in
+ let w, proof, (eq_ty, left, right, order), metas = target in
(* check that metas does not contains duplicates *)
let eqs = Inference.string_of_equality target in
let _ = check_for_duplicates metas (msg ^ "\nchecking " ^ eqs) in
function
| [] -> None
| candidate::tl ->
- let pos, (_, proof, (ty, left, right, o), metas, args) = candidate in
+ let pos, (_, proof, (ty, left, right, o), metas) = candidate in
if Utils.debug_metas then
ignore(check_target context (snd candidate) "find_matches");
if Utils.debug_res then
function
| [] -> []
| candidate::tl ->
- let pos, (_, _, (ty, left, right, o), metas, args) = candidate in
+ let pos, (_, _, (ty, left, right, o), metas) = candidate in
let do_match c eq_URI =
let subst', metasenv', ugraph' =
let t1 = Unix.gettimeofday () in
returns true if target is subsumed by some equality in table
*)
let subsumption env table target =
- let _, _, (ty, left, right, _), tmetas, _ = target in
+ let _, _, (ty, left, right, _), tmetas = target in
let metasenv, context, ugraph = env in
let metasenv = metasenv @ tmetas in
let samesubst subst subst' =
in
let rec ok what = function
| [] -> false, []
- | (_, subst, menv, ug, ((pos, (_, _, (_, l, r, o), m, _)), _))::tl ->
+ | (_, subst, menv, ug, ((pos, (_, _, (_, l, r, o), m)), _))::tl ->
try
let other = if pos = Utils.Left then r else l in
let subst', menv', ug' =
let module HL = HelmLibraryObjects in
let module U = Utils in
let metasenv, context, ugraph = env in
- let w, proof, (eq_ty, left, right, order), metas, args = target in
+ let w, proof, (eq_ty, left, right, order), metas = target in
(* first, we simplify *)
let right = U.guarded_simpl context right in
let left = U.guarded_simpl context left in
let order = !Utils.compare_terms left right in
let stat = (eq_ty, left, right, order) in
let w = Utils.compute_equality_weight stat in
- let target = w, proof, stat, metas, args in
+ let target = w, proof, stat, metas in
if Utils.debug_metas then
ignore(check_target context target "demod equalities input");
let metasenv' = (* metasenv @ *) metas in
let substs = CicMetaSubst.ppsubst subst in
ignore(check_target context (snd eq_found) ("input3" ^ substs))
end;
- let pos, (_, proof', (ty, what, other, _), menv', args') = eq_found in
+ let pos, (_, proof', (ty, what, other, _), menv') = eq_found in
let ty =
try fst (CicTypeChecker.type_of_aux' metasenv context what ugraph)
with CicUtil.Meta_not_found _ -> ty
let what, other =
if pos = Utils.Left then what, other else other, what
in
- pos, (0, proof', (ty, other, what, Utils.Incomparable),
- menv', args')
+ pos, (0, proof', (ty, other, what, Utils.Incomparable),menv')
in
let target_proof =
let pb =
build_newtarget_time := !build_newtarget_time +. (time2 -. time1);
let res =
let w = Utils.compute_equality_weight stat in
- (w, newproof, stat,newmenv,args) in
+ (w, newproof, stat,newmenv) in
if Utils.debug_metas then
ignore(check_target context res "buildnew_target output");
!maxmeta, res
let module HL = HelmLibraryObjects in
let module CR = CicReduction in
let module U = Utils in
- let weight, proof, (eq_ty, left, right, ordering), menv, _ = target in
+ let weight, proof, (eq_ty, left, right, ordering), menv = target in
if Utils.debug_metas then
ignore(check_target context target "superpositionleft");
let expansions, _ =
(* debug_print (lazy "\nSUPERPOSITION LEFT\n"); *)
let time1 = Unix.gettimeofday () in
- let pos, (_, proof', (ty, what, other, _), menv', args') = eq_found in
+ let pos, (_, proof', (ty, what, other, _), menv') = eq_found in
let what, other = if pos = Utils.Left then what, other else other, what in
let newgoal, newproof =
let bo' = U.guarded_simpl context (apply_subst s (S.subst other bo)) in
let what, other =
if pos = Utils.Left then what, other else other, what
in
- pos, (0, proof', (ty, other, what, Utils.Incomparable), menv', args')
+ pos, (0, proof', (ty, other, what, Utils.Incomparable), menv')
in
let target_proof =
let pb =
build_newtarget_time := !build_newtarget_time +. (time2 -. time1);
let w = Utils.compute_equality_weight stat in
- (w, newproof, stat, newmenv, [])
+ (w, newproof, stat, newmenv)
in
!maxmeta, List.map build_new expansions
let module HL = HelmLibraryObjects in
let module CR = CicReduction in
let module U = Utils in
- let w, eqproof, (eq_ty, left, right, ordering), newmetas, args = target in
+ let w, eqproof, (eq_ty, left, right, ordering), newmetas = target in
if Utils.debug_metas then
ignore (check_target context target "superpositionright");
let metasenv' = newmetas in
ignore (check_target context (snd eq_found) "buildnew1" );
let time1 = Unix.gettimeofday () in
- let pos, (_, proof', (ty, what, other, _), menv', args') = eq_found in
+ let pos, (_, proof', (ty, what, other, _), menv') = eq_found in
let what, other = if pos = Utils.Left then what, other else other, what in
let newgoal, newproof =
(* qua *)
else apply_subst s left, newgoal in
let neworder = !Utils.compare_terms left right in
let newmenv = (* Inference.filter s *) m in
- let newargs = args @ args' in
let stat = (eq_ty, left, right, neworder) in
let eq' =
let w = Utils.compute_equality_weight stat in
- (w, newproof, stat, newmenv, newargs) in
+ (w, newproof, stat, newmenv) in
if Utils.debug_metas then
ignore (check_target context eq' "buildnew3");
let newm, eq' = Inference.fix_metas !maxmeta eq' in
let metasenv' = metas in
let build_newgoal (t, subst, menv, ug, (eq_found, eq_URI)) =
- let pos, (_, proof', (ty, what, other, _), menv', args') = eq_found in
+ let pos, (_, proof', (ty, what, other, _), menv') = eq_found in
let what, other = if pos = Utils.Left then what, other else other, what in
let ty =
try fst (CicTypeChecker.type_of_aux' metasenv context what ugraph)
let what, other =
if pos = Utils.Left then what, other else other, what
in
- pos, (0, proof', (ty, other, what, Utils.Incomparable), menv', args')
+ pos, (0, proof', (ty, other, what, Utils.Incomparable), menv')
in
let goal_proof =
let pb =
let metasenv' = metas in
let build_newtheorem (t, subst, menv, ug, (eq_found, eq_URI)) =
- let pos, (_, proof', (ty, what, other, _), menv', args') = eq_found in
+ let pos, (_, proof', (ty, what, other, _), menv') = eq_found in
let what, other = if pos = Utils.Left then what, other else other, what in
let newterm, newty =
let bo = Utils.guarded_simpl context (apply_subst subst (S.subst other t)) in