nx_tactics.nx
buildroot/runtime/nx_tactics.nx
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
imports: nx_prove_propositional.nx
imported by: nx_world_class_test.nx
structs
| 36 | struct TacGoal |
| 44 | struct TacState |
consts
| 31 | const NX_TAC_OK: nx_int = 0 |
| 32 | const NX_TAC_FAIL: nx_int = 1 |
| 33 | const NX_TAC_NOGOAL: nx_int = 2 |
| 42 | const NX_TAC_GOAL_BYTES: nx_int = 16 |
| 52 | const NX_TAC_STATE_BYTES: nx_int = 40 |
functions
| 54 | func nx_tac_state_new(ch: *K2Chain, goal: *Term) -> *TacState |
| 68 | func nx_tac_top(s: *TacState) -> *TacGoal |
| 73 | func nx_tac_seed_ctx(s: *TacState, axioms: *nx_int, n: nx_int) -> nx_int calls 1: nx_proof_ctx_seed |
| 78 | func nx_tac_intro(s: *TacState) -> nx_int |
| 95 | func nx_tac_exact(s: *TacState, fact_idx: nx_int) -> nx_int |
| 113 | func nx_tac_auto(s: *TacState) -> nx_int |
| 122 | func nx_tac_apply(s: *TacState, fact_idx: nx_int) -> nx_int |
| 145 | func nx_tac_split(s: *TacState) -> nx_int |
| 163 | func nx_tac_done(s: *TacState) -> nx_int called by 1: t7_tactics |