From: Claudio Sacerdoti Coen Date: Mon, 27 Nov 2006 13:45:51 +0000 (+0000) Subject: Declarative language ported to new auto (with Universes). X-Git-Tag: 0.4.95@7852~773 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=115915f23df4f56832d68b2f6b5b80c5afe019fc;p=helm.git Declarative language ported to new auto (with Universes). --- diff --git a/components/grafite_engine/grafiteEngine.ml b/components/grafite_engine/grafiteEngine.ml index 582ad112d..a8ee6752c 100644 --- a/components/grafite_engine/grafiteEngine.ml +++ b/components/grafite_engine/grafiteEngine.ml @@ -160,10 +160,13 @@ let tactic_of_ast status ast = | GrafiteAst.Assume (_, id, t) -> Declarative.assume id t | GrafiteAst.Suppose (_, t, id, t1) -> Declarative.suppose t id t1 | GrafiteAst.By_term_we_proved (_, t, ty, id, t1) -> - Declarative.by_term_we_proved ~dbd:(LibraryDb.instance()) t ty id t1 + Declarative.by_term_we_proved ~dbd:(LibraryDb.instance()) + ~universe:status.GrafiteTypes.universe t ty id t1 | GrafiteAst.We_need_to_prove (_, t, id, t2) -> Declarative.we_need_to_prove t id t2 - | GrafiteAst.Bydone (_, t) -> Declarative.bydone ~dbd:(LibraryDb.instance()) t + | GrafiteAst.Bydone (_, t) -> + Declarative.bydone ~dbd:(LibraryDb.instance()) + ~universe:status.GrafiteTypes.universe t | GrafiteAst.We_proceed_by_induction_on (_, t, t1) -> Declarative.we_proceed_by_induction_on t t1 | GrafiteAst.Byinduction (_, t, id) -> Declarative.byinduction t id @@ -173,7 +176,8 @@ let tactic_of_ast status ast = | GrafiteAst.Case (_,id,params) -> Declarative.case id params | GrafiteAst.AndElim(_,t,id1,t1,id2,t2) -> Declarative.andelim t id1 t1 id2 t2 | GrafiteAst.RewritingStep (_,termine,t1,t2,cont) -> - Declarative.rewritingstep ~dbd:(LibraryDb.instance ()) termine t1 t2 cont + Declarative.rewritingstep ~dbd:(LibraryDb.instance ()) + ~universe:status.GrafiteTypes.universe termine t1 t2 cont let classify_tactic tactic = match tactic with diff --git a/components/tactics/declarative.ml b/components/tactics/declarative.ml index fc8b175a2..242d6e3fe 100644 --- a/components/tactics/declarative.ml +++ b/components/tactics/declarative.ml @@ -45,10 +45,10 @@ let suppose t id ty = (fun _ metasenv ugraph -> ty,metasenv,ugraph)) ;; -let by_term_we_proved ~dbd t ty id ty' = +let by_term_we_proved ~dbd ~universe t ty id ty' = let just = match t with - None -> Tactics.auto ~dbd ~params:[] (* da sistemare *) ~universe:Universe.empty + None -> Tactics.auto ~dbd ~params:[] ~universe | Some t -> Tactics.apply t in match id with @@ -77,10 +77,10 @@ let by_term_we_proved ~dbd t ty id ty' = ~continuations:[ continuation ; just ] ;; -let bydone ~dbd t = +let bydone ~dbd ~universe t = let just = match t with - None -> Tactics.auto ~dbd ~params:[] ~universe:Universe.empty + None -> Tactics.auto ~dbd ~params:[] ~universe | Some t -> Tactics.apply t in just @@ -134,7 +134,7 @@ let existselim t id1 t1 id2 t2 = let andelim = existselim;; -let rewritingstep ~dbd lhs rhs just conclude = +let rewritingstep ~dbd ~universe lhs rhs just conclude = let aux ((proof,goal) as status) = let (curi,metasenv,proofbo,proofty) = proof in let _,context,_ = CicUtil.lookup_meta goal metasenv in @@ -149,8 +149,7 @@ let rewritingstep ~dbd lhs rhs just conclude = let just = match just with None -> - Tactics.auto ~dbd - ~params:["paramodulation","1"; "timeout","3"] ~universe:Universe.empty + Tactics.auto ~dbd ~params:["paramodulation","1"; "timeout","3"] ~universe | Some just -> Tactics.apply just in match lhs with diff --git a/components/tactics/declarative.mli b/components/tactics/declarative.mli index 3b02fb4d9..e9ec4f9df 100644 --- a/components/tactics/declarative.mli +++ b/components/tactics/declarative.mli @@ -28,10 +28,11 @@ val assume : string -> Cic.term -> ProofEngineTypes.tactic val suppose : Cic.term -> string -> Cic.term option -> ProofEngineTypes.tactic val by_term_we_proved : - dbd:HMysql.dbd -> Cic.term option -> Cic.term -> string option -> Cic.term option -> - ProofEngineTypes.tactic + dbd:HMysql.dbd -> universe:Universe.universe -> Cic.term option -> Cic.term -> + string option -> Cic.term option -> ProofEngineTypes.tactic -val bydone : dbd:HMysql.dbd -> Cic.term option -> ProofEngineTypes.tactic +val bydone : dbd:HMysql.dbd -> universe:Universe.universe -> Cic.term option -> + ProofEngineTypes.tactic val we_need_to_prove : Cic.term -> string option -> Cic.term option -> ProofEngineTypes.tactic @@ -51,5 +52,5 @@ val andelim : Cic.term -> string -> Cic.term -> string -> Cic.term -> ProofEngineTypes.tactic val rewritingstep : - dbd:HMysql.dbd -> Cic.term option -> Cic.term -> Cic.term option -> - Cic.name option -> ProofEngineTypes.tactic + dbd:HMysql.dbd -> universe:Universe.universe -> Cic.term option -> Cic.term -> + Cic.term option -> Cic.name option -> ProofEngineTypes.tactic