Cover the exec special-form contract with kernel tests#109
Open
MesTTo wants to merge 1 commit into
Open
Conversation
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.
f0fc477 to
d00eb9e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins the exec special-form contract with six behavior tests against the live engine, no new kernel code:
Space::interpretaccepts(exec <loc> <patterns> <templates>)with pattern functor,orIand template functor,orO, andmetta_calculusremoves an exec before interpreting it, so a rejected exec is consumed without effect. Covered: the,/,rewrite; theI/Opath (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).