-content.cmi:
acic2content.cmi: content.cmi
content2cic.cmi: content.cmi
cicNotationUtil.cmi: cicNotationPt.cmo
cicNotationPp.cmi: cicNotationPt.cmo cicNotationEnv.cmi
acic2astMatcher.cmi: cicNotationPt.cmo
termAcicContent.cmi: cicNotationPt.cmo
-cicNotationPt.cmo:
-cicNotationPt.cmx:
content.cmo: content.cmi
content.cmx: content.cmi
acic2content.cmo: content.cmi acic2content.cmi
-content.cmi:
acic2content.cmi: content.cmi
content2cic.cmi: content.cmi
cicNotationUtil.cmi: cicNotationPt.cmx
cicNotationPp.cmi: cicNotationPt.cmx cicNotationEnv.cmi
acic2astMatcher.cmi: cicNotationPt.cmx
termAcicContent.cmi: cicNotationPt.cmx
-cicNotationPt.cmo:
-cicNotationPt.cmx:
content.cmo: content.cmi
content.cmx: content.cmi
acic2content.cmo: content.cmi acic2content.cmi
-proceduralHelpers.cmi:
-proceduralClassify.cmi:
-proceduralOptimizer.cmi:
-proceduralTypes.cmi:
-proceduralMode.cmi:
-proceduralConversion.cmi:
procedural1.cmi: proceduralTypes.cmi
procedural2.cmi: proceduralTypes.cmi
proceduralTeX.cmi: proceduralTypes.cmi
-acic2Procedural.cmi:
proceduralHelpers.cmo: proceduralHelpers.cmi
proceduralHelpers.cmx: proceduralHelpers.cmi
proceduralClassify.cmo: proceduralHelpers.cmi proceduralClassify.cmi
-proceduralHelpers.cmi:
-proceduralClassify.cmi:
-proceduralOptimizer.cmi:
-proceduralTypes.cmi:
-proceduralMode.cmi:
-proceduralConversion.cmi:
procedural1.cmi: proceduralTypes.cmi
procedural2.cmi: proceduralTypes.cmi
proceduralTeX.cmi: proceduralTypes.cmi
-acic2Procedural.cmi:
proceduralHelpers.cmo: proceduralHelpers.cmi
proceduralHelpers.cmx: proceduralHelpers.cmi
proceduralClassify.cmo: proceduralHelpers.cmi proceduralClassify.cmi
-extractor.cmo:
-extractor.cmx:
-extractor_manager.cmo:
-extractor_manager.cmx:
-extractor.cmo:
-extractor.cmx:
-extractor_manager.cmo:
-extractor_manager.cmx:
-table_creator.cmo:
-table_creator.cmx:
-table_creator.cmo:
-table_creator.cmx:
-cicUniv.cmi:
unshare.cmi: cic.cmo
deannotate.cmi: cic.cmo
cicParser.cmi: cic.cmo
cicUtil.cmi: cic.cmo
helmLibraryObjects.cmi: cic.cmo
-libraryObjects.cmi:
cic_indexable.cmi: cic.cmo
path_indexing.cmi: cic.cmo
cicInspect.cmi: cic.cmo
-cicUniv.cmi:
unshare.cmi: cic.cmx
deannotate.cmi: cic.cmx
cicParser.cmi: cic.cmx
cicUtil.cmi: cic.cmx
helmLibraryObjects.cmi: cic.cmx
-libraryObjects.cmi:
cic_indexable.cmi: cic.cmx
path_indexing.cmi: cic.cmx
cicInspect.cmi: cic.cmx
-eta_fixing.cmi:
-doubleTypeInference.cmi:
-cic2acic.cmi:
cic2Xml.cmi: cic2acic.cmi
eta_fixing.cmo: eta_fixing.cmi
eta_fixing.cmx: eta_fixing.cmi
-eta_fixing.cmi:
-doubleTypeInference.cmi:
-cic2acic.cmi:
cic2Xml.cmi: cic2acic.cmi
eta_fixing.cmo: eta_fixing.cmi
eta_fixing.cmx: eta_fixing.cmi
-cicDisambiguate.cmi:
-disambiguateChoices.cmi:
cicDisambiguate.cmo: cicDisambiguate.cmi
cicDisambiguate.cmx: cicDisambiguate.cmi
disambiguateChoices.cmo: disambiguateChoices.cmi
-cicDisambiguate.cmi:
-disambiguateChoices.cmi:
cicDisambiguate.cmo: cicDisambiguate.cmi
cicDisambiguate.cmx: cicDisambiguate.cmi
disambiguateChoices.cmo: disambiguateChoices.cmi
-cicExportation.cmi:
cicExportation.cmo: cicExportation.cmi
cicExportation.cmx: cicExportation.cmi
-cicExportation.cmi:
cicExportation.cmo: cicExportation.cmi
cicExportation.cmx: cicExportation.cmi
-cicLogger.cmi:
-cicEnvironment.cmi:
-cicPp.cmi:
-cicUnivUtils.cmi:
-cicSubstitution.cmi:
-cicMiniReduction.cmi:
-cicReduction.cmi:
-cicTypeChecker.cmi:
-freshNamesGenerator.cmi:
-cicDischarge.cmi:
cicLogger.cmo: cicLogger.cmi
cicLogger.cmx: cicLogger.cmi
cicEnvironment.cmo: cicEnvironment.cmi
-cicLogger.cmi:
-cicEnvironment.cmi:
-cicPp.cmi:
-cicUnivUtils.cmi:
-cicSubstitution.cmi:
-cicMiniReduction.cmi:
-cicReduction.cmi:
-cicTypeChecker.cmi:
-freshNamesGenerator.cmi:
-cicDischarge.cmi:
cicLogger.cmo: cicLogger.cmi
cicLogger.cmx: cicLogger.cmi
cicEnvironment.cmo: cicEnvironment.cmi
-cicMetaSubst.cmi:
-cicMkImplicit.cmi:
-termUtil.cmi:
-coercGraph.cmi:
-cicUnification.cmi:
-cicReplace.cmi:
-cicRefine.cmi:
cicMetaSubst.cmo: cicMetaSubst.cmi
cicMetaSubst.cmx: cicMetaSubst.cmi
cicMkImplicit.cmo: cicMkImplicit.cmi
-cicMetaSubst.cmi:
-cicMkImplicit.cmi:
-termUtil.cmi:
-coercGraph.cmi:
-cicUnification.cmi:
-cicReplace.cmi:
-cicRefine.cmi:
cicMetaSubst.cmo: cicMetaSubst.cmi
cicMetaSubst.cmx: cicMetaSubst.cmi
cicMkImplicit.cmo: cicMkImplicit.cmi
-renderingAttrs.cmi:
-cicNotationLexer.cmi:
-cicNotationParser.cmi:
-mpresentation.cmi:
-box.cmi:
-content2presMatcher.cmi:
termContentPres.cmi: cicNotationParser.cmi
boxPp.cmi: mpresentation.cmi cicNotationPres.cmi box.cmi
cicNotationPres.cmi: mpresentation.cmi box.cmi
-renderingAttrs.cmi:
-cicNotationLexer.cmi:
-cicNotationParser.cmi:
-mpresentation.cmi:
-box.cmi:
-content2presMatcher.cmi:
termContentPres.cmi: cicNotationParser.cmi
boxPp.cmi: mpresentation.cmi cicNotationPres.cmi box.cmi
cicNotationPres.cmi: mpresentation.cmi box.cmi
-disambiguateTypes.cmi:
disambiguate.cmi: disambiguateTypes.cmi
multiPassDisambiguator.cmi: disambiguateTypes.cmi disambiguate.cmi
disambiguateTypes.cmo: disambiguateTypes.cmi
-disambiguateTypes.cmi:
disambiguate.cmi: disambiguateTypes.cmi
multiPassDisambiguator.cmi: disambiguateTypes.cmi disambiguate.cmi
disambiguateTypes.cmo: disambiguateTypes.cmi
-componentsConf.cmi:
-hExtlib.cmi:
-hMarshal.cmi:
-patternMatcher.cmi:
-hLog.cmi:
-trie.cmi:
-discrimination_tree.cmi:
-hTopoSort.cmi:
-refCounter.cmi:
-graphvizPp.cmi:
componentsConf.cmo: componentsConf.cmi
componentsConf.cmx: componentsConf.cmi
hExtlib.cmo: hExtlib.cmi
-componentsConf.cmi:
-hExtlib.cmi:
-hMarshal.cmi:
-patternMatcher.cmi:
-hLog.cmi:
-trie.cmi:
-discrimination_tree.cmi:
-hTopoSort.cmi:
-refCounter.cmi:
-graphvizPp.cmi:
componentsConf.cmo: componentsConf.cmi
componentsConf.cmx: componentsConf.cmi
hExtlib.cmo: hExtlib.cmi
-http_getter_wget.cmi:
-http_getter_logger.cmi:
-http_getter_misc.cmi:
-http_getter_const.cmi:
http_getter_env.cmi: http_getter_types.cmo
-http_getter_storage.cmi:
http_getter_common.cmi: http_getter_types.cmo
http_getter.cmi: http_getter_types.cmo
-http_getter_types.cmo:
-http_getter_types.cmx:
http_getter_wget.cmo: http_getter_types.cmo http_getter_wget.cmi
http_getter_wget.cmx: http_getter_types.cmx http_getter_wget.cmi
http_getter_logger.cmo: http_getter_logger.cmi
-http_getter_wget.cmi:
-http_getter_logger.cmi:
-http_getter_misc.cmi:
-http_getter_const.cmi:
http_getter_env.cmi: http_getter_types.cmx
-http_getter_storage.cmi:
http_getter_common.cmi: http_getter_types.cmx
http_getter.cmi: http_getter_types.cmx
-http_getter_types.cmo:
-http_getter_types.cmx:
http_getter_wget.cmo: http_getter_types.cmx http_getter_wget.cmi
http_getter_wget.cmx: http_getter_types.cmx http_getter_wget.cmi
http_getter_logger.cmo: http_getter_logger.cmi
grafiteAstPp.cmi: grafiteAst.cmo
grafiteMarshal.cmi: grafiteAst.cmo
-grafiteAst.cmo:
-grafiteAst.cmx:
grafiteAstPp.cmo: grafiteAst.cmo grafiteAstPp.cmi
grafiteAstPp.cmx: grafiteAst.cmx grafiteAstPp.cmi
grafiteMarshal.cmo: grafiteAstPp.cmi grafiteAst.cmo grafiteMarshal.cmi
grafiteAstPp.cmi: grafiteAst.cmx
grafiteMarshal.cmi: grafiteAst.cmx
-grafiteAst.cmo:
-grafiteAst.cmx:
grafiteAstPp.cmo: grafiteAst.cmx grafiteAstPp.cmi
grafiteAstPp.cmx: grafiteAst.cmx grafiteAstPp.cmi
grafiteMarshal.cmo: grafiteAstPp.cmi grafiteAst.cmx grafiteMarshal.cmi
type ncommand =
| UnificationHint of loc * CicNotationPt.term * int (* term, precedence *)
| NObj of loc * CicNotationPt.term CicNotationPt.obj
- | NInverter of loc * string * CicNotationPt.term
+ | NInverter of loc * string * CicNotationPt.term * bool list option * CicNotationPt.term option
| NUnivConstraint of loc * NUri.uri * NUri.uri
| NCopy of loc * string * NUri.uri * (NUri.uri * NUri.uri) list
| NCoercion of loc * string *
let pp_ncommand = function
| UnificationHint (_,t, n) ->
"unification hint " ^ string_of_int n ^ " " ^ CicNotationPp.pp_term t
- | NInverter (_,_,_)
+ | NInverter (_,_,_,_,_)
| NObj (_,_)
| NUnivConstraint (_) -> "not supported"
| NCoercion (_) -> "not supported"
-grafiteTypes.cmi:
grafiteSync.cmi: grafiteTypes.cmi
nCicCoercDeclaration.cmi: grafiteTypes.cmi
grafiteEngine.cmi: grafiteTypes.cmi
-grafiteTypes.cmi:
grafiteSync.cmi: grafiteTypes.cmi
nCicCoercDeclaration.cmi: grafiteTypes.cmi
grafiteEngine.cmi: grafiteTypes.cmi
[] ->
eval_ncommand opts status ("",0,GrafiteAst.NQed Stdpp.dummy_loc)
| _ -> status,`New [])
- | GrafiteAst.NInverter (loc, name, indty) ->
+ | GrafiteAst.NInverter (loc, name, indty, selection, sort) ->
if status#ng_mode <> `CommandMode then
raise (GrafiteTypes.Command_error "Not in command mode")
else
+ let metasenv,subst,status,sort = match sort with
+ | None -> [],[],status,NCic.Sort NCic.Prop
+ | Some s -> GrafiteDisambiguate.disambiguate_nterm None status [] [] []
+ (text,prefix_len,s)
+ in
+ assert (metasenv = []);
+ let sort = NCicReduction.whd ~subst [] sort in
+ let sort = match sort with
+ NCic.Sort s -> s
+ | _ -> raise (Invalid_argument (Printf.sprintf "ninverter: found target %s, which is not a sort"
+ (NCicPp.ppterm ~metasenv ~subst ~context:[] sort)))
+ in
let status = status#set_ng_mode `ProofMode in
let metasenv,subst,status,indty =
- GrafiteDisambiguate.disambiguate_nterm None status [] [] [] (text,prefix_len,indty) in
- let _,leftno,tys,_,_ = match indty with
- NCic.Const r -> NCicEnvironment.get_checked_indtys r
- | _ -> assert false in
- let it = match tys with
- hd::tl -> hd
- | _ -> assert false
- in
- let status,obj =
- NInversion.mk_inverter name it leftno status status#baseuri in
+ GrafiteDisambiguate.disambiguate_nterm None status [] [] subst (text,prefix_len,indty) in
+ let indtyno,(_,leftno,tys,_,_) = match indty with
+ NCic.Const ((NReference.Ref (_,NReference.Ind (_,indtyno,_))) as r) ->
+ indtyno, NCicEnvironment.get_checked_indtys r
+ | _ -> prerr_endline ("engine: indty =" ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] indty) ; assert false in
+ let it = List.nth tys indtyno in
+ let status,obj = NInversion.mk_inverter name it leftno ?selection sort
+ status status#baseuri in
let _,_,menv,_,_ = obj in
(match menv with
[] ->
-dependenciesParser.cmi:
-grafiteParser.cmi:
-cicNotation2.cmi:
-nEstatus.cmi:
grafiteDisambiguate.cmi: nEstatus.cmi
-print_grammar.cmi:
dependenciesParser.cmo: dependenciesParser.cmi
dependenciesParser.cmx: dependenciesParser.cmi
grafiteParser.cmo: grafiteParser.cmi
-dependenciesParser.cmi:
-grafiteParser.cmi:
-cicNotation2.cmi:
-nEstatus.cmi:
grafiteDisambiguate.cmi: nEstatus.cmi
-print_grammar.cmi:
dependenciesParser.cmo: dependenciesParser.cmi
dependenciesParser.cmx: dependenciesParser.cmi
grafiteParser.cmo: grafiteParser.cmi
G.NObj (loc, N.Theorem (nflavour, name, N.Implicit `JustOne, Some body))
| IDENT "naxiom"; name = IDENT; SYMBOL ":"; typ = term ->
G.NObj (loc, N.Theorem (`Axiom, name, typ, None))
- | IDENT "ninverter"; name = IDENT; IDENT "for" ; indty = term ->
- G.NInverter (loc,name,indty)
+ | IDENT "ninverter"; name = IDENT; IDENT "for" ; indty = tactic_term ;
+ paramspec = OPT inverter_param_list ;
+ outsort = OPT [ SYMBOL ":" ; outsort = term -> outsort ] ->
+ G.NInverter (loc,name,indty,paramspec,outsort)
| NLETCOREC ; defs = let_defs ->
nmk_rec_corec `CoInductive defs loc
| NLETREC ; defs = let_defs ->
-domMisc.cmi:
-xml2Gdome.cmi:
domMisc.cmo: domMisc.cmi
domMisc.cmx: domMisc.cmi
xml2Gdome.cmo: xml2Gdome.cmi
-domMisc.cmi:
-xml2Gdome.cmi:
domMisc.cmo: domMisc.cmi
domMisc.cmx: domMisc.cmi
xml2Gdome.cmo: xml2Gdome.cmi
-hSql.cmi:
-hSqlite3.cmo:
-hSqlite3.cmx:
-hMysql.cmo:
-hMysql.cmx:
hSql.cmo: hSqlite3.cmo hMysql.cmo hSql.cmi
hSql.cmx: hSqlite3.cmx hMysql.cmx hSql.cmi
-hSql.cmi:
-hSqlite3.cmo:
-hSqlite3.cmx:
-hMysql.cmo:
-hMysql.cmx:
hSql.cmo: hSqlite3.cmx hMysql.cmx hSql.cmi
hSql.cmx: hSqlite3.cmx hMysql.cmx hSql.cmi
cicNotation.cmi: lexiconAst.cmo
lexiconEngine.cmi: lexiconMarshal.cmi lexiconAst.cmo cicNotation.cmi
lexiconSync.cmi: lexiconEngine.cmi lexiconAst.cmo
-lexiconAst.cmo:
-lexiconAst.cmx:
lexiconAstPp.cmo: lexiconAst.cmo lexiconAstPp.cmi
lexiconAstPp.cmx: lexiconAst.cmx lexiconAstPp.cmi
lexiconMarshal.cmo: lexiconAstPp.cmi lexiconAst.cmo lexiconMarshal.cmi
cicNotation.cmi: lexiconAst.cmx
lexiconEngine.cmi: lexiconMarshal.cmi lexiconAst.cmx cicNotation.cmi
lexiconSync.cmi: lexiconEngine.cmi lexiconAst.cmx
-lexiconAst.cmo:
-lexiconAst.cmx:
lexiconAstPp.cmo: lexiconAst.cmx lexiconAstPp.cmi
lexiconAstPp.cmx: lexiconAst.cmx lexiconAstPp.cmi
lexiconMarshal.cmo: lexiconAstPp.cmi lexiconAst.cmx lexiconMarshal.cmi
-librarian.cmi:
-libraryMisc.cmi:
-libraryDb.cmi:
-coercDb.cmi:
cicCoercion.cmi: coercDb.cmi
-librarySync.cmi:
-cicElim.cmi:
-cicRecord.cmi:
-cicFix.cmi:
-libraryClean.cmi:
librarian.cmo: librarian.cmi
librarian.cmx: librarian.cmi
libraryMisc.cmo: libraryMisc.cmi
-librarian.cmi:
-libraryMisc.cmi:
-libraryDb.cmi:
-coercDb.cmi:
cicCoercion.cmi: coercDb.cmi
-librarySync.cmi:
-cicElim.cmi:
-cicRecord.cmi:
-cicFix.cmi:
-libraryClean.cmi:
librarian.cmo: librarian.cmi
librarian.cmx: librarian.cmi
libraryMisc.cmo: libraryMisc.cmi
-helmLogger.cmi:
helmLogger.cmo: helmLogger.cmi
helmLogger.cmx: helmLogger.cmi
-helmLogger.cmi:
helmLogger.cmo: helmLogger.cmi
helmLogger.cmx: helmLogger.cmi
-sqlStatements.cmi:
-metadataTypes.cmi:
metadataExtractor.cmi: metadataTypes.cmi
metadataPp.cmi: metadataTypes.cmi
metadataConstraints.cmi: metadataTypes.cmi
-sqlStatements.cmi:
-metadataTypes.cmi:
metadataExtractor.cmi: metadataTypes.cmi
metadataPp.cmi: metadataTypes.cmi
metadataConstraints.cmi: metadataTypes.cmi
-ncic2astMatcher.cmi:
-nTermCicContent.cmi:
ncic2astMatcher.cmo: ncic2astMatcher.cmi
ncic2astMatcher.cmx: ncic2astMatcher.cmi
nTermCicContent.cmo: ncic2astMatcher.cmi nTermCicContent.cmi
-ncic2astMatcher.cmi:
-nTermCicContent.cmi:
ncic2astMatcher.cmo: ncic2astMatcher.cmi
ncic2astMatcher.cmx: ncic2astMatcher.cmi
nTermCicContent.cmo: ncic2astMatcher.cmi nTermCicContent.cmi
-nCicDisambiguate.cmi:
nCicDisambiguate.cmo: nCicDisambiguate.cmi
nCicDisambiguate.cmx: nCicDisambiguate.cmi
-nCicDisambiguate.cmi:
nCicDisambiguate.cmo: nCicDisambiguate.cmi
nCicDisambiguate.cmx: nCicDisambiguate.cmi
-nUri.cmi:
nReference.cmi: nUri.cmi
nCicUtils.cmi: nCic.cmo
nCicSubstitution.cmi: nCic.cmo
-nUri.cmi:
nReference.cmi: nUri.cmi
nCicUtils.cmi: nCic.cmx
nCicSubstitution.cmi: nCic.cmx
-terms.cmi:
pp.cmi: terms.cmi
foSubst.cmi: terms.cmi
orderings.cmi: terms.cmi
nCicBlob.cmi: terms.cmi
cicBlob.cmi: terms.cmi
nCicProof.cmi: terms.cmi
-nCicParamod.cmi:
terms.cmo: terms.cmi
terms.cmx: terms.cmi
pp.cmo: terms.cmi pp.cmi
-terms.cmi:
pp.cmi: terms.cmi
foSubst.cmi: terms.cmi
orderings.cmi: terms.cmi
nCicBlob.cmi: terms.cmi
cicBlob.cmi: terms.cmi
nCicProof.cmi: terms.cmi
-nCicParamod.cmi:
terms.cmo: terms.cmi
terms.cmx: terms.cmi
pp.cmo: terms.cmi pp.cmi
-nDiscriminationTree.cmi:
-nCicMetaSubst.cmi:
-nCicUnifHint.cmi:
nCicCoercion.cmi: nCicUnifHint.cmi
nRstatus.cmi: nCicCoercion.cmi
nCicUnification.cmi: nRstatus.cmi
-nDiscriminationTree.cmi:
-nCicMetaSubst.cmi:
-nCicUnifHint.cmi:
nCicCoercion.cmi: nCicUnifHint.cmi
nRstatus.cmi: nCicCoercion.cmi
nCicUnification.cmi: nRstatus.cmi
-nCicTacReduction.cmi:
-nTacStatus.cmi:
-nCicElim.cmi:
nTactics.cmi: nTacStatus.cmi
nInversion.cmi: nTacStatus.cmi
nCicTacReduction.cmo: nCicTacReduction.cmi
nCicElim.cmx: nCicElim.cmi
nTactics.cmo: nTacStatus.cmi nCicElim.cmi nTactics.cmi
nTactics.cmx: nTacStatus.cmx nCicElim.cmx nTactics.cmi
-nInversion.cmo: nTactics.cmi nInversion.cmi
-nInversion.cmx: nTactics.cmx nInversion.cmi
+nInversion.cmo: nTactics.cmi nCicElim.cmi nInversion.cmi
+nInversion.cmx: nTactics.cmx nCicElim.cmx nInversion.cmi
-nCicTacReduction.cmi:
-nTacStatus.cmi:
-nCicElim.cmi:
nTactics.cmi: nTacStatus.cmi
nInversion.cmi: nTacStatus.cmi
nCicTacReduction.cmo: nCicTacReduction.cmi
nCicElim.cmx: nCicElim.cmi
nTactics.cmo: nTacStatus.cmi nCicElim.cmi nTactics.cmi
nTactics.cmx: nTacStatus.cmx nCicElim.cmx nTactics.cmi
-nInversion.cmo: nTactics.cmi nInversion.cmi
-nInversion.cmx: nTactics.cmx nInversion.cmi
+nInversion.cmo: nTactics.cmi nCicElim.cmi nInversion.cmi
+nInversion.cmx: nTactics.cmx nCicElim.cmx nInversion.cmi
| hd::tl -> CicNotationPt.Binder (`Lambda, (mk_id hd, None), mk_lambdas tl t)
;;
-let rec mk_arrows l t =
- match l with
- [] -> t
- | hd::tl -> CicNotationPt.Binder (`Forall, (mk_id "_", Some hd), mk_arrows tl t)
+let rec mk_arrows xs ys selection target =
+ match selection,xs,ys with
+ [],[],[] -> target
+ | false :: l,x::xs,y::ys -> mk_arrows xs ys l target
+ | true :: l,x::xs,y::ys ->
+ CicNotationPt.Binder (`Forall, (mk_id "_", Some (mk_appl [mk_id "eq" ; CicNotationPt.Implicit `JustOne;x;y])),
+ mk_arrows xs ys l target)
+ | _ -> raise (Invalid_argument "ninverter: the selection doesn't match the arity of the specified inductive type")
;;
let subst_metasenv_and_fix_names status =
status#set_obj(u,h,NCicUntrusted.apply_subst_metasenv subst metasenv,subst,o)
;;
-let mk_inverter name it leftno status baseuri =
+let mk_inverter name it leftno ?selection outsort status baseuri =
prerr_endline ("leftno = " ^ string_of_int leftno);
let _,ind_name,ty,cl = it in
prerr_endline ("arity: " ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] ty);
(*let params,ty = NCicReduction.split_prods ~subst:[] [] leftno ty in
let params = List.rev_map (function name,_ -> mk_id name) params in
prerr_endline ("lunghezza params = " ^ string_of_int (List.length params));*)
- let args,sort = split_arity ~subst:[] [] ty in
+ let args,sort= split_arity ~subst:[] [] ty in
prerr_endline ("arity sort: " ^ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:args sort);
(*let args = List.rev_map (function name,_ -> mk_id name) args in
prerr_endline ("lunghezza args = " ^ string_of_int (List.length args));*)
let nparams = List.length args in
prerr_endline ("nparams = " ^ string_of_int nparams);
-
+
let xs = List.map (fun n -> "x" ^ (string_of_int n)) (HExtlib.list_seq 1 (nparams+1)) in
prerr_endline ("lunghezza xs = " ^ string_of_int (List.length xs));
let ls, rs = HExtlib.split_nth leftno xs in
(* pred := P yr- *)
let pred = mk_appl ((mk_id "P")::id_ys) in
- let selection = HExtlib.mk_list true (List.length ys) in
- let prods =
- let rec prodaux = function
- [],[],[] -> pred
- | false :: l,x::xs,y::ys -> prodaux (l,xs,ys)
- | true :: l,x::xs,y::ys ->
- CicNotationPt.Binder (`Forall, (mk_id "_", Some (mk_appl [mk_id "eq" ; CicNotationPt.Implicit `JustOne;x;y])),
- prodaux (l,xs,ys))
- | _ -> assert false
- in prodaux (selection,id_rs,id_ys)
+ let selection = match selection with
+ None -> HExtlib.mk_list true (List.length ys)
+ | Some s -> s
in
+ let prods = mk_arrows id_rs id_ys selection pred in
let lambdas = mk_lambdas (ys@["p"]) prods in
in (hypaux 1 ncons)
in
prerr_endline ("lunghezza ys = " ^ string_of_int (List.length ys));
+
+ let outsort, suffix = NCicElim.ast_of_sort outsort in
let theorem = mk_prods xs
- (CicNotationPt.Binder (`Forall, (mk_id "P", Some (mk_prods (HExtlib.mk_list "_" (List.length ys)) (CicNotationPt.Sort `Prop))),
+ (CicNotationPt.Binder (`Forall, (mk_id "P", Some (mk_prods (HExtlib.mk_list "_" (List.length ys)) (CicNotationPt.Sort outsort))),
mk_prods hyplist (CicNotationPt.Binder (`Forall, (mk_id "Hterm", (*Some (mk_appl (List.map mk_id (ind_name::xs)))) *)
Some (CicNotationPt.Implicit `JustOne)),
mk_appl (mk_id "P"::id_rs)))))
in
- let t = mk_appl ( [mk_id (ind_name ^ "_ind"); lambdas] @
+ let t = mk_appl ( [mk_id (ind_name ^ "_" ^ suffix); lambdas] @
List.map mk_id hyplist @
CicNotationPt.Implicit `Vector::[mk_id "Hterm"] ) in
- prerr_endline ("NINVERTER 0");
let status, theorem = GrafiteDisambiguate.disambiguate_nobj status ~baseuri
(baseuri ^ name ^ ".def",
0,CicNotationPt.Theorem (`Theorem,name,theorem,Some (CicNotationPt.Implicit (`Tagged "inv")))) in
- prerr_endline ("NINVERTER 1");
let uri,height,nmenv,nsubst,nobj = theorem in
let ninitial_stack = Continuationals.Stack.of_nmetasenv nmenv in
let status = status#set_obj theorem in
let status = subst_metasenv_and_fix_names status in
let cut_theorem =
- mk_arrows (List.map
- (fun x -> let x = mk_id x in mk_appl [mk_id "eq";
- CicNotationPt.Implicit `JustOne;
- x;x]) rs) (mk_appl (mk_id "P"::List.map mk_id rs)) in
+ let rs = List.map (fun x -> mk_id x) rs in
+ mk_arrows rs rs selection (mk_appl (mk_id "P"::rs)) in
+
let cut = mk_appl [CicNotationPt.Binder (`Lambda, (mk_id "Hcut", Some cut_theorem),
CicNotationPt.Implicit (`Tagged "end"));
CicNotationPt.Implicit (`Tagged "cut")] in
let intros = List.map (fun x -> NTactics.intro_tac x) (xs@["P"]@hyplist@["Hterm"]) in
- (*let branches =
- let rec branch_aux k = function
- 0 -> [NTactics.apply_tac ("",0,mk_id "H")]
- | n -> NTactics.apply_tac ("",0,mk_id ("H"^(string_of_int k)))::(branch_aux (k+1) (n-1))
- in branch_aux 1 ncons
- in*)
let status = NTactics.block_tac
(NTactics.branch_tac::
[NTactics.apply_tac ("",0,cut);
NTactics.branch_tac;
NTactics.case_tac "end";
- (*NTactics.intro_tac "Hcut";*)
NTactics.apply_tac ("",0,mk_id "Hcut");
NTactics.apply_tac ("",0,mk_id "refl_eq");
NTactics.shift_tac;
NTactics.case_tac "cut";
NTactics.apply_tac ("",0,t);
- (* NTactics.branch_tac]
- @ branches @
- [NTactics.merge_tac; *)
NTactics.merge_tac;
NTactics.merge_tac;
NTactics.skip_tac])) status in
status,status#obj
;;
-
-
-let ast_of_sort s =
- match s with
- NCic.Prop -> `Prop,"ind"
- | NCic.Type u ->
- let u = NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] (NCic.Sort s) in
- (try
- if String.sub u 0 4 = "Type" then
- `NType (String.sub u 4 (String.length u - 4)), "rect_" ^ u
- else if String.sub u 0 5 = "CProp" then
- `NCProp (String.sub u 5 (String.length u - 5)), "rect_" ^ u
- else
- (prerr_endline u;
- assert false)
- with Failure _ -> assert false)
-;;
(* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *)
-val mk_inverter: string -> NCic.inductiveType -> int -> (#NTacStatus.tac_status as 's) -> string -> 's * NCic.obj
-
+val mk_inverter: string -> NCic.inductiveType -> int -> ?selection:bool list ->
+ NCic.sort -> (#NTacStatus.tac_status as 's) -> string ->
+ 's * NCic.obj
-helm_registry.cmi:
helm_registry.cmo: helm_registry.cmi
helm_registry.cmx: helm_registry.cmi
-helm_registry.cmi:
helm_registry.cmo: helm_registry.cmi
helm_registry.cmx: helm_registry.cmi
-utf8Macro.cmi:
-utf8MacroTable.cmo:
-utf8MacroTable.cmx:
utf8Macro.cmo: utf8MacroTable.cmo utf8Macro.cmi
utf8Macro.cmx: utf8MacroTable.cmx utf8Macro.cmi
-utf8Macro.cmi:
-utf8MacroTable.cmo:
-utf8MacroTable.cmx:
utf8Macro.cmo: utf8MacroTable.cmx utf8Macro.cmi
utf8Macro.cmx: utf8MacroTable.cmx utf8Macro.cmi
-proofEngineTypes.cmi:
proofEngineHelpers.cmi: proofEngineTypes.cmi
-proofEngineReduction.cmi:
continuationals.cmi: proofEngineTypes.cmi
tacticals.cmi: proofEngineTypes.cmi
reductionTactics.cmi: proofEngineTypes.cmi
proofEngineStructuralRules.cmi: proofEngineTypes.cmi
primitiveTactics.cmi: proofEngineTypes.cmi
-hashtbl_equiv.cmi:
metadataQuery.cmi: proofEngineTypes.cmi
-universe.cmi:
autoTypes.cmi: proofEngineTypes.cmi
-autoCache.cmi:
-paramodulation/utils.cmi:
-closeCoercionGraph.cmi:
-paramodulation/subst.cmi:
paramodulation/equality.cmi: paramodulation/utils.cmi \
paramodulation/subst.cmi
paramodulation/founif.cmi: paramodulation/subst.cmi
auto.cmi: proofEngineTypes.cmi automationCache.cmi
destructTactic.cmi: proofEngineTypes.cmi
inversion.cmi: proofEngineTypes.cmi
-inversion_principle.cmi:
ring.cmi: proofEngineTypes.cmi
setoids.cmi: proofEngineTypes.cmi
-fourier.cmi:
fourierR.cmi: proofEngineTypes.cmi
fwdSimplTactic.cmi: proofEngineTypes.cmi
-history.cmi:
statefulProofEngine.cmi: proofEngineTypes.cmi
tactics.cmi: tacticals.cmi proofEngineTypes.cmi automationCache.cmi auto.cmi
declarative.cmi: proofEngineTypes.cmi automationCache.cmi auto.cmi
-proofEngineTypes.cmi:
proofEngineHelpers.cmi: proofEngineTypes.cmi
-proofEngineReduction.cmi:
continuationals.cmi: proofEngineTypes.cmi
tacticals.cmi: proofEngineTypes.cmi
reductionTactics.cmi: proofEngineTypes.cmi
proofEngineStructuralRules.cmi: proofEngineTypes.cmi
primitiveTactics.cmi: proofEngineTypes.cmi
-hashtbl_equiv.cmi:
metadataQuery.cmi: proofEngineTypes.cmi
-universe.cmi:
autoTypes.cmi: proofEngineTypes.cmi
-autoCache.cmi:
-paramodulation/utils.cmi:
-closeCoercionGraph.cmi:
-paramodulation/subst.cmi:
paramodulation/equality.cmi: paramodulation/utils.cmi \
paramodulation/subst.cmi
paramodulation/founif.cmi: paramodulation/subst.cmi
auto.cmi: proofEngineTypes.cmi automationCache.cmi
destructTactic.cmi: proofEngineTypes.cmi
inversion.cmi: proofEngineTypes.cmi
-inversion_principle.cmi:
ring.cmi: proofEngineTypes.cmi
setoids.cmi: proofEngineTypes.cmi
-fourier.cmi:
fourierR.cmi: proofEngineTypes.cmi
fwdSimplTactic.cmi: proofEngineTypes.cmi
-history.cmi:
statefulProofEngine.cmi: proofEngineTypes.cmi
tactics.cmi: tacticals.cmi proofEngineTypes.cmi automationCache.cmi auto.cmi
declarative.cmi: proofEngineTypes.cmi automationCache.cmi auto.cmi
-threadSafe.cmi:
-extThread.cmi:
threadSafe.cmo: threadSafe.cmi
threadSafe.cmx: threadSafe.cmi
extThread.cmo: extThread.cmi
-threadSafe.cmi:
-extThread.cmi:
threadSafe.cmo: threadSafe.cmi
threadSafe.cmx: threadSafe.cmi
extThread.cmo: extThread.cmi
parser.cmi: ast.cmo
-tptp2grafite.cmi:
-ast.cmo:
-ast.cmx:
lexer.cmo: parser.cmi
lexer.cmx: parser.cmx
parser.cmo: ast.cmo parser.cmi
parser.cmi: ast.cmx
-tptp2grafite.cmi:
-ast.cmo:
-ast.cmx:
lexer.cmo: parser.cmi
lexer.cmx: parser.cmx
parser.cmo: ast.cmx parser.cmi
-uriManager.cmi:
uriManager.cmo: uriManager.cmi
uriManager.cmx: uriManager.cmi
-uriManager.cmi:
uriManager.cmo: uriManager.cmi
uriManager.cmx: uriManager.cmi
-whelp.cmi:
-fwdQueries.cmi:
whelp.cmo: whelp.cmi
whelp.cmx: whelp.cmi
fwdQueries.cmo: fwdQueries.cmi
-whelp.cmi:
-fwdQueries.cmi:
whelp.cmo: whelp.cmi
whelp.cmx: whelp.cmi
fwdQueries.cmo: fwdQueries.cmi
-xml.cmi:
-xmlPushParser.cmi:
xml.cmo: xml.cmi
xml.cmx: xml.cmi
xmlPushParser.cmo: xmlPushParser.cmi
-xml.cmi:
-xmlPushParser.cmi:
xml.cmo: xml.cmi
xml.cmx: xml.cmi
xmlPushParser.cmo: xmlPushParser.cmi
-xmlDiff.cmi:
xmlDiff.cmo: xmlDiff.cmi
xmlDiff.cmx: xmlDiff.cmi
-xmlDiff.cmi:
xmlDiff.cmo: xmlDiff.cmi
xmlDiff.cmx: xmlDiff.cmi