GrafiteTypes.status ->
(('term, 'lazy_term, 'reduction, 'obj, 'ident) GrafiteAst.statement)
disambiguator_input ->
- GrafiteTypes.status * UriManager.uri list
+ GrafiteTypes.status * [`Old of UriManager.uri list | `New of NUri.uri list]
}
type 'a eval_command =
GrafiteTypes.status * (Cic.term,Cic.obj) GrafiteAst.command) ->
options -> GrafiteTypes.status ->
(('term,'obj) GrafiteAst.command) disambiguator_input ->
- GrafiteTypes.status * UriManager.uri list
+ GrafiteTypes.status * [`Old of UriManager.uri list | `New of NUri.uri list]
}
type 'a eval_comment =
GrafiteTypes.status * (Cic.term,Cic.obj) GrafiteAst.command) ->
options -> GrafiteTypes.status ->
(('term,'lazy_term,'reduction_kind,'obj,'ident) GrafiteAst.comment) disambiguator_input ->
- GrafiteTypes.status * UriManager.uri list
+ GrafiteTypes.status * [`Old of UriManager.uri list | `New of NUri.uri list]
}
type 'a eval_executable =
options ->
GrafiteTypes.status ->
(('term, 'lazy_term, 'reduction, 'obj, 'ident) GrafiteAst.code) disambiguator_input ->
- GrafiteTypes.status * UriManager.uri list
+ GrafiteTypes.status * [`Old of UriManager.uri list | `New of NUri.uri list]
}
type 'a eval_from_moo =
let eval_unification_hint status t n =
(* XXX no undo *)
NCicUnifHint.add_user_provided_hint t n;
- status,[]
+ status,`Old []
;;
let add_coercions_of_lemmas lemmas status =
let status = GrafiteSync.prefer_coercion status uri in
let moo_content = GrafiteAst.PreferCoercion (HExtlib.dummy_floc,c) in
let status = GrafiteTypes.add_moo_content [moo_content] status in
- status, []
+ status, `Old []
module MatitaStatus =
struct
prerr_endline msg;
*)
let status = GrafiteTypes.add_moo_content [cmd] status in
- status,[]
+ status,`Old []
| GrafiteAst.Select (_,uri) as cmd ->
- if List.mem cmd status.GrafiteTypes.moo_content_rev then status, []
+ if List.mem cmd status.GrafiteTypes.moo_content_rev then status, `Old []
else
let cache =
AutomationCache.add_term_to_active status.GrafiteTypes.automation_cache
in
let status = { status with GrafiteTypes.automation_cache = cache } in
let status = GrafiteTypes.add_moo_content [cmd] status in
- status, []
+ status, `Old []
| GrafiteAst.Pump (_,steps) ->
let cache =
AutomationCache.pump status.GrafiteTypes.automation_cache steps
in
let status = { status with GrafiteTypes.automation_cache = cache } in
- status, []
+ status, `Old []
| GrafiteAst.PreferCoercion (loc, coercion) ->
eval_prefer_coercion status coercion
| GrafiteAst.Coercion (loc, uri, add_composites, arity, saturations) ->
- eval_coercion status ~add_composites uri arity saturations
+ let res,uris =
+ eval_coercion status ~add_composites uri arity saturations
+ in
+ res,`Old uris
| GrafiteAst.Inverter (loc, name, indty, params) ->
let buri = GrafiteTypes.get_baseuri status in
let uri = UriManager.uri_of_string (buri ^ "/" ^ name ^ ".con") in
let indty_uri =
try CicUtil.uri_of_term indty
with Invalid_argument _ ->
- raise (Invalid_argument "not an inductive type to invert")
+ raise (Invalid_argument "not an inductive type to invert") in
+ let res,uris =
+ Inversion_principle.build_inverter ~add_obj status uri indty_uri params
in
- Inversion_principle.build_inverter ~add_obj status uri indty_uri params
+ res,`Old uris
| GrafiteAst.UnificationHint (loc, t, n) ->
eval_unification_hint status t n
| GrafiteAst.Default (loc, what, uris) as cmd ->
LibraryObjects.set_default what uris;
- GrafiteTypes.add_moo_content [cmd] status,[]
+ GrafiteTypes.add_moo_content [cmd] status,`Old []
| GrafiteAst.Drop loc -> raise Drop
| GrafiteAst.Include (loc, baseuri) ->
let moopath_rw, moopath_r =
in
prerr_endline msg;
*)
- status,[]
+ status,`Old []
| GrafiteAst.Print (_,"proofterm") ->
let _,_,_,p,_, _ = GrafiteTypes.get_current_proof status in
prerr_endline (Auto.pp_proofterm (Lazy.force p));
- status,[]
- | GrafiteAst.Print (_,_) -> status,[]
+ status,`Old []
+ | GrafiteAst.Print (_,_) -> status,`Old []
| GrafiteAst.Qed loc ->
let uri, metasenv, _subst, bo, ty, attrs =
match status.GrafiteTypes.proof_status with
{status with
GrafiteTypes.proof_status = GrafiteTypes.No_proof},
(*CSC: I throw away the arities *)
- uri::lemmas
+ `Old (uri::lemmas)
| GrafiteAst.NQed loc ->
(match status.GrafiteTypes.ng_status with
| GrafiteTypes.ProofMode
NCicLibrary.add_obj uri obj;
{status with
GrafiteTypes.ng_status =
- GrafiteTypes.CommandMode lexicon_status },[]
+ GrafiteTypes.CommandMode lexicon_status },`Old []
| _ -> raise (GrafiteTypes.Command_error "Not in proof mode"))
| GrafiteAst.Relation (loc, id, a, aeq, refl, sym, trans) ->
Setoids.add_relation id a aeq refl sym trans;
- status, [] (*CSC: TO BE FIXED *)
- | GrafiteAst.Set (loc, name, value) -> status, []
+ status, `Old [] (*CSC: TO BE FIXED *)
+ | GrafiteAst.Set (loc, name, value) -> status, `Old []
(* GrafiteTypes.set_option status name value,[] *)
| GrafiteAst.NObj (loc,obj) ->
let lexicon_status =
in
NCicLibrary.add_obj uri obj;
{status with
- GrafiteTypes.ng_status=GrafiteTypes.CommandMode lexicon_status },[]
+ GrafiteTypes.ng_status=GrafiteTypes.CommandMode lexicon_status },
+ `Old []
| _ ->
let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in
{ status with
GrafiteTypes.ProofMode
{ NTacStatus.gstatus = ninitial_stack;
istatus = { NTacStatus.pstatus = obj; lstatus = lexicon_status}}
- },[])
+ },`Old [])
| GrafiteAst.Obj (loc,obj) ->
let ext,name =
match obj with
GrafiteTypes.Incomplete_proof
{ GrafiteTypes.proof = initial_proof; stack = initial_stack } ;
},
- []
+ `Old []
| _ ->
if metasenv <> [] then
raise (GrafiteTypes.Command_error (
"metasenv not empty while giving a definition with body: " ^
CicMetaSubst.ppmetasenv [] metasenv));
let status, lemmas = add_obj uri obj status in
- let status,new_lemmas =
- add_coercions_of_lemmas lemmas status
- in
+ let status,new_lemmas = add_coercions_of_lemmas lemmas status in
{status with GrafiteTypes.proof_status = GrafiteTypes.No_proof},
- uri::new_lemmas@lemmas
+ `Old (uri::new_lemmas@lemmas)
in
match status.GrafiteTypes.proof_status with
GrafiteTypes.Intermediate _ ->
print_endline "GOOD"; ()
with ProofEngineTypes.Fail _ -> print_endline "BAD" | _ -> ());*)
eval_tactical status
- (punctuation_tactical_of_ast (text,prefix_len,punct)),[]
+ (punctuation_tactical_of_ast (text,prefix_len,punct)),`Old []
| GrafiteAst.Tactic (_, None, punct) ->
eval_tactical status
- (punctuation_tactical_of_ast (text,prefix_len,punct)),[]
+ (punctuation_tactical_of_ast (text,prefix_len,punct)),`Old []
| GrafiteAst.NTactic (_(*loc*), tac, punct) ->
(match status.GrafiteTypes.ng_status with
| GrafiteTypes.CommandMode _ -> assert false
let nstatus = eval_ng_tac (text,prefix_len,tac) nstatus in
let nstatus = eval_ng_punct (text,prefix_len,punct) nstatus in
NTacStatus.pp_tac_status nstatus;
- { status with GrafiteTypes.ng_status = GrafiteTypes.ProofMode nstatus }, [])
+ { status with GrafiteTypes.ng_status = GrafiteTypes.ProofMode nstatus }, `Old [])
| GrafiteAst.NonPunctuationTactical (_, tac, punct) ->
let status =
eval_tactical status
(non_punctuation_tactical_of_ast (text,prefix_len,tac))
in
eval_tactical status
- (punctuation_tactical_of_ast (text,prefix_len,punct)),[]
+ (punctuation_tactical_of_ast (text,prefix_len,punct)),`Old []
| GrafiteAst.Command (_, cmd) ->
eval_command.ec_go ~disambiguate_command opts status (text,prefix_len,cmd)
| GrafiteAst.Macro (loc, macro) ->
~disambiguate_macro:(fun _ _ -> assert false)
status ast
in
- assert (lemmas=[]);
+ assert (lemmas=`Old []);
status)
status moo
} and eval_ast = {ea_go = fun ~disambiguate_tactic ~disambiguate_command
| GrafiteAst.Comment (_,c) ->
eval_comment.ecm_go ~disambiguate_command opts status (text,prefix_len,c)
} and eval_comment = { ecm_go = fun ~disambiguate_command opts status (text,prefix_len,c) ->
- status, []
+ status, `Old []
}
;;