* http://cs.unibo.it/helm/.
*)
-let rewrite_tac ~direction ~pattern equality =
- let rewrite_tac ~direction ~pattern:(wanted,hyps_pat,concl_pat) equality status
+let rec rewrite_tac ~direction ~pattern equality =
+ let _rewrite_tac ~direction ~pattern:(wanted,hyps_pat,concl_pat) equality status
=
let module C = Cic in
let module U = UriManager in
let proof,goal = status in
let curi, metasenv, pbo, pty = proof in
let (metano,context,gty) as conjecture = CicUtil.lookup_meta goal metasenv in
+ match hyps_pat with
+ he::(_::_ as tl) ->
+ PET.apply_tactic
+ (Tacticals.then_
+ (rewrite_tac ~direction
+ ~pattern:(None,[he],Cic.Implicit None) equality)
+ (rewrite_tac ~direction ~pattern:(None,tl,concl_pat) equality)
+ ) status
+ | [_] as hyps_pat when concl_pat <> Cic.Implicit None ->
+ PET.apply_tactic
+ (Tacticals.then_
+ (rewrite_tac ~direction
+ ~pattern:(None,hyps_pat,Cic.Implicit None) equality)
+ (rewrite_tac ~direction ~pattern:(None,[],concl_pat) equality)
+ ) status
+ | _ ->
let arg,dir2,tac,concl_pat,gty =
match hyps_pat with
[] -> None,true,PT.exact_tac,concl_pat,gty
ProofEngineStructuralRules.clear dummy
]),
pat,gty
- | _ -> assert false (*CSC: not implemented yet!*)
+ | _::_ -> assert false
in
let if_right_to_left do_not_change a b =
match direction with
in
(proof',goals)
in
- ProofEngineTypes.mk_tactic (rewrite_tac ~direction ~pattern equality)
+ ProofEngineTypes.mk_tactic (_rewrite_tac ~direction ~pattern equality)
let rewrite_simpl_tac ~direction ~pattern equality =