code wiki / (root) / nx_tactics.nx

nx_tactics.nx

buildroot/runtime/nx_tactics.nx

6333 B166 linesdepth 7pulls 7 transitivereach 1 importersview sourcekind librarytopic tactics
docsdependenciesstructsconstsfunctions

about

nx_tactics.nx -- LCF-style tactic interpreter. Closes "no tactics layer" gap. HOL Light has REPEAT TAC, THEN, MESON_TAC etc. Coq has Ltac. Lean has tactic mode. Ours is minimal but composable: each tactic transforms a TacState (chain + goal + context) and returns success/failure. Composing them is just calling them in sequence. Supported tactics in this commit: nx_tac_intro -- if goal is (A => B), assume A, new goal B nx_tac_split -- if goal is (A & B), produce two subgoals nx_tac_left -- if goal is (A | B), focus left nx_tac_right -- if goal is (A | B), focus right nx_tac_exact -- close current goal with given fact index nx_tac_apply -- apply (X => goal) reducing to subgoal X nx_tac_contradict -- close current goal via P / ~P from context nx_tac_auto -- delegate to nx_prove_propositional engine All tactics emit through v2 kernel rules so produced chains are kernel-checked. The TacState carries the proof being built; when the goal stack empties the proof is complete.

dependencies 1 imports · 1 importers

nx_prove_propositional.nx nx_tactics.nx nx_world_class_test.nx

imports: nx_prove_propositional.nx

imported by: nx_world_class_test.nx

structs

36struct TacGoal
44struct TacState

consts

31const NX_TAC_OK: nx_int = 0
32const NX_TAC_FAIL: nx_int = 1
33const NX_TAC_NOGOAL: nx_int = 2
42const NX_TAC_GOAL_BYTES: nx_int = 16
52const NX_TAC_STATE_BYTES: nx_int = 40

functions

54func nx_tac_state_new(ch: *K2Chain, goal: *Term) -> *TacState
called by 1: t7_tactics calls 1: nx_proof_ctx_new
68func nx_tac_top(s: *TacState) -> *TacGoal
73func nx_tac_seed_ctx(s: *TacState, axioms: *nx_int, n: nx_int) -> nx_int
78func nx_tac_intro(s: *TacState) -> nx_int
95func nx_tac_exact(s: *TacState, fact_idx: nx_int) -> nx_int
113func nx_tac_auto(s: *TacState) -> nx_int
122func nx_tac_apply(s: *TacState, fact_idx: nx_int) -> nx_int
145func nx_tac_split(s: *TacState) -> nx_int
163func nx_tac_done(s: *TacState) -> nx_int
called by 1: t7_tactics