code wiki / (root) / nx_lpo.nx

nx_lpo.nx

buildroot/runtime/nx_lpo.nx

6147 B163 linesdepth 6pulls 6 transitivereach 1 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_lpo.nx -- Lexicographic Path Ordering (LPO). Per Vampire-displacement roadmap Phase 2. Sibling to KBO -- both well-founded simplification orders on first-order terms. LPO is purely structural: no symbol weights, just a total precedence on symbols. Useful when KBO can't be admissibly weighted (e.g. theories with many constants where all weights tied to w_0). Kamin-Levy 1980 standard formulation: s >_LPO t iff one of: (LPO1) t is a proper subterm of s (LPO2) s = f(s_1..s_n), t = g(t_1..t_m), f > g in precedence, and s >_LPO t_j for every j in 1..m (LPO3) s = f(s_1..s_n), t = f(t_1..t_n) (same head, same arity), (s_1..s_n) >_LPO_lex (t_1..t_n) at the first differing pair, and s >_LPO t_j for every j after that index Sealed verdict {GT, EQ, LT, INCOMP}. Reuses KboState's precedence + arity fields -- the precedence concept is identical across KBO and LPO, so two stores would just be redundant. weights field is ignored by LPO.

dependencies 6 imports · 1 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_result.nx nx_unify.nx nx_term_order.nx nx_lpo.nx nx_lpo_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_result.nxnx_unify.nxnx_term_order.nx

imported by: nx_lpo_test.nx

structs

none

consts

38const NX_LPO_GT: nx_int = 1
39const NX_LPO_EQ: nx_int = 2
40const NX_LPO_LT: nx_int = 3
41const NX_LPO_INCOMP: nx_int = 4

functions

46func nx_lpo_is_proper_subterm(outer: *Term, inner: *Term) -> nx_int
62func nx_lpo_prec_cmp(st: *KboState, a_sym: nx_int, b_sym: nx_int) -> nx_int
called by 1: nx_lpo_compare
71func nx_lpo_compare(st: *KboState, s: *Term, t: *Term) -> nx_int
157func nx_lpo_verdict_name(v: nx_int) -> *u8
called by 1: report