X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Ftactics%2Fdeclarative.ml;h=7e276a8bcef73f63b273e9ed00ae3f61541f7d09;hb=403b7486e9f2cb5583a2c8035cf419bbac982fb1;hp=fc8b175a273e04970d1af8dd2b32c97cb2ae5383;hpb=cee1c02ad6a113b711b9d93176296cf16b9ec351;p=helm.git diff --git a/helm/software/components/tactics/declarative.ml b/helm/software/components/tactics/declarative.ml index fc8b175a2..7e276a8bc 100644 --- a/helm/software/components/tactics/declarative.ml +++ b/helm/software/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 @@ -148,10 +148,18 @@ let rewritingstep ~dbd lhs rhs just conclude = CicTypeChecker.type_of_aux' metasenv context rhs CicUniv.empty_ugraph in let just = match just with - None -> - Tactics.auto ~dbd - ~params:["paramodulation","1"; "timeout","3"] ~universe:Universe.empty - | Some just -> Tactics.apply just + `Auto params -> + let params = + if not (List.exists (fun (k,_) -> k = "paramodulation") params) then + ("paramodulation","1")::params + else params in + let params = + if not (List.exists (fun (k,_) -> k = "timeout") params) then + ("timeout","3")::params + else params + in + Tactics.auto ~dbd ~params ~universe + | `Term just -> Tactics.apply just in match lhs with None -> @@ -176,7 +184,9 @@ let rewritingstep ~dbd lhs rhs just conclude = ~continuations: [ Tactics.apply prhs ; Tactics.apply (Cic.Rel 1) ; - just]) status + Tacticals.then_ + ~start:(Tactics.clear ~hyps:[last_hyp_name]) + ~continuation:just]) status | Some name -> let mk_fresh_name_callback = fun metasenv context _ ~typ -> @@ -194,7 +204,9 @@ let rewritingstep ~dbd lhs rhs just conclude = ~continuations: [ Tactics.apply prhs ; Tactics.apply (Cic.Rel 1) ; - just] + Tacticals.then_ + ~start:(Tactics.clear ~hyps:[last_hyp_name]) + ~continuation:just] ]) status) | Some lhs -> match conclude with @@ -238,10 +250,12 @@ let case id ~params = let thesisbecomes t = let ty = None in - (*BUG here: missing check on t *) match ty with - None -> Tacticals.id_tac + None -> + Tactics.change ~pattern:(None,[],Some (Cic.Implicit (Some `Hole))) + (fun _ metasenv ugraph -> t,metasenv,ugraph) | Some ty -> + (*BUG here: missing check on t *) Tactics.change ~pattern:(None,[],Some (Cic.Implicit (Some `Hole))) (fun _ metasenv ugraph -> ty,metasenv,ugraph) ;;