]> matita.cs.unibo.it Git - helm.git/commitdiff
Inverters/Inversion:
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Tue, 6 Oct 2009 14:08:58 +0000 (14:08 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Tue, 6 Oct 2009 14:08:58 +0000 (14:08 +0000)
- fixed a bug with left parameters and inversion principles
- hooked automatic definition of inversion principles to the declaration of
  inductive types

42 files changed:
helm/software/components/acic_content/.depend
helm/software/components/acic_procedural/.depend
helm/software/components/binaries/extractor/.depend
helm/software/components/binaries/table_creator/.depend
helm/software/components/binaries/transcript/.depend
helm/software/components/cic/.depend
helm/software/components/cic_acic/.depend
helm/software/components/cic_disambiguation/.depend
helm/software/components/cic_exportation/.depend
helm/software/components/cic_proof_checking/.depend
helm/software/components/cic_unification/.depend
helm/software/components/content_pres/.depend
helm/software/components/disambiguation/.depend
helm/software/components/extlib/.depend
helm/software/components/getter/.depend
helm/software/components/grafite/.depend
helm/software/components/grafite_engine/.depend
helm/software/components/grafite_engine/grafiteEngine.ml
helm/software/components/grafite_parser/.depend
helm/software/components/hgdome/.depend
helm/software/components/hmysql/.depend
helm/software/components/lexicon/.depend
helm/software/components/library/.depend
helm/software/components/logger/.depend
helm/software/components/metadata/.depend
helm/software/components/ng_cic_content/.depend
helm/software/components/ng_disambiguation/.depend
helm/software/components/ng_kernel/.depend
helm/software/components/ng_library/.depend
helm/software/components/ng_paramodulation/.depend
helm/software/components/ng_refiner/.depend
helm/software/components/ng_tactics/.depend
helm/software/components/ng_tactics/nInversion.ml
helm/software/components/registry/.depend
helm/software/components/syntax_extensions/.depend
helm/software/components/tactics/.depend
helm/software/components/thread/.depend
helm/software/components/tptp_grafite/.depend
helm/software/components/urimanager/.depend
helm/software/components/whelp/.depend
helm/software/components/xml/.depend
helm/software/components/xmldiff/.depend

index 89dca0e446d48d1f05a1cda5fc3c39f1095257e3..8ade458af771b340426f4e4606d92e511c459a56 100644 (file)
@@ -1,4 +1,3 @@
-content.cmi: 
 acic2content.cmi: content.cmi 
 content2cic.cmi: content.cmi 
 cicNotationUtil.cmi: cicNotationPt.cmo 
@@ -6,8 +5,6 @@ cicNotationEnv.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 
index 97238c4d861fc8ee80cbafc6c9c6337d3e3babf2..8d0128744c8b9e740462a1a8001764036199a67e 100644 (file)
@@ -1,13 +1,6 @@
-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 
index 0c39328ae147e8ab714b2d3a7b1582a011b2b1d6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,4 +0,0 @@
-extractor.cmo: 
-extractor.cmx: 
-extractor_manager.cmo: 
-extractor_manager.cmx: 
index 33147b94948d28fc9c7132773964d2547472c2ba..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,2 +0,0 @@
-table_creator.cmo: 
-table_creator.cmx: 
index 87d1ed25c2745435771cee189c10da4a99854448..bb6f22a64b02f88c3881f2c3f490d7f81b186897 100644 (file)
@@ -1,11 +1,6 @@
 gallina8Parser.cmi: types.cmo 
 grafiteParser.cmi: types.cmo 
 grafite.cmi: types.cmo 
-engine.cmi: 
-types.cmo: 
-types.cmx: 
-options.cmo: 
-options.cmx: 
 gallina8Parser.cmo: types.cmo options.cmo gallina8Parser.cmi 
 gallina8Parser.cmx: types.cmx options.cmx gallina8Parser.cmi 
 gallina8Lexer.cmo: options.cmo gallina8Parser.cmi 
index a835b247f3b3006e53a73a62b9ff56d394eca590..c2c7105c727f1c8101a1a119d3521629984d3dcf 100644 (file)
@@ -1,10 +1,8 @@
-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 
index 5449d50aaa2d43c1a8126f0561177e904f0975da..3fc1e0dce9eedda1f0bb74a669ad175582f03e06 100644 (file)
@@ -1,6 +1,3 @@
-eta_fixing.cmi: 
-doubleTypeInference.cmi: 
-cic2acic.cmi: 
 cic2Xml.cmi: cic2acic.cmi 
 eta_fixing.cmo: eta_fixing.cmi 
 eta_fixing.cmx: eta_fixing.cmi 
index a9ae65a5e3c4c3df2f8aaca3b2762c794bee6bd5..e9bd1168f73e4e834b02480bca0e67e381fc4997 100644 (file)
@@ -1,5 +1,3 @@
-cicDisambiguate.cmi: 
-disambiguateChoices.cmi: 
 cicDisambiguate.cmo: cicDisambiguate.cmi 
 cicDisambiguate.cmx: cicDisambiguate.cmi 
 disambiguateChoices.cmo: disambiguateChoices.cmi 
index 91be8d88d36bf6f3df5cd920db6a75f80a5ff64d..288ea5f6cf50f1cb6bb8ff00d53a0262825c3459 100644 (file)
@@ -1,3 +1,2 @@
-cicExportation.cmi: 
 cicExportation.cmo: cicExportation.cmi 
 cicExportation.cmx: cicExportation.cmi 
index f8a16629ebd091a0c9e60b948c7e2eedb8908a16..5d83fd0f3d146e2d80ead2d8eb5c34b162a5835f 100644 (file)
@@ -1,13 +1,3 @@
-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 
index 2e054f73d4e69376cc89138609538274bd8fe6d8..a7b23ceb4e8ba6ae3fdc2fa8352ce69acbde78b0 100644 (file)
@@ -1,10 +1,3 @@
-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 
index 8d74439eb72834455b6f06006f1f5534312a3a51..6dd0e78a19212937b664b03fb796d8aaf496dbbb 100644 (file)
@@ -1,9 +1,3 @@
-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 
index 9fdbeeeafa878cfe32dbf1f96adaad1e3044a4eb..aba9ffea7f8db60089a7cf1831da09dcf9d0c67d 100644 (file)
@@ -1,4 +1,3 @@
-disambiguateTypes.cmi: 
 disambiguate.cmi: disambiguateTypes.cmi 
 multiPassDisambiguator.cmi: disambiguateTypes.cmi disambiguate.cmi 
 disambiguateTypes.cmo: disambiguateTypes.cmi 
index dcc6377a0664b620f19f47d8103c5b3a88a03270..201cd0cba99efc82def4f425a72ba0e952c1a5ea 100644 (file)
@@ -1,13 +1,3 @@
-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 
index ca64d8ec04f2c9e9b431d4921064c88bbb7587c9..20f69cf0c810c91e600fa5263c93c1b0ce86f3cb 100644 (file)
@@ -1,13 +1,6 @@
-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 
index f305b15803a9f6b7f87ab353a1e871afb8f6a1a5..dc225e2212dc37bb6eb22aa150fddf713965a312 100644 (file)
@@ -1,7 +1,5 @@
 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 
index 10236823af172c045fb709552131af884aaf6872..a545f14e33d0a91238cbcf0bd0a65c6eb18b1eae 100644 (file)
@@ -1,4 +1,3 @@
-grafiteTypes.cmi: 
 grafiteSync.cmi: grafiteTypes.cmi 
 nCicCoercDeclaration.cmi: grafiteTypes.cmi 
 grafiteEngine.cmi: grafiteTypes.cmi 
index 1b6878aba1414bb619b525c40a28155402ab6a7e..310f3793fe943458490b3f29016c0c548713e599 100644 (file)
@@ -826,7 +826,29 @@ let rec eval_ncommand opts status (text,prefix_len,cmd) =
                | NCicTypeChecker.TypeCheckerFailure _ ->
                   HLog.warn "error in generating projection/eliminator";
                   status,uris
-             ) (status,`New [] (* uris *)) boxml in
+             ) (status,`New [] (* uris *)) boxml in             
+           let _,_,_,_,nobj = obj in 
+           let status = match nobj with
+               NCic.Inductive (true,leftno,[it],_) ->
+                 let _,ind_name,ty,cl = it in
+                 List.fold_left 
+                   (fun status outsort ->
+                      let status = status#set_ng_mode `ProofMode in
+                      try
+                       (let status,invobj = NInversion.mk_inverter 
+                                      (ind_name ^ "_inv_" ^ (snd (NCicElim.ast_of_sort outsort))) 
+                                      it leftno outsort status status#baseuri in
+                       let _,_,menv,_,_ = invobj in
+                       fst (match menv with
+                             [] -> eval_ncommand opts status ("",0,GrafiteAst.NQed Stdpp.dummy_loc)
+                           | _ -> status,`New []))
+                      with _ -> HLog.warn "error in generating inversion principle"; 
+                                let status = status#set_ng_mode `CommandMode in status)
+                  status
+                  (NCic.Prop::
+                    List.map (fun s -> NCic.Type s) (NCicEnvironment.get_universes ()))
+              | _ -> status
+           in
            let coercions =
             match obj with
               _,_,_,_,NCic.Inductive
index 2766b04d03ad96eb26664ce893da8d732191ede5..97bf4d7c26591b45c8b7710b18ccc7b10bfce265 100644 (file)
@@ -1,9 +1,4 @@
-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 
index 072d9697ac67fab4c4d0dffd6321082b1022c444..bf9c09af77949af3443918acfe26309ababdde62 100644 (file)
@@ -1,5 +1,3 @@
-domMisc.cmi: 
-xml2Gdome.cmi: 
 domMisc.cmo: domMisc.cmi 
 domMisc.cmx: domMisc.cmi 
 xml2Gdome.cmo: xml2Gdome.cmi 
index ce439d961c5806d62c02572a1790a6b6591aad1a..16e6e9da7ff478b574edcc5f5756da5ac302ed34 100644 (file)
@@ -1,7 +1,2 @@
-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 
index 16c1145165e3acf1c2c923e16a634ce3f3967bef..847a4a807733e1ff71a24f44d6ff3ed18dd0252b 100644 (file)
@@ -3,8 +3,6 @@ lexiconMarshal.cmi: lexiconAst.cmo
 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 
index cfa1295edcd418319d423cb3ad3f4cc106a1ff21..a9f24f814f3dfb119e00e1fe2f6d71ef565d38ff 100644 (file)
@@ -1,13 +1,4 @@
-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 
index dfb4400ff0dce00c92943043edccecc0c1222ed5..28268d29ee15cd05d86a0565b7d47abfe8ecf81f 100644 (file)
@@ -1,3 +1,2 @@
-helmLogger.cmi: 
 helmLogger.cmo: helmLogger.cmi 
 helmLogger.cmx: helmLogger.cmi 
index 78cd97a0deff8787b73aed2878acef8374029ee0..492a34e3a9dad11aa9a08d4a09802647c6e0bf95 100644 (file)
@@ -1,5 +1,3 @@
-sqlStatements.cmi: 
-metadataTypes.cmi: 
 metadataExtractor.cmi: metadataTypes.cmi 
 metadataPp.cmi: metadataTypes.cmi 
 metadataConstraints.cmi: metadataTypes.cmi 
index 1316c8eab83e4c08ca7047ed72175492e98197a1..b4e17fa99bca931a5289d06541f5b69060d11594 100644 (file)
@@ -1,5 +1,3 @@
-ncic2astMatcher.cmi: 
-nTermCicContent.cmi: 
 ncic2astMatcher.cmo: ncic2astMatcher.cmi 
 ncic2astMatcher.cmx: ncic2astMatcher.cmi 
 nTermCicContent.cmo: ncic2astMatcher.cmi nTermCicContent.cmi 
index 2de54dc5eaedce21d8850cc5f76cc76f38331752..6b4ef95c1ee75472df6140057f1b06851033b996 100644 (file)
@@ -1,3 +1,2 @@
-nCicDisambiguate.cmi: 
 nCicDisambiguate.cmo: nCicDisambiguate.cmi 
 nCicDisambiguate.cmx: nCicDisambiguate.cmi 
index 365aaf26188695786deb73106de76b231a374f7a..fa6e420640000afcb42a2dccf0d31ad985b402dc 100644 (file)
@@ -1,4 +1,3 @@
-nUri.cmi: 
 nReference.cmi: nUri.cmi 
 nCicUtils.cmi: nCic.cmo 
 nCicSubstitution.cmi: nCic.cmo 
index 48127a32524c5ddf62190d9f5127650cbf289c7c..c76001c01994219bd09ad475a79d0e3b20568227 100644 (file)
@@ -1,3 +1,2 @@
-nCicLibrary.cmi: 
 nCicLibrary.cmo: nCicLibrary.cmi 
 nCicLibrary.cmx: nCicLibrary.cmi 
index 369ed6b69068acbe0644b42cf2d38e8f5bb48c02..3ace5101400f920267785840a298257e8a1a2078 100644 (file)
@@ -1,4 +1,3 @@
-terms.cmi: 
 pp.cmi: terms.cmi 
 foSubst.cmi: terms.cmi 
 orderings.cmi: terms.cmi 
@@ -11,7 +10,6 @@ paramod.cmi: terms.cmi orderings.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 
index db7e5288428cc5c63f47f29ba31c99d41f9412d3..f30b906fd908a88f33150931a8bd8e0d5d232e35 100644 (file)
@@ -1,6 +1,3 @@
-nDiscriminationTree.cmi: 
-nCicMetaSubst.cmi: 
-nCicUnifHint.cmi: 
 nCicCoercion.cmi: nCicUnifHint.cmi 
 nRstatus.cmi: nCicCoercion.cmi 
 nCicUnification.cmi: nRstatus.cmi 
index 615a158e92abe4180fbde0a74ad4bdfc2b0f6efe..8d46f1671ec75706c805db0550e9191d1b2507bf 100644 (file)
@@ -1,8 +1,5 @@
-nCicTacReduction.cmi: 
-nTacStatus.cmi: 
-nCicElim.cmi: 
-nAuto.cmi: nTacStatus.cmi 
 nTactics.cmi: nTacStatus.cmi 
+nAuto.cmi: nTacStatus.cmi 
 nInversion.cmi: nTacStatus.cmi 
 nCicTacReduction.cmo: nCicTacReduction.cmi 
 nCicTacReduction.cmx: nCicTacReduction.cmi 
@@ -10,9 +7,9 @@ nTacStatus.cmo: nCicTacReduction.cmi nTacStatus.cmi
 nTacStatus.cmx: nCicTacReduction.cmx nTacStatus.cmi 
 nCicElim.cmo: nCicElim.cmi 
 nCicElim.cmx: nCicElim.cmi 
-nAuto.cmo: nTacStatus.cmi nAuto.cmi 
-nAuto.cmx: nTacStatus.cmx nAuto.cmi 
 nTactics.cmo: nTacStatus.cmi nCicElim.cmi nTactics.cmi 
 nTactics.cmx: nTacStatus.cmx nCicElim.cmx nTactics.cmi 
+nAuto.cmo: nTactics.cmi nTacStatus.cmi nAuto.cmi 
+nAuto.cmx: nTactics.cmx nTacStatus.cmx nAuto.cmi 
 nInversion.cmo: nTactics.cmi nCicElim.cmi nInversion.cmi 
 nInversion.cmx: nTactics.cmx nCicElim.cmx nInversion.cmi 
index f70999315558341ec36d9a5c4b2971c7eb8e0bb8..7c58ae87e5fca689fd807990ab6a45cdc0395055 100644 (file)
@@ -82,86 +82,89 @@ let mk_inverter name it leftno ?selection outsort status baseuri =
  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
- prerr_endline ("lunghezza ls = " ^ string_of_int (List.length ls));
- prerr_endline ("lunghezza rs = " ^ string_of_int (List.length rs));
- let ys = List.map (fun n -> "y" ^ (string_of_int n)) (HExtlib.list_seq (leftno+1) (nparams+1)) in
-
- let id_xs = List.map mk_id xs in
- let id_ls = List.map mk_id ls in
- let id_rs = List.map mk_id rs in
- let id_ys = List.map mk_id ys in
-
- (* pseudocode  let t = Lambda y1 ... yr. xs_ = ys_ -> pred *)
-
- (* check: assuming we have more than one right parameter *) 
- (* pred := P yr- *)
- let pred = mk_appl ((mk_id "P")::id_ys) in
- 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
- let hyplist = 
-   let rec hypaux k = function
-       0 -> []
-     | n -> ("H" ^ string_of_int k) :: hypaux (k+1) (n-1)
-   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 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 ^ "_" ^ suffix); lambdas] @
-                   List.map mk_id hyplist @
-                   CicNotationPt.Implicit `Vector::[mk_id "Hterm"] ) in
-
- let status, theorem = GrafiteDisambiguate.disambiguate_nobj status ~baseuri 
-                         (baseuri ^ name ^ ".def",
-                           0,CicNotationPt.Theorem (`Theorem,name,theorem,Some
-                           (CicNotationPt.Implicit (`Tagged "inv")),`Regular)) in 
- 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 = status#set_stack ninitial_stack in
- let status = subst_metasenv_and_fix_names status in
-
- let cut_theorem = 
-   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 status = NTactics.block_tac 
-                        (NTactics.branch_tac::
-                         NTactics.case_tac "inv"::
-                         (intros @
-                          [NTactics.apply_tac ("",0,cut);
-                           NTactics.branch_tac;
-                           NTactics.case_tac "end";
-                           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.merge_tac;
-                           NTactics.merge_tac;
-                           NTactics.skip_tac])) status in
- status,status#obj
+ if nparams <= leftno 
+   then raise (Failure "inverter: the type must have at least one right parameter") 
+   else 
+     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
+     prerr_endline ("lunghezza ls = " ^ string_of_int (List.length ls));
+     prerr_endline ("lunghezza rs = " ^ string_of_int (List.length rs));
+     let ys = List.map (fun n -> "y" ^ (string_of_int n)) (HExtlib.list_seq (leftno+1) (nparams+1)) in
+    
+     let id_xs = List.map mk_id xs in
+     let id_ls = List.map mk_id ls in
+     let id_rs = List.map mk_id rs in
+     let id_ys = List.map mk_id ys in
+    
+     (* pseudocode  let t = Lambda y1 ... yr. xs_ = ys_ -> pred *)
+    
+     (* check: assuming we have more than one right parameter *) 
+     (* pred := P yr- *)
+     let pred = mk_appl ((mk_id "P")::id_ys) in
+     
+     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
+     
+     let hyplist = 
+       let rec hypaux k = function
+           0 -> []
+         | n -> ("H" ^ string_of_int k) :: hypaux (k+1) (n-1)
+       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 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 ^ "_" ^ suffix)]@ id_ls @ [lambdas] @
+                       List.map mk_id hyplist @
+                       CicNotationPt.Implicit `Vector::[mk_id "Hterm"] ) in
+    
+     let status, theorem = GrafiteDisambiguate.disambiguate_nobj status ~baseuri 
+                             (baseuri ^ name ^ ".def",
+                               0,CicNotationPt.Theorem (`Theorem,name,theorem,Some
+                               (CicNotationPt.Implicit (`Tagged "inv")),`InversionPrinciple)) in 
+     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 = status#set_stack ninitial_stack in
+     let status = subst_metasenv_and_fix_names status in
+    
+     let cut_theorem = 
+       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 status = NTactics.block_tac 
+                            (NTactics.branch_tac::
+                             NTactics.case_tac "inv"::
+                             (intros @
+                              [NTactics.apply_tac ("",0,cut);
+                               NTactics.branch_tac;
+                               NTactics.case_tac "end";
+                               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.merge_tac;
+                               NTactics.merge_tac;
+                               NTactics.skip_tac*)])) status in
+     status,status#obj
 ;;
+
index 40c03891a7433c13e27e38dbe1cb51e06030c905..cf4f36b68f502fc728be91d4b20e8b0dcd3658f2 100644 (file)
@@ -1,3 +1,2 @@
-helm_registry.cmi: 
 helm_registry.cmo: helm_registry.cmi 
 helm_registry.cmx: helm_registry.cmi 
index 25e67131fca0487c4390d310d8307722b5058067..f3c6a8bd17a7351e99ce8e59905fda76a37cbf08 100644 (file)
@@ -1,5 +1,2 @@
-utf8Macro.cmi: 
-utf8MacroTable.cmo: 
-utf8MacroTable.cmx: 
 utf8Macro.cmo: utf8MacroTable.cmo utf8Macro.cmi 
 utf8Macro.cmx: utf8MacroTable.cmx utf8Macro.cmi 
index d9d6034a11e090bef20f2d14ccd1d8fb4e5692e2..169fc76b0e21d9fad98c2fa23430aeb0fa3a0f81 100644 (file)
@@ -1,19 +1,11 @@
-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 
@@ -35,13 +27,10 @@ equalityTactics.cmi: proofEngineTypes.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 
index 6616a03d0f4c0803fa1e9c2e309bbf89270e7526..7759190c66cdd57bcc79c0da85a571cd76faa730 100644 (file)
@@ -1,5 +1,3 @@
-threadSafe.cmi: 
-extThread.cmi: 
 threadSafe.cmo: threadSafe.cmi 
 threadSafe.cmx: threadSafe.cmi 
 extThread.cmo: extThread.cmi 
index a8972f4cfc20c049020440e4f567cfb622de8243..bc310327f83551dd5875e62bfa3899e7c55559a2 100644 (file)
@@ -1,7 +1,4 @@
 parser.cmi: ast.cmo 
-tptp2grafite.cmi: 
-ast.cmo: 
-ast.cmx: 
 lexer.cmo: parser.cmi 
 lexer.cmx: parser.cmx 
 parser.cmo: ast.cmo parser.cmi 
index 9cac9aa783c7c003e70e118017c77b20d2ccb61a..4821484239ac15df403da8d9123671544b3aa65f 100644 (file)
@@ -1,3 +1,2 @@
-uriManager.cmi: 
 uriManager.cmo: uriManager.cmi 
 uriManager.cmx: uriManager.cmi 
index 65dc079553f6476748ecdb106d61534fa746d753..39f37dfa90077f1212c1f51f57ef8c55a21174c7 100644 (file)
@@ -1,5 +1,3 @@
-whelp.cmi: 
-fwdQueries.cmi: 
 whelp.cmo: whelp.cmi 
 whelp.cmx: whelp.cmi 
 fwdQueries.cmo: fwdQueries.cmi 
index e7e7ffbd729fcdbc6206eb38afebf53940878718..5ef59bdc96d40e0a64e0f50d91b949382a7f57e0 100644 (file)
@@ -1,5 +1,3 @@
-xml.cmi: 
-xmlPushParser.cmi: 
 xml.cmo: xml.cmi 
 xml.cmx: xml.cmi 
 xmlPushParser.cmo: xmlPushParser.cmi 
index 65bd7b9496155f928775a264636cae0249c62a98..e2832de332dd83fb5bd4beb1cd2b1e735d6fe35e 100644 (file)
@@ -1,3 +1,2 @@
-xmlDiff.cmi: 
 xmlDiff.cmo: xmlDiff.cmi 
 xmlDiff.cmx: xmlDiff.cmi