(* let debug_print = fun _ -> () *)
-let experimental_hint =
- let profile = CicUtil.profile "experimental_hint" in
- fun ~dbd ~facts ?signature status ->
- profile (MetadataQuery.experimental_hint ~dbd ~facts ?signature) status
+let new_experimental_hint =
+ let profile = CicUtil.profile "new_experimental_hint" in
+ fun ~dbd ~facts ?signature ~universe status ->
+ profile (MetadataQuery.new_experimental_hint ~dbd ~facts ?signature ~universe) status
let search_theorems_in_context status =
let (proof, goal) = status in
with _ -> false
let rec auto_single dbd proof goal ey ty depth width sign already_seen_goals
+ universe
=
if depth = 0 then [] else
if List.mem ty already_seen_goals then [] else
new_search_theorems
(fun status ->
List.map snd
- (experimental_hint
- ~dbd ~facts:facts ?signature:sign status))
+ (new_experimental_hint
+ ~dbd ~facts:facts ?signature:sign ~universe status))
dbd proof goal (depth-1) new_sign in
let all_choices =
local_choices@global_choices in
Pervasives.compare
(List.length goals1) (List.length goals2))
all_choices in
- (match (auto_new dbd width already_seen_goals sorted_choices)
+ (match (auto_new dbd width already_seen_goals universe sorted_choices)
with
[] ->
(* no proof has been found; we update the
| _ -> assert false)
end
-and auto_new dbd width already_seen_goals = function
+and auto_new dbd width already_seen_goals universe = function
[] -> []
| (subst,(proof, goals, sign))::tl ->
let _,metasenv,_,_ = proof in
true
with _ -> false in
let goals'= List.filter is_in_metasenv goals in
- auto_new_aux dbd width already_seen_goals
+ auto_new_aux dbd width already_seen_goals universe
((subst,(proof, goals', sign))::tl)
-and auto_new_aux dbd width already_seen_goals = function
+and auto_new_aux dbd width already_seen_goals universe = function
[] -> []
| (subst,(proof, [], sign))::tl -> (subst,(proof, [], sign))::tl
| (subst,(proof, (goal,0)::_, _))::tl ->
- auto_new dbd width already_seen_goals tl
+ auto_new dbd width already_seen_goals universe tl
| (subst,(proof, goals, _))::tl when
(List.length goals) > width ->
- auto_new dbd width already_seen_goals tl
+ auto_new dbd width already_seen_goals universe tl
| (subst,(proof, (goal,depth)::gtl, sign))::tl ->
let _,metasenv,p,_ = proof in
let (_, ey ,ty) = CicUtil.lookup_meta goal metasenv in
match (auto_single dbd proof goal ey ty depth
- (width - (List.length gtl)) sign already_seen_goals)
+ (width - (List.length gtl)) sign already_seen_goals) universe
with
- [] -> auto_new dbd width already_seen_goals tl
+ [] -> auto_new dbd width already_seen_goals universe tl
| (local_subst,(proof,[],sign))::tl1 ->
let new_subst f t = f (subst t) in
let is_meta_closed = CicUtil.is_meta_closed ty in
(function (f,(p,l,s)) -> (new_subst f,(p,l@gtl,s))) tl1)
in
(new_subst local_subst,(proof,gtl,sign))::tl2@tl in
- auto_new dbd width already_seen_goals all_choices
+ auto_new dbd width already_seen_goals universe all_choices
| _ -> assert false
;;
()
=
let auto_tac dbd (proof,goal) =
+ let universe = MetadataQuery.signature_of_goal ~dbd (proof,goal) in
Hashtbl.clear inspected_goals;
debug_print "Entro in Auto";
let id t = t in
- match (auto_new dbd width [] [id,(proof, [(goal,depth)],None)]) with
+ match auto_new dbd width [] universe [id,(proof, [(goal,depth)],None)] with
[] -> debug_print("Auto failed");
raise (ProofEngineTypes.Fail "No Applicable theorem")
| (_,(proof,[],_))::_ ->