X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Ftactics%2Ftacticals.ml;h=f647ebccaa9d199181761b2233c59f00ace13f1d;hb=cf9784a6b94fa9045810d8559509b54dc9e65a4a;hp=d5ec8acfb8be6c9edee7f353ba9f5368f8314511;hpb=f38af523cd051d4c1d0dceeb59ce2fbbfc87367d;p=helm.git diff --git a/components/tactics/tacticals.ml b/components/tactics/tacticals.ml index d5ec8acfb..f647ebcca 100644 --- a/components/tactics/tacticals.ml +++ b/components/tactics/tacticals.ml @@ -201,6 +201,23 @@ let if_ ~start ~continuation ~fail = in PET.mk_tactic if_ +let ifs ~start ~continuations ~fail = + let ifs status = + let xoutput = + try + let result = PET.apply_tactic start status in + info (lazy ("Tacticals.ifs: succedeed!!!")); + Some result + with PET.Fail _ -> None + in + let tactic = match xoutput with + | Some res -> thens ~start:(const_tac res) ~continuations + | None -> fail + in + PET.apply_tactic tactic status + in + PET.mk_tactic ifs + let first ~tactics = let rec first ~(tactics: tactic list) status = info (lazy "in Tacticals.first");