|
| 1 | +# MeTTa TS 1.2.0-experimental.0 |
| 2 | + |
| 3 | +This is an experimental prerelease on the `experimental` npm dist-tag, not the |
| 4 | +default `latest`. It carries the in-progress Minimal MeTTa runtime and the |
| 5 | +Grounded V2 operation protocol for early adopters; the surface may still change |
| 6 | +before 1.2.0. Install it explicitly: |
| 7 | + |
| 8 | +```bash |
| 9 | +npm install @metta-ts/core@experimental |
| 10 | +npm install @metta-ts/hyperon@experimental |
| 11 | +``` |
| 12 | + |
| 13 | +`npm install @metta-ts/core` continues to resolve the stable 1.1.6 release. |
| 14 | + |
| 15 | +## Grounded operation V2 and streaming operations |
| 16 | + |
| 17 | +Grounded operations can now return an owned, pull-based answer stream with |
| 18 | +per-answer binding deltas and effects, rather than an eagerly collected array. |
| 19 | +The runner exposes `MeTTa.registerStreamingOperation` and |
| 20 | +`registerAsyncStreamingOperation`: the function returns an iterable (or async |
| 21 | +iterable) of answers and the evaluator pulls one at a time, so a consumer such as |
| 22 | +`once` stops the producer instead of draining it. Each answer may bind the call's |
| 23 | +argument variables and attach effects applied only on that answer's branch. The |
| 24 | +low-level `registerGroundedOperationV2` protocol underneath owns and closes every |
| 25 | +cursor exactly once, bounds each pull with a finite allowance, and rejects foreign |
| 26 | +variables in answers. This is MeTTa TS's implementation of the Minimal MeTTa |
| 27 | +document's unimplemented "grounded operations returning bindings" future work; it |
| 28 | +has no upstream parity oracle, so its ownership, retention, and binding-delta |
| 29 | +behavior are pinned by an executable law suite and a protocol fuzzer. |
| 30 | + |
| 31 | +## Cursor streaming through interpreted evaluation |
| 32 | + |
| 33 | +A `metta`/`metta-thread` call under a cooperative cursor and interpreted rule |
| 34 | +alternatives now stream one answer per pull, so `once` over a large interpreted |
| 35 | +producer performs one step and closes the tail. A single-answer chain keeps its |
| 36 | +direct tail-call path; a producer fault after one delivered answer still delivers |
| 37 | +that answer first. |
| 38 | + |
| 39 | +## Minimal MeTTa runtime foundations |
| 40 | + |
| 41 | +Typed runtime foundations for the minimal machine: scoped variables and canonical |
| 42 | +persistent binding frames, binding capture and replay, coherent evaluation |
| 43 | +contexts with logical snapshots, explicit Minimal MeTTa control semantics, |
| 44 | +resumable search cursors with owned concurrency, and persistent branch worlds with |
| 45 | +bounded effect replay. |
| 46 | + |
| 47 | +## eval.ts modularization |
| 48 | + |
| 49 | +The core evaluator file was split from about 15,000 lines into a 4,400-line core |
| 50 | +plus sixteen leaf-ward modules (machine types, terms, environment, world, |
| 51 | +specializer, type views, generator driver, query, concurrent merge, tabling, |
| 52 | +cursor constructors, world mutation, matching, fast paths, scheduler glue, and the |
| 53 | +eval operation), with the public API preserved through the facade. The change is |
| 54 | +mechanical and behavior-preserving. |
| 55 | + |
| 56 | +## Correctness: substitution resolves to a fixpoint |
| 57 | + |
| 58 | +A specialized forward chainer emulating backward chaining on propositional |
| 59 | +calculus returned an extra spurious proof (GitHub issue #2). Applying a binding |
| 60 | +set as a substitution was single-pass, so a variable whose value mentioned another |
| 61 | +still-bound variable left that inner variable unresolved; a later scope |
| 62 | +restriction then dropped its binding and lost the derived constraint. `instantiate` |
| 63 | +now resolves to a fixpoint. The query returns the single proof that Hyperon 0.2.10 |
| 64 | +and PeTTa (SWI-Prolog) both produce. The resolution stays bounded and scalable: a |
| 65 | +variable chain is followed iteratively (a four-million-link chain resolves rather |
| 66 | +than overflowing the stack), a name-to-value index makes a long chain linear rather |
| 67 | +than quadratic, binding cycles truncate deterministically, and a shared value DAG |
| 68 | +is resolved once by object identity, so a term with an exponential number of paths |
| 69 | +resolves in constant time with bounded memory. |
| 70 | + |
| 71 | +## Verification |
| 72 | + |
| 73 | +- Full test suite: 147 files pass, 1,849 tests pass, 38 optional live integration |
| 74 | + tests skipped. The Grounded V2 protocol adds an executable law suite, a scripted |
| 75 | + cursor fuzzer, and a disjoint-set binding oracle. The substitution fix adds |
| 76 | + fixpoint and backward-chaining regression tests, each shown to fail on the |
| 77 | + single-pass version. |
| 78 | +- Core/ST conformance is unchanged from 1.1.6: 431 passed, 77 established |
| 79 | + failures, 60 manifest expected failures, byte-identical failure set. |
| 80 | +- Performance is neutral against 1.1.6 on the nondeterminism benchmark suite; |
| 81 | + the substitution change adds asymptotic headroom (linear chains, DAG sharing) |
| 82 | + with no measured regression. |
| 83 | + |
1 | 84 | # MeTTa TS 1.1.6 |
2 | 85 |
|
3 | 86 | MeTTa TS 1.1.6 reduces the cold and loaded cost of compiled nondeterministic |
|
0 commit comments