- let disambiguate ast =
- let (_, _, term, _) = disambiguate ~disambiguator ~currentProof ast in
- term
- in
- (** tactic AST -> ProofEngineTypes.tactic *)
- let rec lookup_tactic = function
- | TacticAst.LocatedTactic (_, tactic) -> 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 (disambiguate term)
- | TacticAst.Apply term -> Tactics.apply (disambiguate term)
- | TacticAst.Absurd term -> Tactics.absurd (disambiguate term)
- | TacticAst.Exact term -> Tactics.exact (disambiguate term)
- | TacticAst.Cut term -> Tactics.cut (disambiguate term)
- | TacticAst.Elim (term, _) -> (* TODO Zack implement "using" argument *)
- Tactics.elim_intros_simpl (disambiguate term)
- | TacticAst.ElimType term -> Tactics.elim_type (disambiguate term)
- | TacticAst.Replace (what, with_what) ->
- Tactics.replace ~what:(disambiguate what)
- ~with_what:(disambiguate with_what)
- | TacticAst.Auto -> Tactics.auto_new ~dbd
- (*
- (* TODO Zack a lot more of tactics to be implemented here ... *)
- | TacticAst.Change of 'term * 'term * 'ident option
- | TacticAst.Change_pattern of 'term pattern * '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"
- in
- let shared =
- new sharedState ~disambiguator ~currentProof ~console ?mathViewer ~dbd ()
- in