Logic Migration

GMEOW Logic — Migration, MVP Ladder, and Risk Register

Status: rollout specification for logic:. This is the migration member of the GMEOW Logic document set. The architecture is maximal by design; this document is the strict ladder that keeps the project from trying to build a universal reasoner all at once, plus the adapter phases, the gates, the deprecation order, and the design-level risk register. Semantics are in LOGIC-SEMANTICS.md; the engine is in LOGIC-RUNTIME.md.

The MVP ladder

Each phase ships a usable artifact and is gated by the conformance corpus before the next begins. The "excludes on purpose" column is load-bearing: it is what keeps each rung small and prevents scope creep into the maximal end-state prematurely.

Phase Deliverable Excludes on purpose
v0: IR + projection ledger Parse logic: into a typed IR; emit OWL/SHACL/Datalog/N3/gUFO projections + the projection report Native solving
v1: monotonic core RDF 1.2 terms, named graphs/worlds, Horn/Datalog materialization, loss ledger, proof traces Negation-as-failure, counterfactual construction
v2: profile certifier EL/DL/Datalog/TGD profile-membership checks; the unknown/incomplete budget marker Full Prolog-grade search
v3: modal/foundation lowering Rigidity and identity-supply lints lowered into executable rules General nested modal logic
v4: backward goals Embedded Scryer goal resolution over the materialized EDB Cut in canonical semantics
v5: Stratum-C counterfactuals Deterministic revision + transient world construction under budget Multi-world Lewis ties by default
v6: probabilistic/weighted layer Explicit logic:probability/logic:weight semantics with tests Treating logic:confidence as probability

The executable-spec authority depends on the rung's kind, and the Rust core must pass the identical corpus either way (Principle 7):

The Python oracle is permanent either way (Principle 7).

Status (2026-06): v0–v6 have landed — the migration ladder is complete. The monotonic core, profile certifier, foundation lowering, backward goals, Stratum-C counterfactuals, and the v6 probabilistic/weighted layer are all merged and gated by the corpus. For the generative strata (v4 backward goals, v5 counterfactuals, v6 probabilistic marginals) the Rust engine is the executable spec and conformance is pinned by golden answer fixtures (queries/*.logicexpected/answers/*.json); the Python oracle remains the authority for materialization (Strata A/B). The v5 surface is documented in LOGIC-SEMANTICS.md and LOGIC-RUNTIME.md; the corpus lives under conformance/logic/cases/worlds-C/.

v6 (probabilistic/weighted layer). Exact marginal inference by weighted model counting under logic:ProbabilisticProfile, gated by an explicitly declared logic:ProbabilityModel (logic:FullIndependence or a logic:DependencyModel carrying an explicit joint). Probabilistic facts (logic:probability) enter inference only through the declared model; a logic:confidence annotation is never read as a probability, and probabilistic facts with no declared model refuse with status unknown rather than assuming independence. The evaluator is Rust-native (crates/logic/src/probabilistic.rs), exposed through gmeow_logic.query (each binding carries a probability); the surface is documented in LOGIC-SEMANTICS.md and the corpus lives under conformance/logic/cases/profiles/probabilistic-*.

Adapter phases

logic: does not require rewriting the existing model on day one. Two adapter phases run in parallel, each letting legacy source coexist with canonical logic: source while the source-of-truth boundary moves:

The adapters are temporary by design — they exist so the migration is incremental, not so the legacy forms remain canonical. A construct authored in both logic: and a legacy form must normalize identically or the build fails.

Foundation projection and discipline

UFO⁺ is authored canonically in logic:; the upper ontologies are generated, and they are not all the same kind of projection:

v3 status: five in-world disciplines lowered; cross-world rigidity decided; witness-world deferred

Implemented in v3. The lint-to-axiom move for the OntoUML disciplines is now partially complete:

The discipline that today guards meta-grounding is preserved across the lint-to-axiom move: the lowered modal (rigidity) and second-order (identity-supply) axioms reproduce, over the downcast, exactly the verdicts the lints produce today — the lints are the regression specification of the lowering (see operational semantics).

Gates

The migration succeeds only if every compatibility surface is tested against the same source of truth, reusing the patterns the project already runs. The required tests, mapped to existing patterns:

Existing transpiler and statement suites are the model (tests/test_statements.py, tests/test_up_projection.py). The full corpus schema is in LOGIC-CONFORMANCE.md.

Deprecations

Nothing is removed before its replacement is gated. The deprecation order:

  1. HermiT/ELK move from authority to secondary validators. They already sit outside the fast gate (make check excludes Docker reasoners; HermiT runs in its own job, make check-docker). Once the native solver passes the corpus, make reason --mode native becomes the authority and the OWL reasoners validate only their projected fragments. With v5 landed ** the native logic: corpus now spans Strata A/B/C (worlds A/B/C, backward goals, foundation, profiles, paraconsistency, explanation) — complete enough to begin this demotion. It is not done here: the flip still requires a DL/EL projection cross-check** gate (a dual-run analogous to 's SHACL cross-check) proving make reason --mode native ≡ ELK on the EL fragment before authority moves. Tracked as its own follow-up epic; the SHACL counterpart is (pySHACL/rdflib removal). Apache Jena is on the mid-term removal list (sole RDF-1.2 triple-term serializer today; removal blocked on a Rust/oxigraph serializer).
  2. The Python solver becomes the oracle, not the engine. It is retained permanently as the executable spec, but the Rust core carries production workloads.
  3. owl:* and gufo: adapter source is retired per slice, only after that slice's logic: form passes the equivalence gate. Retirement is per-slice and reversible until the gate is green.

No deprecation is silent: each is recorded, and any capability dropped from a projection appears in the loss ledger with its preservation polarity.

Design risk register

This architecture is ambitious enough to warrant a standing, design-level risk register. It already argues that undecidability is accepted and managed; the same honesty applies to the other semantic hazards. Each row names the hazard, where it bites, and the mitigation that is already in the design.

Risk Where it appears Mitigation
Cut changes declarative answers Prolog profile cut is procedural-only, confined to ProceduralPrologProfile; loss recorded on projection (semantics)
Confidence mistaken for probability weighted/ProbLog-style inference four separate predicates; probability only in ProbabilisticProfile (semantics)
Named graph treated as modal semantics worlds world-indexed entailment relation; no implicit dataset-union (semantics)
Anti-rigidity needs a missing witness world foundation witness-obligation policy by default; Stratum C may construct witnesses (semantics)
Triple term treated as both quote and assertion metalogic a triple term names a proposition; assertion is via explicit predicates (semantics)
Projection overclaims preservation loss ledger preservation polarity per projection (conformance)
Non-stratified negation loops / multiple models rules mandatory semantic-profile declaration; soundness stated relative to it
Counterfactual revision ties explode Stratum C declared entrenchment ordering; genuine tie → unknown, never branch
Stale materialization or counterfactual cache Nemo/oxigraph store content-hash-keyed graph snapshots (runtime)
Undecidability / non-termination canonical layer decidability is a projection/profile property; budget → unknown/incomplete
BFO/DOLCE overclaimed as truth-preserving foundation projection bridge views labelled as such; not truth-preserving unless certified per fragment