the record fields names and if they are coercions and
then the coercion arity *)
| `Projection (** record projection *)
+ | `InversionPrinciple (** inversion principle *)
]
type attribute =
in
Obj_class (`Record fields)
| ["value", "projection"] -> Obj_class `Projection
- | _ -> attribute_error ())
+ | ["value", "inversion"] -> Obj_class `InversionPrinciple
+ | _ -> attribute_error ())
| tag ->
match find_helm_exception ctxt with
| Some (exn, arg) -> raise (Getter_failure (exn, arg))
res >]
) field_names [<>])
| `Projection -> Xml.xml_empty "class" [None,"value","projection"]
+ | `InversionPrinciple -> Xml.xml_empty "class" [None,"value","inversion"]
in
let flavour_of = function
| `Definition -> Xml.xml_empty "flavour" [None, "value", "definition"]
prerr_endline("closed_goals: " ^ String.concat ", " (List.map string_of_int closed_goals)); *)
let proof, opened_goals =
if needs_reordering then begin
- let uri, metasenv_after_tactic, t, ty = proof in
+ let uri, metasenv_after_tactic, t, ty, attrs = proof in
(* prerr_endline ("goal prima del riordino: " ^ String.concat " " (List.map string_of_int (ProofEngineTypes.goals_of_proof proof))); *)
let reordered_metasenv, opened_goals =
reorder_metasenv
metasenv_after_refinement metasenv_after_tactic
opened goal always_opens_a_goal
in
- let proof' = uri, reordered_metasenv, t, ty in
+ let proof' = uri, reordered_metasenv, t, ty, attrs in
(* prerr_endline ("goal dopo il riordino: " ^ String.concat " " (List.map string_of_int (ProofEngineTypes.goals_of_proof proof'))); *)
proof', opened_goals
end
*)
status,[]
| GrafiteAst.Print (_,"proofterm") ->
- let _,_,p,_ = GrafiteTypes.get_current_proof status in
+ let _,_,p,_, _ = GrafiteTypes.get_current_proof status in
print_endline (AutoTactic.pp_proofterm p);
status,[]
| GrafiteAst.Print (_,_) -> status,[]
| GrafiteAst.Qed loc ->
- let uri, metasenv, bo, ty =
+ let uri, metasenv, bo, ty, attrs =
match status.GrafiteTypes.proof_status with
- | GrafiteTypes.Proof (Some uri, metasenv, body, ty) ->
- uri, metasenv, body, ty
- | GrafiteTypes.Proof (None, metasenv, body, ty) ->
+ | GrafiteTypes.Proof (Some uri, metasenv, body, ty, attrs) ->
+ uri, metasenv, body, ty, attrs
+ | GrafiteTypes.Proof (None, metasenv, body, ty, attrs) ->
raise (GrafiteTypes.Command_error
("Someone allows to start a theorem without giving the "^
"name/uri. This should be fixed!"))
(GrafiteTypes.Command_error
"Proof not completed! metasenv is not empty!");
let name = UriManager.name_of_uri uri in
- let obj = Cic.Constant (name,Some bo,ty,[],[]) in
+ let obj = Cic.Constant (name,Some bo,ty,[],attrs) in
let status, lemmas = add_obj uri obj status in
{status with
GrafiteTypes.proof_status = GrafiteTypes.No_proof},
let obj = CicRefine.pack_coercion_obj obj in
let metasenv = GrafiteTypes.get_proof_metasenv status in
match obj with
- | Cic.CurrentProof (_,metasenv',bo,ty,_,_) ->
+ | Cic.CurrentProof (_,metasenv',bo,ty,_, attrs) ->
let name = UriManager.name_of_uri uri in
if not(CicPp.check name ty) then
HLog.error ("Bad name: " ^ name);
("Theorem already proved: " ^ UriManager.string_of_uri x ^
"\nPlease use a variant."));
end;
- let initial_proof = (Some uri, metasenv', bo, ty) in
+ let initial_proof = (Some uri, metasenv', bo, ty, attrs) in
let initial_stack = Continuationals.Stack.of_metasenv metasenv' in
{ status with GrafiteTypes.proof_status =
GrafiteTypes.Incomplete_proof
let get_proof_metasenv status =
match status.proof_status with
| No_proof -> []
- | Proof (_, metasenv, _, _)
- | Incomplete_proof { proof = (_, metasenv, _, _) }
+ | Proof (_, metasenv, _, _, _)
+ | Incomplete_proof { proof = (_, metasenv, _, _, _) }
| Intermediate metasenv ->
metasenv
let proof_status =
match status.proof_status with
| No_proof -> Intermediate metasenv
- | Incomplete_proof ({ proof = (uri, _, proof, ty) } as incomplete_proof) ->
+ | Incomplete_proof ({ proof = (uri, _, proof, ty, attrs) } as incomplete_proof) ->
Incomplete_proof
- { incomplete_proof with proof = (uri, metasenv, proof, ty) }
+ { incomplete_proof with proof = (uri, metasenv, proof, ty, attrs) }
| Intermediate _ -> Intermediate metasenv
- | Proof (_, metasenv', _, _) ->
+ | Proof (_, metasenv', _, _, _) ->
assert (metasenv = metasenv');
status.proof_status
in
let get_proof_context status goal =
match status.proof_status with
- | Incomplete_proof { proof = (_, metasenv, _, _) } ->
+ | Incomplete_proof { proof = (_, metasenv, _, _, _) } ->
let (_, context, _) = CicUtil.lookup_meta goal metasenv in
context
| _ -> []
let get_proof_conclusion status goal =
match status.proof_status with
- | Incomplete_proof { proof = (_, metasenv, _, _) } ->
+ | Incomplete_proof { proof = (_, metasenv, _, _, _) } ->
let (_, _, conclusion) = CicUtil.lookup_meta goal metasenv in
conclusion
| _ -> raise (Statement_error "no ongoing proof")
let init_cache_and_tables dbd use_library paramod universe (proof, goal) =
(* the local cache in initially empty *)
let cache = AutoCache.cache_empty in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let signature = MetadataQuery.signature_of metasenv goal in
let newmeta = CicMkImplicit.new_meta metasenv [] in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let close_more tables maxmeta context status auto universe cache =
let (active,passive,bag) = tables in
let proof, goalno = status in
- let _, metasenv,_,_ = proof in
+ let _, metasenv,_,_, _ = proof in
let signature = MetadataQuery.signature_of metasenv goalno in
let equations = retrieve_equations signature universe cache context in
let eqs_and_types =
let module C = Cic in
let module S = CicSubstitution in
let module T = CicTypeChecker in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let newmeta = max (ProofEngineHelpers.new_meta_of_proof ~proof) maxmeta in
(* if use_auto is true, we try to close the hypothesis of equational
statements using auto; a naif, and probably wrong approach *)
match arguments with [] -> term' | _ -> Cic.Appl (term'::arguments)
in
let proof',oldmetasenv =
- let (puri,metasenv,pbo,pty) = proof in
- (puri,newmetasenv,pbo,pty),metasenv
+ let (puri,metasenv,pbo,pty, attrs) = proof in
+ (puri,newmetasenv,pbo,pty, attrs),metasenv
in
let goal_for_paramod =
match LibraryObjects.eq_URI () with
in
let newmeta = CicMkImplicit.new_meta newmetasenv (*subst*) [] in
let metasenv_for_paramod = (newmeta,context,goal_for_paramod)::newmetasenv in
- let proof'' = let uri,_,p,ty = proof' in uri,metasenv_for_paramod,p,ty in
+ let proof'' = let uri,_,p,ty, attrs = proof' in uri,metasenv_for_paramod,p,ty, attrs in
let irl = CicMkImplicit.identity_relocation_list_for_metavariable context in
let proof''',goals =
ProofEngineTypes.apply_tactic
| Some (_,proof''''',_), active,passive,_ ->
subst,proof''''',
ProofEngineHelpers.compare_metasenvs ~oldmetasenv
- ~newmetasenv:(let _,m,_,_ = proof''''' in m), active, passive
+ ~newmetasenv:(let _,m,_,_, _ = proof''''' in m), active, passive
;;
let rec count_prods context ty =
let module T = CicTypeChecker in
let module R = CicReduction in
let module C = Cic in
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let newmeta = CicMkImplicit.new_meta metasenv subst in
let exp_named_subst_diff,newmeta',newmetasenvfragment,term' =
with
| None, active, passive, maxmeta ->
[], (active,passive,bag), cache, maxmeta, flags
- | Some(subst',(_,metasenv,proof,_),open_goals),active,passive,maxmeta ->
+ | Some(subst',(_,metasenv,proof,_, _),open_goals),active,passive,maxmeta ->
assert_subst_are_disjoint subst subst';
let subst = subst@subst' in
let open_goals = order_new_goals metasenv subst open_goals ppterm in
assert (maxmeta >= maxm);
let res' =
List.map
- (fun subst',(_,metasenv,proof,_),open_goals ->
+ (fun subst',(_,metasenv,proof,_, _),open_goals ->
assert_subst_are_disjoint subst subst';
let subst = subst@subst' in
let open_goals = order_new_goals metasenv subst open_goals ppterm in
=
let ppterm = ppterm context in
try
- let subst', ((_,metasenv,_,_), open_goals), maxmeta =
+ let subst', ((_,metasenv,_,_, _), open_goals), maxmeta =
PrimitiveTactics.apply_with_subst
~maxmeta:maxm ~term:cand ~subst (fake_proof,goalno)
in
| Notfound
| Failed_in _ when depth > 0 -> (* we have more depth now *)
let cache = cache_add_underinspection cache goalty depth in
- let fake_proof = None,metasenv,Cic.Meta(goalno,irl),goalty in
+ let fake_proof = None,metasenv,Cic.Meta(goalno,irl),goalty, [] in (* FG: attrs *)
let elems, tables, cache, maxm, flags =
if is_equational_case goalty flags then
let elems,tables,cache,maxm1, flags =
let superposition_tac ~target ~table ~subterms_only ~demod_table status =
Saturation.reset_refs();
let proof,goalno = status in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goalno metasenv in
let eq_uri,tty = eq_and_ty_of_goal ty in
let env = (metasenv, context, CicUniv.empty_ugraph) in
~target ~table ~subterms_only ~demod_table (proof,goal)
| false ->
(* this is the real auto *)
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let flags = flags_of_params params () in
(* just for testing *)
tables newmeta context (proof, goal) auto_all_solutions universe cache
else tables,cache,newmeta in
let initial_time = Unix.gettimeofday() in
- let (_,oldmetasenv,_,_) = proof in
+ let (_,oldmetasenv,_,_, _) = proof in
let elem = metasenv,[],[goal,flags.maxdepth,AutoTypes.P] in
match auto_main tables newmeta context flags [elem] universe cache with
| Success (metasenv,subst,_), tables,cache,_ ->
(* DEMODULATE *)
let demodulate_tac ~dbd ~universe (proof,goal)=
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let irl = CicMkImplicit.identity_relocation_list_for_metavariable context in
let initgoal = [], [], ty in
in
let extended_metasenv = (maxm,context,newty)::metasenv in
let extended_status =
- (curi,extended_metasenv,pbo,pty),goal in
+ (curi,extended_metasenv,pbo,pty, attrs),goal in
let (status,newgoals) =
ProofEngineTypes.apply_tactic
(PrimitiveTactics.apply_tac ~term:proofterm)
let module S = CicSubstitution in
let module PET = ProofEngineTypes in
let module PT = PrimitiveTactics in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,ty = CicUtil.lookup_meta goal metasenv in
let rec find n = function
| [] -> []
let compare_goals proof goal1 goal2 =
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let (_, ey1, ty1) = CicUtil.lookup_meta goal1 metasenv in
let (_, ey2, ty2) = CicUtil.lookup_meta goal2 metasenv in
let ty_sort1,_ = CicTypeChecker.type_of_aux' metasenv ey1 ty1
if List.mem ty already_seen_goals then [] else
let already_seen_goals = ty::already_seen_goals in
let facts = (depth = 1) in
- let _,metasenv,p,_ = proof in
+ let _,metasenv,p,_, _ = proof in
(* first of all we check if the goal has been already
inspected *)
assert (CicUtil.exists_meta goal metasenv);
and auto_new dbd width already_seen_goals universe = function
| [] -> []
| (subst,(proof, goals, sign))::tl ->
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let goals'=
List.filter (fun (goal, _) -> CicUtil.exists_meta goal metasenv) goals
in
(List.length goals) > width ->
auto_new dbd width already_seen_goals universe tl
| (subst,(proof, (goal,depth)::gtl, sign))::tl ->
- let _,metasenv,p,_ = proof in
+ 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) universe
| (_,(proof,[],_))::_ ->
let t2 = Unix.gettimeofday () in
debug_print (lazy "AUTO_TAC HA FINITO");
- let _,_,p,_ = proof in
+ let _,_,p,_, _ = proof in
debug_print (lazy (CicPp.ppterm p));
debug_print (lazy (Printf.sprintf "tempo: %.9f\n" (t2 -. t1)));
(proof,[])
let rewritingstep ~dbd ~universe lhs rhs just last_step =
let aux ((proof,goal) as status) =
- let (curi,metasenv,proofbo,proofty) = proof in
+ let (curi,metasenv,proofbo,proofty, attrs) = proof in
let _,context,gty = CicUtil.lookup_meta goal metasenv in
let eq,trans =
match LibraryObjects.eq_URI () with
FreshNamesGenerator.mk_fresh_name ~subst:[] metasenv context
(Cic.Name name) ~typ
in
- let proof = curi,metasenv,proofbo,proofty in
+ let proof = curi,metasenv,proofbo,proofty, attrs in
let proof,goals =
ProofEngineTypes.apply_tactic
(Tacticals.thens
in
let discriminate'_tac ~term status =
let (proof, goal) = status in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let termty,_ =
CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph
let module U = UriManager in
let module P = PrimitiveTactics in
let module T = Tacticals in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let term = CicSubstitution.lift liftno term in
let termty,_ = (* TASSI: FIXME *)
let module P = PrimitiveTactics in
let module T = Tacticals in
let term = CicSubstitution.lift liftno term in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let termty,_ = (* TASSI: FIXME *)
CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph
~start:(ProofEngineTypes.mk_tactic
(fun status ->
let (proof, goal) = status in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,gty =
CicUtil.lookup_meta goal metasenv
in
let rec scan_tac ~old_context_length ~index ~tactic =
let scan_tac status =
let (proof, goal) = status in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let context_length = List.length context in
let rec aux index =
let elim_clear_unfold_tac ~mk_fresh_name_callback ~types ~what =
let elim_clear_unfold_tac status =
let (proof, goal) = status in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let index, ty = H.lookup_type metasenv context what in
match check_types types ty with
?(user_types=[]) ?what ~dbd =
let decompose_tac status =
let (proof, goal) = status in
- let _, metasenv,_,_ = proof in
+ let _, metasenv,_,_, _ = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let types = List.rev_append user_types (FwdQueries.decomposables dbd) in
let tactic = elim_clear_unfold_tac ~mk_fresh_name_callback ~types in
let _rewrite_tac status =
assert (wanted = None); (* this should be checked syntactically *)
let proof,goal = status in
- let curi, metasenv, pbo, pty = proof in
+ let curi, metasenv, pbo, pty, attrs = proof in
let (metano,context,gty) = CicUtil.lookup_meta goal metasenv in
match hyps_pat with
he::(_::_ as tl) ->
try
let (proof',goals) =
PET.apply_tactic
- (tac ~term:exact_proof newtyp) ((curi,metasenv',pbo,pty),goal)
+ (tac ~term:exact_proof newtyp) ((curi,metasenv',pbo,pty, attrs),goal)
in
let goals =
goals@(ProofEngineHelpers.compare_metasenvs ~oldmetasenv:metasenv
let replace_tac ~(pattern: ProofEngineTypes.lazy_pattern) ~with_what status =
let _wanted, hyps_pat, concl_pat = pattern in
let (proof, goal) = status in
- let uri,metasenv,pbo,pty = proof in
+ let uri,metasenv,pbo,pty, attrs = proof in
let (_,context,ty) as conjecture = CicUtil.lookup_meta goal metasenv in
assert (hyps_pat = []); (*CSC: not implemented yet *)
let eq_URI =
let with_what = CicMetaSubst.apply_subst subst with_what in
let pbo = CicMetaSubst.apply_subst subst pbo in
let pty = CicMetaSubst.apply_subst subst pty in
- let status = (uri,metasenv,pbo,pty),goal in
+ let status = (uri,metasenv,pbo,pty, attrs),goal in
let ty_of_with_what,u =
CicTypeChecker.type_of_aux'
metasenv context with_what CicUniv.empty_ugraph in
~start:(
ProofEngineTypes.mk_tactic
(function ((proof,goal) as status) ->
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,_ = CicUtil.lookup_meta goal metasenv in
let hyps =
try
let symmetry_tac =
let symmetry_tac (proof, goal) =
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
match (R.whd context ty) with
(C.Appl [(C.MutInd (uri, 0, [])); _; _; _])
let transitivity_tac ~term =
let transitivity_tac ~term status =
let (proof, goal) = status in
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
match (R.whd context ty) with
(C.Appl [(C.MutInd (uri, 0, [])); _; _; _])
let rec lift_rewrite_tac ~context ~direction ~pattern equality =
let lift_rewrite_tac status =
let (proof, goal) = status in
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let _, new_context, _ = CicUtil.lookup_meta goal metasenv in
let n = List.length new_context - List.length context in
let equality = if n > 0 then S.lift n equality else equality in
let hole = C.Implicit (Some `Hole) in
let subst_tac status =
let (proof, goal) = status in
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let what = match PEH.get_rel context hyp with
| Some t -> t
in
let subst_tac status =
let (proof, goal) = status in
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let tactics = HEL.list_rev_map_filter map context in
PET.apply_tactic (T.seq ~tactics) status
(*let cste = pf_parse_constr gl in*)
let pall str (proof,goal) t =
debug ("tac "^str^" :\n" );
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
debug ("th = "^ CicPp.ppterm t ^"\n");
debug ("ty = "^ CicPp.ppterm ty^"\n");
let tac_zero_infeq_false gl (n,d) =
let tac_zero_infeq_false gl (n,d) status =
let (proof, goal) = status in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
debug("faccio fold di " ^ CicPp.ppterm
let apply_type_tac ~cast:t ~applist:al =
let apply_type_tac ~cast:t ~applist:al (proof,goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let fresh_meta = ProofEngineHelpers.new_meta_of_proof proof in
let irl =
CicMkImplicit.identity_relocation_list_for_metavariable context in
let metasenv' = (fresh_meta,context,t)::metasenv in
- let proof' = curi,metasenv',pbo,pty in
+ let proof' = curi,metasenv',pbo,pty, attrs in
let proof'',goals =
apply_tactic
(PrimitiveTactics.apply_tac
let my_cut ~term:c =
let my_cut ~term:c (proof,goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let fresh_meta = ProofEngineHelpers.new_meta_of_proof proof in
let irl =
CicMkImplicit.identity_relocation_list_for_metavariable context in
let metasenv' = (fresh_meta,context,c)::metasenv in
- let proof' = curi,metasenv',pbo,pty in
+ let proof' = curi,metasenv',pbo,pty, attrs in
let proof'',goals =
apply_tactic
(apply_type_tac
let tac_use h status =
let (proof, goal) = status in
debug("Inizio TC_USE\n");
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
debug ("hname = "^ CicPp.ppterm h.hname ^"\n");
debug ("ty = "^ CicPp.ppterm ty^"\n");
debug("inizio EQ\n");
let module C = Cic in
let proof,goal = status in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let a_eq_b = C.Appl [ _eqT ; _R ; a ; b ] in
let fresh_meta = ProofEngineHelpers.new_meta_of_proof proof in
~direction:`LeftToRight
~pattern:(ProofEngineTypes.conclusion_pattern None)
(C.Meta (fresh_meta,irl)) [])
- ((curi,metasenv',pbo,pty),goal)
+ ((curi,metasenv',pbo,pty, attrs),goal)
in
let new_goals = fresh_meta::goals in
debug("fine EQ -> goals : "^string_of_int( List.length new_goals) ^" = "
(* ********************* TATTICA ******************************** *)
let rec fourier (s_proof,s_goal)=
- let s_curi,s_metasenv,s_pbo,s_pty = s_proof in
+ let s_curi,s_metasenv,s_pbo,s_pty, attrs = s_proof in
let s_metano,s_context,s_ty = CicUtil.lookup_meta s_goal s_metasenv in
debug ("invoco fourier_tac sul goal "^string_of_int(s_goal)^" e contesto:\n");
debug_pcontext s_context;
(* now we have all the right environment *)
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
(* now we want to convert hp to inequations, but first we must lift
(Tacticals.thens
~start:(mk_tactic (fun status ->
debug ("inizio t1 strict\n");
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
debug ("th = "^ CicPp.ppterm _Rfourier_lt ^"\n");
debug ("ty = "^ CicPp.ppterm ty^"\n");
tac1:=(Tacticals.thens
~start:(mk_tactic (fun status ->
debug("INIZIO TAC 1 2\n");
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
debug ("th = "^ CicPp.ppterm _Rfourier_lt_le ^"\n");
debug ("ty = "^ CicPp.ppterm ty^"\n");
~continuations:[Tacticals.then_
~start:( mk_tactic (fun status ->
let (proof, goal) = status in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
apply_tactic
(ReductionTactics.change_tac
Tacticals.then_
~start:(mk_tactic (fun status ->
let (proof, goal) = status in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
(* check if ty is of type *)
let w1 =
let id_tac =
let id_tac (proof,goal) =
try
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, _, _ = CicUtil.lookup_meta goal metasenv in
(proof,[goal])
with CicUtil.Meta_not_found _ -> (proof, [])
in
let clearbody status =
let (proof, goal) = status in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
PET.apply_tactic (PESR.clearbody ~hyp:(find_name index context)) status
in
(* ?(substs = []) *) ?how_many ?(to_what = []) what =
let letin_tac term = PT.letin_tac ~mk_fresh_name_callback term in
let lapply_tac (proof, goal) =
- let xuri, metasenv, u, t = proof in
+ let xuri, metasenv, u, t, attrs = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let lemma, _ = TC.type_of_aux' metasenv context what U.empty_ugraph in
let lemma = FNG.clean_dummy_dependent_types lemma in
T.then_ ~start:(letin_tac conclusion)
~continuation:(clearbody ~index:1)
in
- let proof = (xuri, metasenv, u, t) in
+ let proof = (xuri, metasenv, u, t, attrs) in
let aux (proof, goals) (tac, goal) =
let proof, new_goals = PET.apply_tactic tac (proof, goal) in
proof, goals @ new_goals
(* ?(substs = []) *) ?(linear = false) ?how_many ?(to_what = []) what =
let lapply_tac status =
let proof, goal = status in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, context, _ = CicUtil.lookup_meta goal metasenv in
let lapply = lapply_tac_aux ~mk_fresh_name_callback ?how_many ~to_what what in
let tac =
in
let fwd_simpl_tac status =
let (proof, goal) = status in
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, context, ty = CicUtil.lookup_meta goal metasenv in
let index, major = PEH.lookup_type metasenv context hyp in
match FwdQueries.fwd_simpl ~dbd major with
let fake_constructor_tac ~n (proof, goal) =
let module C = Cic in
let module R = CicReduction in
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
match (R.whd context ty) with
(C.MutInd (uri, typeno, exp_named_subst))
let private_inversion_tac ~term (proof, goal) =
(*DEBUG*) debug_print (lazy ("private inversion begins"));
- let (_,metasenv,_,_) = proof in
+ let _,metasenv,_,_, _ = proof in
let uri_of_eq =
match LibraryObjects.eq_URI () with
None -> raise EqualityNotDefinedYet
(*DEBUG*) debug_print (lazy ("after apply HCUT;reflexivity
in private inversion"));
(* apply (ledx_ind( lambda x. lambda y, ...)) *)
- let (t1,metasenv,t3,t4) = proof2 in
+ let t1,metasenv,t3,t4, attrs = proof2 in
let goal2 = List.hd (List.tl gl1) in
let (_,context,_) = CicUtil.lookup_meta goal2 metasenv in
(* rightparameters type list *)
in
(*DEBUG*) debug_print (lazy ("private inversion: termine after refinement: "
^ CicPp.ppterm ref_t));
- let proof2 = (t1,metasenv'',t3,t4) in
+ let proof2 = (t1,metasenv'',t3,t4, attrs) in
let my_apply_tac =
let my_apply_tac status =
let proof,goals =
ProofEngineTypes.apply_tactic (P.apply_tac ref_t) status in
let patched_new_goals =
- let (_,metasenv''',_,_) = proof in
+ let (_,metasenv''',_,_, _) = proof in
let new_goals = ProofEngineHelpers.compare_metasenvs
~oldmetasenv:metasenv ~newmetasenv:metasenv''
in
let module PET = ProofEngineTypes in
let inversion_tac ~term (proof, goal) =
(*DEBUG*) debug_print (lazy ("inversion begins"));
- let (_,metasenv,_,_) = proof in
+ let _,metasenv,_,_, _ = proof in
let (_,context,goalty) = CicUtil.lookup_meta goal metasenv in
let termty,_ = T.type_of_aux' metasenv context term CicUniv.empty_ugraph in
let uri, typeno =
Cic.Appl ([Cic.Const(uri,[])] @ !a @ [Cic.Rel 1])
in
let t = appl_term (arity_length + (List.length cons_list)) inversor_uri in
- let (t1,metasenv,t3,t4) = proof in
+ let (t1,metasenv,t3,t4, attrs) = proof in
let (ref_t,_,metasenv'',_) = CicRefine.type_of_aux' metasenv context t
CicUniv.empty_ugraph
in
- let proof = (t1,metasenv'',t3,t4) in
+ let proof = (t1,metasenv'',t3,t4, attrs) in
let proof3,gl3 =
ProofEngineTypes.apply_tactic (P.apply_tac ref_t) (proof,goal) in
let patched_new_goals =
- let (_,metasenv''',_,_) = proof3 in
+ let (_,metasenv''',_,_, _) = proof3 in
let new_goals = ProofEngineHelpers.compare_metasenvs
~oldmetasenv:metasenv ~newmetasenv:metasenv''
in
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
-*
+ *
* HELM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
UriManager.uri_of_string (buri ^ "/" ^ name ^ "_inv" ^ ".con") in
let goal = CicMkImplicit.new_meta metasenv [] in
let metasenv' = (goal,[],ref_theorem)::metasenv in
+ let attrs = [`Class (`InversionPrinciple); `Generated] in
let proof=
- (Some inversor_uri,metasenv',Cic.Meta(goal,[]),ref_theorem) in
+ (Some inversor_uri,metasenv',Cic.Meta(goal,[]),ref_theorem, attrs) in
let _,applies =
List.fold_right
(fun _ (i,applies) ->
))
(proof,goal)
in
- let metasenv,bo,ty =
- match proof1 with (_,metasenv,bo,ty) -> metasenv,bo,ty
+ let metasenv,bo,ty, attrs =
+ match proof1 with (_,metasenv,bo,ty, attrs) -> metasenv,bo,ty, attrs
in
assert (metasenv = []);
Some
intersect uris siguris
let compare_goal_list proof goal1 goal2 =
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let (_, ey1, ty1) = CicUtil.lookup_meta goal1 metasenv in
let (_, ey2, ty2) = CicUtil.lookup_meta goal2 metasenv in
let ty_sort1,_ =
(* used only by te old auto *)
let signature_of_goal ~(dbd:HMysql.dbd) ((proof, goal) as _status) =
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
let main, sig_constants = Constr.signature_of ty in
let set = signature_of_hypothesis context metasenv in
^ "\n}"
in
*)
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
let main, sig_constants =
match signature with
let experimental_hint
~(dbd:HMysql.dbd) ?(facts=false) ?signature ((proof, goal) as status) =
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
let (uris, (main, sig_constants)) =
match signature with
~(dbd:HMysql.dbd) ?(facts=false) ?signature ~universe
((proof, goal) as status)
=
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let (_, context, ty) = CicUtil.lookup_meta goal metasenv in
let (uris, (main, sig_constants)) =
match signature with
let module C = Cic in
let module U = UriManager in
let module P = PrimitiveTactics in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,ty = CicUtil.lookup_meta goal metasenv in
let absurd_URI =
match LibraryObjects.absurd_URI () with
if proof_menv = [] then prerr_endline "+++++++++++++++VUOTA"
else prerr_endline (CicMetaSubst.ppmetasenv [] proof_menv);
let proof, goalno = status in
- let uri, metasenv, meta_proof, term_to_prove = proof in
+ let uri, metasenv, meta_proof, term_to_prove, attrs = proof in
let _, context, type_of_goal = CicUtil.lookup_meta goalno metasenv in
let eq_uri = eq_of_goal type_of_goal in
let names = Utils.names_of_context context in
let all_subsumed bag maxm status active passive =
maxmeta := maxm;
let proof, goalno = status in
- let uri, metasenv, meta_proof, term_to_prove = proof in
+ let uri, metasenv, meta_proof, term_to_prove, attrs = proof in
let _, context, type_of_goal = CicUtil.lookup_meta goalno metasenv in
let env = metasenv,context,CicUniv.empty_ugraph in
let cleaned_goal = Utils.remove_local_context type_of_goal in
let ma = max_l active_l in
let mp = max_l passive_l in
let proof, goalno = status in
- let uri, metasenv, meta_proof, term_to_prove = proof in
+ let uri, metasenv, meta_proof, term_to_prove, attrs = proof in
let _, context, type_of_goal = CicUtil.lookup_meta goalno metasenv in
let eq_uri = eq_of_goal type_of_goal in
let cleaned_goal = Utils.remove_local_context type_of_goal in
let module T = CicTypeChecker in
let module R = CicReduction in
let module C = Cic in
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let newmeta = max (CicMkImplicit.new_meta metasenv subst) maxmeta in
let exp_named_subst_diff,newmeta',newmetasenvfragment,term' =
=
let module C = Cic in
let module R = CicReduction in
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in
let (context',ty',bo') =
term (proof, goal)
=
let module C = Cic in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let newmeta1 = ProofEngineHelpers.new_meta_of_proof ~proof in
let newmeta2 = newmeta1 + 1 in
term (proof, goal)
=
let module C = Cic in
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
(* occur check *)
let occur i t =
let m = CicUtil.metas_of_term t in
let exact_tac ~term =
let exact_tac ~term (proof, goal) =
(* Assumption: the term bo must be closed in the current context *)
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let module T = CicTypeChecker in
let module R = CicReduction in
let module U = UriManager in
let module R = CicReduction in
let module C = Cic in
- let (curi,metasenv,proofbo,proofty) = proof in
+ let (curi,metasenv,proofbo,proofty, attrs) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let termty,_ = T.type_of_aux' metasenv context term CicUniv.empty_ugraph in
let termty = CicReduction.whd context termty in
ProofEngineHelpers.compare_metasenvs
~oldmetasenv:metasenv ~newmetasenv:metasenv''
in
- let proof' = curi,metasenv'',proofbo,proofty in
+ let proof' = curi,metasenv'',proofbo,proofty, attrs in
let proof'', new_goals' =
apply_tactic (apply_tac ~term:refined_term) (proof',goal)
in
(* The apply_tactic can have closed some of the new_goals *)
let patched_new_goals =
- let (_,metasenv''',_,_) = proof'' in
+ let (_,metasenv''',_,_, _) = proof'' in
List.filter
(function i -> List.exists (function (j,_,_) -> j=i) metasenv'''
) new_goals @ new_goals'
let module U = UriManager in
let module R = CicReduction in
let module C = Cic in
- let (curi,metasenv,proofbo,proofty) = proof in
+ let (curi,metasenv,proofbo,proofty, attrs) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let termty,_ = T.type_of_aux' metasenv context term CicUniv.empty_ugraph in
let termty = CicReduction.whd context termty in
ProofEngineHelpers.compare_metasenvs
~oldmetasenv:metasenv ~newmetasenv:metasenv''
in
- let proof' = curi,metasenv'',proofbo,proofty in
+ let proof' = curi,metasenv'',proofbo,proofty, attrs in
let proof'', new_goals' =
apply_tactic (apply_tac ~term:refined_term) (proof',goal)
in
(* The apply_tactic can have closed some of the new_goals *)
let patched_new_goals =
- let (_,metasenv''',_,_) = proof'' in
+ let (_,metasenv''',_,_,_) = proof'' in
List.filter
(function i -> List.exists (function (j,_,_) -> j=i) metasenv'''
) new_goals @ new_goals'
let mk_fresh_name_callback = FreshNamesGenerator.mk_fresh_name ~subst:[] in
let term = C.Sort C.Set in
let letout_tac (proof, goal) =
- let curi, metasenv, pbo, pty = proof in
+ let curi, metasenv, pbo, pty, attrs = proof in
let metano, context, ty = CicUtil.lookup_meta goal metasenv in
let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in
let fresh_name = mk_fresh_name_callback metasenv context (Cic.Name "hole") ~typ:term in
exception Bad_pattern of string Lazy.t
-let new_meta_of_proof ~proof:(_, metasenv, _, _) =
+let new_meta_of_proof ~proof:(_, metasenv, _, _, _) =
CicMkImplicit.new_meta metasenv []
let subst_meta_in_proof proof meta term newmetasenv =
- let uri,metasenv,bo,ty = proof in
+ let uri,metasenv,bo,ty, attrs = proof in
(* empty context is ok for term since it wont be used by apply_subst *)
(* hack: since we do not know the context and the type of term, we
create a substitution with cc =[] and type = Implicit; they will be
* since the parser does not reject as statements terms with
* metavariable therein *)
let ty' = subst_in ty in
- let newproof = uri,metasenv'',bo',ty' in
+ let newproof = uri,metasenv'',bo',ty', attrs in
(newproof, metasenv'')
(*CSC: commento vecchio *)
(*CSC: Attenzione! Ora questa funzione applica anche [subst_in] a *)
(*CSC: [newmetasenv]. *)
let subst_meta_and_metasenv_in_proof proof meta subst_in newmetasenv =
- let (uri,_,bo,ty) = proof in
+ let (uri,_,bo,ty, attrs) = proof in
let bo' = subst_in bo in
(* Metavariables can appear also in the *statement* of the theorem
* since the parser does not reject as statements terms with
| _ -> i
) newmetasenv []
in
- let newproof = uri,metasenv',bo',ty' in
+ let newproof = uri,metasenv',bo',ty', attrs in
(newproof, metasenv')
let compare_metasenvs ~oldmetasenv ~newmetasenv =
let clearbody ~hyp =
let clearbody (proof, goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,_,_ = CicUtil.lookup_meta goal metasenv in
let string_of_name =
function
| t -> t
) metasenv
in
- (curi,metasenv',pbo,pty), [goal]
+ (curi,metasenv',pbo,pty, attrs), [goal]
in
PET.mk_tactic clearbody
let clear_one ~hyp =
let clear_one (proof, goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let metano,context,ty =
CicUtil.lookup_meta goal metasenv
in
| t -> t
) metasenv
in
- (curi,metasenv',pbo,pty), [goal]
+ (curi,metasenv',pbo,pty, attrs), [goal]
in
PET.mk_tactic clear_one
try List.combine froms tos
with Invalid_argument _ -> raise (PET.Fail (lazy error))
in
- let curi, metasenv, pbo, pty = proof in
+ let curi, metasenv, pbo, pty, attrs = proof in
let metano, _, _ = CicUtil.lookup_meta goal metasenv in
let rename_map = function
| Some (Cic.Name hyp, decl_or_def) as entry ->
| conjecture -> conjecture
in
let metasenv = List.map map metasenv in
- (curi, metasenv, pbo, pty), [goal]
+ (curi, metasenv, pbo, pty, attrs), [goal]
in
PET.mk_tactic rename
let set_goal n =
PET.mk_tactic
(fun (proof, goal) ->
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
if CicUtil.exists_meta n metasenv then
(proof, [n])
else
(**
current proof (proof uri * metas * (in)complete proof * term to be prooved)
*)
-type proof = UriManager.uri option * Cic.metasenv * Cic.term * Cic.term
+type proof = UriManager.uri option * Cic.metasenv * Cic.term * Cic.term * Cic.attribute list
(** current goal, integer index *)
type goal = int
type status = proof * goal
-let initial_status ty metasenv =
+let initial_status ty metasenv attrs =
let rec aux max = function
| [] -> max + 1
| (idx, _, _) :: tl ->
in
let newmeta_idx = aux 0 metasenv in
let proof =
- None, (newmeta_idx, [], ty) :: metasenv, Cic.Meta (newmeta_idx, []), ty
+ None, (newmeta_idx, [], ty) :: metasenv, Cic.Meta (newmeta_idx, []), ty, attrs
in
(proof, newmeta_idx)
calls the opaque tactic on the status
*)
let apply_tactic t status =
- let (uri,metasenv,bo,ty), gl = t status in
+ let (uri,metasenv,bo,ty, attrs), gl = t status in
match
CicRefine.pack_coercion_obj
- (Cic.CurrentProof ("",metasenv,Cic.Rel ~-1,ty,[],[]))
+ (Cic.CurrentProof ("",metasenv,Cic.Rel ~-1,ty,[],attrs))
with
- | Cic.CurrentProof (_,metasenv,_,ty,_,_) ->
- (uri,metasenv,bo,ty), gl
+ | Cic.CurrentProof (_,metasenv,_,ty,_, attrs) ->
+ (uri,metasenv,bo,ty, attrs), gl
| _ -> assert false
;;
type mk_fresh_name_type =
Cic.metasenv -> Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
-let goals_of_proof (_,metasenv,_,_) = List.map (fun (g,_,_) -> g) metasenv
+let goals_of_proof (_,metasenv,_,_,_) = List.map (fun (g,_,_) -> g) metasenv
(**
current proof (proof uri * metas * (in)complete proof * term to be prooved)
*)
-type proof = UriManager.uri option * Cic.metasenv * Cic.term * Cic.term
+type proof =
+ UriManager.uri option * Cic.metasenv * Cic.term * Cic.term * Cic.attribute list
(** current goal, integer index *)
type goal = int
type status = proof * goal
(** @param goal
* @param goal's metasenv
* @return initial proof status for the given goal *)
-val initial_status: Cic.term -> Cic.metasenv -> status
+val initial_status: Cic.term -> Cic.metasenv -> Cic.attribute list -> status
(**
a tactic: make a transition from one status to another one or, usually,
(* Note: this code is almost identical to change_tac and
* it could be unified by making the change function a callback *)
let reduction_tac ~reduction ~pattern (proof,goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let (metano,context,ty) as conjecture = CicUtil.lookup_meta goal metasenv in
let change subst where terms metasenv ugraph =
if terms = [] then where, metasenv, ugraph
| _ as t -> t
) metasenv
in
- (curi,metasenv',pbo,pty), [metano]
+ (curi,metasenv',pbo,pty, attrs), [metano]
;;
let simpl_tac ~pattern =
term(s) to be replaced. *)
let change_tac ~pattern with_what =
let change_tac ~pattern ~with_what (proof, goal) =
- let curi,metasenv,pbo,pty = proof in
+ let curi,metasenv,pbo,pty, attrs = proof in
let (metano,context,ty) as conjecture = CicUtil.lookup_meta goal metasenv in
let change subst where terms metasenv ugraph =
if terms = [] then where, metasenv, ugraph
| _ as t -> t)
metasenv
in
- (curi,metasenv',pbo,pty), [metano]
+ (curi,metasenv',pbo,pty, attrs), [metano]
in
mk_tactic (change_tac ~pattern ~with_what)
@param proof a proof
@return the uri of a given proof
*)
-let uri_of_proof ~proof:(uri, _, _, _) = uri
+let uri_of_proof ~proof:(uri, _, _, _, _) = uri
(**
@param status current proof engine status
@raise Failure if proof is None
@return current goal's metasenv
*)
-let metasenv_of_status ((_,m,_,_), _) = m
+let metasenv_of_status ((_,m,_,_, _), _) = m
(**
@param status a proof engine status
(ProofEngineTypes.apply_tactic (S.clear ~hyps:[name_of_hyp]) status))
| (_, []) -> failwith "Ring.purge_hyps_tac: no hypotheses left"
in
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let (_, context, _) = CicUtil.lookup_meta goal metasenv in
let proof',goal' = aux count context status in
assert (goal = goal') ;
let setoid_reflexivity_tac =
let tac ((proof,goal) as status) =
- let (_,metasenv,_,_) = proof in
+ let (_,metasenv,_,_, _) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
try
let relation_class =
class ['a] status
?(history_size = default_history_size)
- ?uri ~typ ~body ~metasenv init_data compute_data ()
+ ?uri ~typ ~body ~metasenv ~attrs init_data compute_data ()
=
let next_observer_id =
let next_id = ref 0 in
incr next_id;
!next_id
in
- let initial_proof = ((uri: UriManager.uri option), metasenv, body, typ) in
+ let initial_proof = ((uri: UriManager.uri option), metasenv, body, typ, attrs) in
let next_goal (goals, proof) =
match goals, proof with
| goal :: _, _ -> Some goal
- | [], (_, (goal, _, _) :: _, _, _) ->
+ | [], (_, (goal, _, _) :: _, _, _, _) ->
(* the tactic left no open goal: let's choose the first open goal *)
Some goal
| _, _ -> None
raise exn
*)
- method uri = let (uri, _, _, _) = _proof in uri
- method metasenv = let (_, metasenv, _, _) = _proof in metasenv
- method body = let (_, _, body, _) = _proof in body
- method typ = let (_, _, _, typ) = _proof in typ
+ method uri = let (uri, _, _, _, _) = _proof in uri
+ method metasenv = let (_, metasenv, _, _, _) = _proof in metasenv
+ method body = let (_, _, body, _, _) = _proof in body
+ method typ = let (_, _, _, typ, _) = _proof in typ
+ method attrs = let (_, _, _, _, attrs) = _proof in attrs
method set_metasenv metasenv =
- let (uri, _, body, typ) = _proof in
- _proof <- (uri, metasenv, body, typ)
+ let (uri, _, body, typ, attes) = _proof in
+ _proof <- (uri, metasenv, body, typ, attrs)
method set_uri uri =
- let (old_uri, metasenv, body, typ) = _proof in
+ let (old_uri, metasenv, body, typ, attrs) = _proof in
if old_uri <> None then
raise Uri_redefinition;
- _proof <- (Some uri, metasenv, body, typ)
+ _proof <- (Some uri, metasenv, body, typ, attrs)
method conjecture goal =
- let (_, metasenv, _, _) = _proof in
+ let (_, metasenv, _, _, _) = _proof in
CicUtil.lookup_meta goal metasenv
method apply_tactic tactic =
end
-let trivial_status ?uri ~typ ~body ~metasenv () =
- new status ?uri ~typ ~body ~metasenv (fun _ -> ()) (fun _ _ -> ()) ()
+let trivial_status ?uri ~typ ~body ~metasenv ~attrs () =
+ new status ?uri ~typ ~body ~metasenv ~attrs (fun _ -> ()) (fun _ _ -> ()) ()
?history_size:int -> (** default 20 *)
?uri:UriManager.uri ->
typ:Cic.term -> body:Cic.term -> metasenv:Cic.metasenv ->
+ attrs:Cic.attribute list ->
(proof_status -> 'a) -> (* init data *)
(proof_status * 'a -> proof_status -> 'a) -> (* update data *)
unit ->
method metasenv: Cic.metasenv
method body: Cic.term
method typ: Cic.term
+ method attrs: Cic.attribute list
(** change metasenv _without_ triggering any notification *)
method set_metasenv: Cic.metasenv -> unit
val trivial_status:
?uri:UriManager.uri ->
typ:Cic.term -> body:Cic.term -> metasenv:Cic.metasenv ->
+ attrs:Cic.attribute list ->
unit ->
unit status
let id_tac =
let id_tac (proof,goal) =
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, _, _ = CicUtil.lookup_meta goal metasenv in
(proof,[goal])
in
let fail_tac =
let fail_tac (proof,goal) =
- let _, metasenv, _, _ = proof in
+ let _, metasenv, _, _, _ = proof in
let _, _, _ = CicUtil.lookup_meta goal metasenv in
raise (PET.Fail (lazy "fail tactical"))
in
let progress_tactic ~tactic =
let msg = lazy "Failed to progress" in
let get_sequent (proof, goal) =
- let (_, metasenv, _, _) = proof in
+ let (_, metasenv, _, _, _) = proof in
let _, context, ty = CicUtil.lookup_meta goal metasenv in
context, ty
in
let module R = CicReduction in
let module S = CicSubstitution in
let module PT = PrimitiveTactics in
- let _,metasenv,_,_ = proof in
+ let _,metasenv,_,_, _ = proof in
let _,context,ty = CicUtil.lookup_meta goal metasenv in
let rec find n = function
hd::tl ->
let module C = Cic in
let module P = PrimitiveTactics in
let module T = Tacticals in
- let uri,metasenv,pbo,pty = proof in
+ let uri,metasenv,pbo,pty, attrs = proof in
let (_,context,ty) as conjecture = CicUtil.lookup_meta goal metasenv in
let subst,metasenv,u,selected_hyps,terms_with_context =
ProofEngineHelpers.select ~metasenv ~ugraph:CicUniv.empty_ugraph
else
u1
) u terms_with_context) ;
- let status = (uri,metasenv',pbo,pty),goal in
+ let status = (uri,metasenv',pbo,pty, attrs),goal in
let proof,goals =
PET.apply_tactic
(T.thens
T.id_tac])
status
in
- let _,metasenv'',_,_ = proof in
+ let _,metasenv'',_,_, _ = proof in
(* CSC: the following is just a bad approximation since a meta
can be closed and then re-opened! *)
(proof,