Skip to content

Cover the exec special-form contract with kernel tests#109

Open
MesTTo wants to merge 1 commit into
trueagi-io:mainfrom
MesTTo:pr/mork-formal-special-form-parity
Open

Cover the exec special-form contract with kernel tests#109
MesTTo wants to merge 1 commit into
trueagi-io:mainfrom
MesTTo:pr/mork-formal-special-form-parity

Conversation

@MesTTo

@MesTTo MesTTo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Pins the exec special-form contract with six behavior tests against the live engine, no new kernel code: Space::interpret accepts (exec <loc> <patterns> <templates>) with pattern functor , or I and template functor , or O, and metta_calculus removes an exec before interpreting it, so a rejected exec is consumed without effect. Covered: the ,/, rewrite; the I/O path (a (== pat $r) source binding the matched atom, (+ ...) add and (- ...) remove sinks); the three rejection shapes (bad template functor, bad pattern functor, symbol pattern); and template-written execs being scheduled like any other (self-scheduling).

This replaces the earlier FormalMeTTa classifier parity tests: Empty / NotReducible / Unit / Error are interpreter-layer results the MORK kernel does not implement, so classifying them belongs to the interpreter above MORK. The kernel-real special-form surface is the exec shape dispatch, which is also modeled in Alloy (github.com/MesTTo/alloy-mork: fac25 — dispatch totality on valid shapes, rejection otherwise, io flags mirroring the functors).

Pins the special-form surface the kernel actually has: `Space::interpret`
accepts `(exec <loc> <patterns> <templates>)` with pattern functor `,` or `I`
and template functor `,` or `O`, and `metta_calculus` removes an exec before
interpreting it, so a rejected exec is consumed without effect. Six behavior
tests cover the `,`/`,` rewrite, the `I`/`O` path (a `(== pat $r)` source
binding the matched atom, `(+ ...)` add and `(- ...)` remove sinks), the three
rejection shapes (bad template functor, bad pattern functor, symbol pattern),
and template-written execs being scheduled like any other (self-scheduling).

Replaces the earlier FormalMeTTa classifier parity tests: Empty / NotReducible
/ Unit / Error are interpreter-layer results that the MORK kernel does not
implement, so classifying them belongs to the interpreter above MORK; the
kernel-real contract is the exec shape dispatch, which these tests pin against
the live engine with no new kernel code.
@MesTTo MesTTo force-pushed the pr/mork-formal-special-form-parity branch from f0fc477 to d00eb9e Compare July 4, 2026 07:59
@MesTTo MesTTo changed the title Add FormalMeTTa special-form classifier parity tests Cover the exec special-form contract with kernel tests Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant