- prerr_endline (Printf.sprintf "\nTIME NEEDED: %8.2f" time);
- proof, open_goals
-;;
-
-let main _ _ _ _ _ = () ;;
-
-let retrieve_and_print dbd term metasenv ugraph =
- let module C = Cic in
- let module T = CicTypeChecker in
- let module PET = ProofEngineTypes in
- let module PP = CicPp in
- let proof = None, (1, [], term)::metasenv, C.Meta (1, []), term in
- let status = PET.apply_tactic (PrimitiveTactics.intros_tac ()) (proof, 1) in
- let proof, goals = status in
- let goal' = List.nth goals 0 in
- let uri, metasenv, meta_proof, term_to_prove = proof in
- let _, context, type_of_goal = CicUtil.lookup_meta goal' metasenv in
- let eq_uri = eq_of_goal type_of_goal in
- let eq_indexes, equalities, maxm = Inference.find_equalities context proof in
- let ugraph = CicUniv.empty_ugraph in
- let env = (metasenv, context, ugraph) in
- let t1 = Unix.gettimeofday () in
- let lib_eq_uris, library_equalities, maxm =
- Inference.find_library_equalities false dbd context (proof, goal') (maxm+2) in
- let t2 = Unix.gettimeofday () in
- maxmeta := maxm+2;
- let equalities = (* equalities @ *) library_equalities in
- Utils.debug_print
- (lazy
- (Printf.sprintf "\n\nequalities:\n%s\n"
- (String.concat "\n"
- (List.map
- (fun (u, e) ->
-(* Printf.sprintf "%s: %s" *)
- (UriManager.string_of_uri u)
-(* (string_of_equality e) *)
- )
- equalities))));
- Utils.debug_print (lazy "RETR: SIMPLYFYING EQUALITIES...");
- let rec simpl e others others_simpl =
- let (u, e) = e in
- let active = (others @ others_simpl) in
- let tbl =
- List.fold_left
- (fun t (_, e) -> Indexing.index t e)
- Indexing.empty active
- in
- let res = forward_simplify eq_uri env e (active, tbl) in
- match others with
- | hd::tl -> (
- match res with
- | None -> simpl hd tl others_simpl
- | Some e -> simpl hd tl ((u, e)::others_simpl)
- )
- | [] -> (
- match res with
- | None -> others_simpl
- | Some e -> (u, e)::others_simpl
- )
- in
- let _equalities =
- match equalities with
- | [] -> []
- | hd::tl ->
- let others = tl in (* List.map (fun e -> (Utils.Positive, e)) tl in *)
- let res =
- List.rev (simpl (*(Positive,*) hd others [])
- in
- Utils.debug_print
- (lazy
- (Printf.sprintf "\nequalities AFTER:\n%s\n"
- (String.concat "\n"
- (List.map
- (fun (u, e) ->
- Printf.sprintf "%s: %s"
- (UriManager.string_of_uri u)
- (Equality.string_of_equality e)
- )
- res))));
- res in
- Utils.debug_print
- (lazy
- (Printf.sprintf "Time to retrieve equalities: %.9f\n" (t2 -. t1)))