X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=components%2Ftactics%2Ftacticals.ml;h=3e9c1db2cbb59f2db82f313b5b934f6058ea8657;hb=cd91767a396b7bbc72e6e3ee90a3b758421f935d;hp=eb3ebc1bba506c4a748b846d36a45a968fe814ec;hpb=84d34c4d0b0a3c923a62cb686966ef66bccb54c8;p=helm.git diff --git a/components/tactics/tacticals.ml b/components/tactics/tacticals.ml index eb3ebc1bb..3e9c1db2c 100644 --- a/components/tactics/tacticals.ml +++ b/components/tactics/tacticals.ml @@ -108,8 +108,6 @@ struct type tactic = PET.tactic - let id_tactic = id_tac - (* f is an eval function of a machine; the machine is applied to a fresh stack and the final stack is read back to obtain the result of the tactic *) @@ -130,12 +128,7 @@ struct let opened_goals, closed_goals = goals_diff ~before ~after ~opened in (proof', opened_goals, closed_goals), stack - let get_status (status, _) = status - let get_proof ((proof, _, _), _) = proof - let goals ((_, opened, closed), _) = opened, closed - let set_goals (opened, closed) ((proof, _, _), stack) = - (proof, opened, closed), stack (* Done only at the beginning of the eval of the machine *) let get_stack = snd @@ -190,15 +183,14 @@ let seq ~tactics = (* Tacticals that cannot be implemented on top of tynycals *) let first ~tactics = - let rec first ~(tactics: (string * tactic) list) status = + let rec first ~(tactics: tactic list) status = info (lazy "in Tacticals.first"); match tactics with [] -> raise (PET.Fail (lazy "first: no tactics left")) - | (descr, tac)::tactics -> - info (lazy ("Tacticals.first IS TRYING " ^ descr)); + | tac::tactics -> try let res = PET.apply_tactic tac status in - info (lazy ("Tacticals.first: " ^ descr ^ " succedeed!!!")); + info (lazy ("Tacticals.first: succedeed!!!")); res with PET.Fail _ -> first ~tactics status @@ -237,18 +229,16 @@ let rec repeat_tactic ~tactic = (* This tries tactics until one of them solves the goal *) let solve_tactics ~tactics = - let rec solve_tactics ~(tactics: (string * tactic) list) status = + let rec solve_tactics ~(tactics: tactic list) status = info (lazy "in Tacticals.solve_tactics"); match tactics with - | (descr, currenttactic)::moretactics -> - info (lazy ("Tacticals.solve_tactics is trying " ^ descr)); + | currenttactic::moretactics -> (try let (proof, opened) as output_status = PET.apply_tactic currenttactic status in match opened with - | [] -> info (lazy ("Tacticals.solve_tactics: " ^ descr ^ - " solved the goal!!!")); + | [] -> info (lazy ("Tacticals.solve_tactics: solved the goal!!!")); output_status | _ -> info (lazy ("Tacticals.solve_tactics: try the next tactic")); raise (PET.Fail (lazy "Goal not solved"))