+ method private disambiguate ast =
+ let (_, _, term, _) =
+ MatitaCicMisc.disambiguate ~disambiguator ~currentProof ast
+ in
+ term
+
+ (** tactic AST -> ProofEngineTypes.tactic *)
+ method private lookup_tactic = function
+ | TacticAst.LocatedTactic (_, tactic) -> self#lookup_tactic tactic
+ | TacticAst.Intros (_, names) -> (* TODO Zack implement intros length *)
+ PrimitiveTactics.intros_tac ~mk_fresh_name_callback:(namer_of names)
+ ()
+ | TacticAst.Reflexivity -> Tactics.reflexivity
+ | TacticAst.Assumption -> Tactics.assumption
+ | TacticAst.Contradiction -> Tactics.contradiction
+ | TacticAst.Exists -> Tactics.exists
+ | TacticAst.Fourier -> Tactics.fourier
+ | TacticAst.Left -> Tactics.left
+ | TacticAst.Right -> Tactics.right
+ | TacticAst.Ring -> Tactics.ring
+ | TacticAst.Split -> Tactics.split
+ | TacticAst.Symmetry -> Tactics.symmetry
+ | TacticAst.Transitivity term ->
+ Tactics.transitivity (self#disambiguate term)
+ | TacticAst.Apply term -> Tactics.apply (self#disambiguate term)
+ | TacticAst.Absurd term -> Tactics.absurd (self#disambiguate term)
+ | TacticAst.Exact term -> Tactics.exact (self#disambiguate term)
+ | TacticAst.Cut term -> Tactics.cut (self#disambiguate term)
+ | TacticAst.Elim (term, _) -> (* TODO Zack implement "using" argument *)
+ Tactics.elim_intros_simpl (self#disambiguate term)
+ | TacticAst.ElimType term -> Tactics.elim_type (self#disambiguate term)
+ | TacticAst.Replace (what, with_what) ->
+ Tactics.replace ~what:(self#disambiguate what)
+ ~with_what:(self#disambiguate with_what)
+ | TacticAst.Auto -> Tactics.auto_new ~dbd
+ | TacticAst.Hint ->
+ let l = List.map fst
+ (MetadataQuery.experimental_hint ~dbd
+ (currentProof#proof#proof,currentProof#proof#goal))
+ in
+ let u = console#choose_uri l in
+ Tactics.apply (CicUtil.term_of_uri u)
+ | TacticAst.Change (what, with_what, _) ->
+ let what = self#disambiguate what in
+ let with_what = self#disambiguate with_what in
+ Tactics.change ~what ~with_what
+ (*
+ (* TODO Zack a lot more of tactics to be implemented here ... *)
+ | TacticAst.Change_pattern of 'term pattern * 'term * 'ident option
+ | TacticAst.Change of 'term * 'term * 'ident option
+ | TacticAst.Decompose of 'ident * 'ident list
+ | TacticAst.Discriminate of 'ident
+ | TacticAst.Fold of reduction_kind * 'term
+ | TacticAst.Injection of 'ident
+ | TacticAst.LetIn of 'term * 'ident
+ | TacticAst.Reduce of reduction_kind * 'term pattern * 'ident option
+ | TacticAst.Replace_pattern of 'term pattern * 'term
+ | TacticAst.Rewrite of direction * 'term * 'ident option
+ *)
+ | _ -> MatitaTypes.not_implemented "some tactic"
+