Repository navigation
Tags
Tags
docs: +docs Record the rejected linear search in small sorted vectors… … (EXP-10) (#1172) Records EXP-10 in `docs/experiments/10-linear-small-search/`: searching small sorted vectors linearly instead of with `std::lower_bound` below a size threshold, in `Post::find()` (delta), `OrdVector` (`StateSet`) and `SmallOrdVector` (targets). Rejected. - **Variants:** forward scans with an early exit (4, 8, 16, 32 elements, everywhere or in delta's posts only), a branch-free counting scan up to 32, backward scans (16, 32, posts only 32), and a product variant that finds the epsilons during the merge instead of calling `Post::first_epsilon_it()` first. One patch per variant in `patches/`. - **Where searches happen:** the TACAS'24 programs hardly search (6 of 12 sampled experiments did no search in these containers). The NFT programs search posts often (318M `Post::find()` calls), mostly for keys at or behind the last entry, and `std::lower_bound` takes only 0.3–2.3% of their samples. - **End to end:** against an A/A control (`devel` against a copy of itself) on the TACAS'24 Mata experiments and the NFT cc-programs, no search variant separates from noise. The backward scan wins the microbenchmark on the NFT key pattern (0.59–0.98× of `std::lower_bound`) but not end to end. The product variant is slower on `param-inter` (1.052×) and `param-inter-variadic` (1.038×). - **Correctness:** the variants covering the new code pass the C++ unit tests in Release; no `result` differed from `devel`. The first commit joins the EXP-9 row back to the index table: a blank line and a doubled pipe had split it off, so it rendered as a stray paragraph. Part of #321 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added an experiment record with benchmark results, measurement details, and instructions for reproducing the evaluations. * Documented that linear-search variants and follow-up approaches showed no consistent end-to-end improvement and were rejected; application behavior is unchanged. * Added links to the new experiment in the experiment index. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
mata-lazy: +feat Find the shortlex-least witness (#1174) This PR adds `Options::shortlex(order)`, that allows the lazy formula to return [shortlex](https://en.wikipedia.org/wiki/Shortlex_order)-least witness, with the symbols ranked by their place in order. The witness then will not depends on the engine's internal order (rewrites, plans, operand order). The search do BFS, like shortest, and keeps together the macrostates that the same word reaches. It takes the moves in the order of their least tuples, so the first accepting macrostate it meets will be the least word to be reached. Padding and the wildcard cannot be placed in an order, and a query with one returns `ReservedSymbol`. This has been tested against random automata and is compared against a simple brute-force method. Example: ```rust let words = formula.leaf(&Regex::new("[a-c][a-c]")?)?; let outcome = formula.check(words, &Options::new().shortlex(*b"cba"))?; // the witness is cc ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added shortlex ordering for witness searches. Searches return the shortest accepted witness, breaking equal-length ties according to the supplied symbol order. * Shortlex ordering supports multi-tape automata and respects search limits. * **Documentation** * Clarified that breadth-first searches return a shortest witness, or the shortlex-least witness when shortlex ordering is specified. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
docs: +docs Record the EXP-2 fair BDD follow-up results (#1173) Adds the fair follow-up to EXP-2 (`docs/experiments/2-nft-bdd-automata/`, NFT levels as BDDs on automaton transitions). - **Metric:** the new `solve` metric charges every build for turning parsed guards into its own representation (`operation` + `construction` + `mataminterm` + `mataconstruction`), so no build skips its representation cost. `operation` stays reported separately. - **Workloads:** `bits-wide` (seeded random 20-state NFAs over 8–32 Boolean variables) and `exists` (existential projection, then complement and emptiness, or inclusion), also on the 169 real Presburger-complement inputs. - **Results:** on `operation` the original rejection stands (NFT-BDD 7.24× CUDD). On `solve` it is 0.77× CUDD and 0.21× MONA by geometric mean, faster on wide alphabets and projection, but CUDD keeps a large edge on the heaviest symbolic products (18× on `param-inter`). - **Tools:** `tools/analyse.py` reports both metrics, geometric mean and summed ratios, per-width breakdowns and minterm statistics. Full tables in `results.md`.
nft: fix complement with DONT_CARE and multi-level universality (#1171) ## Summary Two `nft` fixes for the bugs pinned by the remaining `[!shouldfail]` differential cases after #1168: 1. **Complement expands DONT_CARE** (`nft: +fix complement expands DONT_CARE`): `complement()` unwound only jump transitions, and `determinize()` reads `DONT_CARE` as one more symbol, so the complement of a transducer with `DONT_CARE` accepted words the input accepts. Unwinding now always runs with the alphabet, which spells `DONT_CARE` out as every symbol. 2. **Universality checks finality at round boundaries only** (`nft: +fix is_universal() checks finality at round boundaries only`): the antichain check came from the NFA one and demanded a final state after every symbol, so it rejected every universal multi-level transducer. It now unwinds jumps and `DONT_CARE`, requires a final state only on level 0, and pads a counterexample to a whole round. ## Tests - Both differential cases lose `[!shouldfail]`; the hidden larger sweep now also checks `is_universal()` against an empty complement. - The `mata::nft::is_universal()` unit tests are NFA examples; they now use a one-level fixture (on two levels, each transition is a jump reading the same symbol on both tapes, which is not universal; they passed only because levels were ignored). - mata-cli script test: `nft:universal?` of two-level Σ* is now `true`. Rust doc of `Nft::is_universal` updated. Local (debug, g++): `ctest` 669/669; `[differential]` all 486692 assertions pass; Rust `clippy -D warnings` clean, `cargo test --workspace --all-features` no failures. The first commit alone passes `ctest` with the universality case still failing as expected.
core: +build Use Emscripten's mimalloc in WebAssembly builds (#1170) ## Summary `MATA_USE_MIMALLOC=ON` now works with `emcmake`: instead of `find_package(mimalloc)` (no such package in the Emscripten sysroot) or the FetchContent fallback, libmata carries **`-sMALLOC=mimalloc`** as an `INTERFACE` link option. Emscripten ships mimalloc as a system allocator ([docs](https://emscripten.org/docs/optimizing/Optimizing-Code. 8000 html#allocation)), so every module that consumes libmata links `libmimalloc` instead of the default dlmalloc. - `CMakeLists.txt`: Emscripten branch selected before the package lookup and fallback. - `src/CMakeLists.txt`: the link option is `INTERFACE`, so it propagates from `libmata.a` to the consumer that links the module. - `cmake/mataConfig.cmake.in`: no `find_dependency(mimalloc)` when the consumer also builds with Emscripten. - `bindings/wasm/CMakeLists.txt`: the playground no longer forces `MATA_USE_MIMALLOC=OFF`. - `cmake/config.hh.in`: documents how consumers that link `libmata.a` directly select the allocator. Native builds are unchanged. ## Verification Emscripten 6.0.9 (nixpkgs): the playground configures with `Using mimalloc (Emscripten -sMALLOC=mimalloc)`; `EM_CACHE` builds `sysroot/lib/wasm32-emscripten/libmimalloc.a` and the link command carries `-sMALLOC=mimalloc`; `node bindings/wasm/smoke-test.mjs build-wasm/mata-playground.js` passes. ## Out of scope The Rust bindings' `wasm32-unknown-emscripten` target stays on the default allocator: `build.rs` forces `MATA_USE_MIMALLOC=OFF` there, and a build script cannot forward `-sMALLOC` to the link of a dependent crate. Enable that separately if wanted (explicit link args in the application, not the library). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Build Improvements** * Emscripten builds with mimalloc enabled use Emscripten’s mimalloc allocator, without requiring a separate native mimalloc installation. * The required allocator linker setting is passed along to applications using the library. When linking the library archive directly, include the documented linker setting. * Emscripten builds with address sanitization disable mimalloc because the options are incompatible. * Native builds retain their existing mimalloc configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
nft: fix product pending jumps, complement, and one-sided same-level … …EPSILON pairing (#1168) ## Summary Five fixes to `nft` operations, each independently bisectable: 1. **Product keeps the pending jump of the waiting side** (`nft: +fix product keeps the pending jump of the waiting side`): when one side of the product waits in its source state mid-jump, its pending symbol was not carried over, letting a later round glue the first half of one jump to the second half of another and accept words outside the intersection. 2. **Complement handles jumps and missing initial states** (`nft: +fix complement handles jumps and missing initial states`): complement of an NFT whose transitions jump levels (or with initial states on non-zero levels) was unsound; complement now builds on the corrected handling. The differential cases "complement of a transducer with a jump transition" and "complement of a transducer without initial states is universal" pinned these bugs with `[!shouldfail]`; they pass now, so the tag is dropped. 3. **Post docs** (`core: +docs Correct the PostEntryCore size comment`): the comment overstated the size of `PostEntryCore`. 4. **Product pairs one-sided same-level EPSILON moves** (`nft: +fix product pairs one-sided same-level EPSILON moves`): the two-pointer symbol merge pairs a symbol only when both sides have it, so an `EPSILON` transition on one side only was dropped. A same-level `EPSILON` round reads nothing on any tape, so the staying side may remain in its source state; dropping it loses words (even the empty word when an operand takes an initial same-level `EPSILON`). The fix pairs each such move with the staying side's source state and merges targets into an existing `EPSILON` post instead of pushing a duplicate (which would break the sorted-post invariant). Cross-level `EPSILON` rounds stay deliberately unpaired; pending states skip `EPSILON` rounds so they keep owing their waiting side's continuation. The pairing applies to `product()` only: `composition_product()`, which the `compose_general_reference()` pipeline uses, lets a side wait through the whole-round `EPSILON` self-loops it inserts, and `compose_general_direct()` must keep matching that relation. 5. **Product binds a waiting `DONT_CARE` jump to `DONT_CARE`** (`nft: +fix product binds a waiting DONT_CARE jump to DONT_CARE`): fix 1 binds only a concrete symbol, so a side waiting mid-way through a `DONT_CARE` jump could continue with any other jump of its source state, gluing the first half of the `DONT_CARE` jump to the second half of a concrete one (e.g. accepting `(a, b)` when the only path to the final state is the jump `(b, b)`). The waiting side is now bound to `DONT_CARE`, which still matches any symbol of the other side. Three intersection tests pinned the language of the previously incomplete product; their `expected` automata are updated to the more complete product. `are_equivalent()` compares eps-as-letter flat views, which is not a sound criterion for products with `EPSILON` (the pristine library fails it too), so the expectations follow the fixed product's structure. A regression test covers the empty word, an observable one-sided same-level `EPSILON` round at level 1, and the dropped cross-level case. The Rust law `intersection(x, y) ⊆ x, y` compares encodings with `EPSILON` as a letter, which `Nft::is_included_in()` documents as reliable only without epsilon; it now runs on epsilon-free operands (`intersection_of_length_preserving`), while the general law keeps checking the relation itself. ## Verification - Targeted: `build/debug/g++/tests/tests 'mata::nft::intersection*'` — 13/13 cases, 188/188 assertions; `'mata::nft::complement*'` — 2431/2431 assertions. - NFT-semantics sweep (membership by levels, no eps-as-letter) on randomized small operands: the fixed product is sound and complete against `L(a) ∩ L(b)` on ε-free words (0 unsound, 0 incomplete) where the pristine product drops words. - The original (eps-disabled) fuzzer stays clean (TOTAL: 0, seeds 1–8 and 3-level runs). - `ctest` on the debug build: 618/618 pass; Rust `cargo test -p mata --test nft_laws`: 12/12 pass. The new `DONT_CARE` regression sections fail on the previous head and pass with fix 5. - Two `[!shouldfail]` differential cases remain, for bugs outside this PR: `is_universal()` ignoring the levels and `complement()` not expanding `DONT_CARE`. ## Notes - `composition_product()` keeps the pipeline semantics: no pending-symbol restrictions and no one-sided `EPSILON` pairing. No API changes outside `mata::nft` internals.
examples: fix adaptive all-state predicate CEGAR termination (#1169) ## Summary Two fixes to the adaptive predicate CEGAR loop in `examples/rmc/armc.matasc`: 1. **Accept contained predicates in all-state refinement** (uwvqzxtxwxmx / `42e3c789`): all-state backward CEGAR used whole-language inclusion of the refined predicate union (`nfa:included?`) as evidence that no further refinement was possible. A contained predicate can still add distinct state-residual fingerprints and enable progress, so broken Burns backward stopped with `unknown, abstraction cycling` instead of reporting the real 10-step error, and RTL backward stopped with `unknown` instead of finding a safe invariant. 2. **Stop on repeated counterexample languages** (lmnxsprxvtyp / `451e582f`): with that inclusion check removed for all-state mode, termination is now guaranteed explicitly: when a no-growth refinement round repeats an earlier counterexample language, the loop stops with `unknown, abstraction cycling`. Whole-language mode keeps its original no-growth cycle check. ## Verification - Independent replay from a clean workspace: backward broken Burns → `unsafe, steps: 10, predicate refinements 3`; backward RTL → `safe, predicate refinements 2`. - `cargo test --release --test cli the_regular_model_checking_examples_reach_their_verdicts` passes (covers both new backward regressions; 1 passed / 190 filtered). - 330/330 standard matrix runs and 40/40 seed/direction runs at the fixed revision, returncode 0, no timeouts, verdicts matching shipped expectations. Raw records with full commands retained locally. ## Notes - Whole-language predicate-granularity CEGAR remains incomplete backward on some models (`unknown, abstraction cycling`); this is reported as incompleteness, never as safety, and is unchanged by this PR. - Part of the ARTmc techniques work; no library code changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Behavior** * Predicate refinement at state granularity can now continue when a refinement adds no new predicate language, unless the same counterexample language has appeared before. In that case, verification reports “unknown, abstraction cycling.” * Whole-language refinement continues to report “unknown, abstraction cycling” when refinement adds no new predicate language. * **Tests** * Added verification coverage for cases that report unsafe after 10 steps and safe, respectively. * **Documentation** * Clarified how refinement behavior differs by granularity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
build: +feat Fetch mimalloc when no package is installed (#1167) ## Summary - Reuse an existing `mimalloc` target or installed CMake package before downloading anything. - When neither is available, fetch and build the hash-pinned mimalloc **2.5.4** release instead of requiring a manual installation. - Keep parent-project linkage intact and avoid duplicate allocator targets when Mata is fetched by another project. - Preserve deterministic offline builds: with `FETCHCONTENT_FULLY_DISCONNECTED=ON`, an absent package and local source now produce a clear configuration error. Nix already sets this option and continues to supply mimalloc directly. - Document installed-package preference, automatic fallback, and the disconnected-build override. ## Verification - Configured with `CMAKE_DISABLE_FIND_PACKAGE_mimalloc=ON`: fetched mimalloc 2.5.4, built Mata, and passed **669/669 tests** in 17.82 s. - Configured with the Nix mimalloc package: used the installed package and did not create a fetched mimalloc source directory. - Configured with package discovery disabled and `FETCHCONTENT_FULLY_DISCONNECTED=ON`: failed with the intended missing-mimalloc diagnostic. - `nix build --no-link --print-build-logs .#mataGcc`: passed **669/669 tests** with Nix-provided mimalloc and downloads disconnected. - Installed the fetched configuration and confirmed that `mimalloc-config.cmake` is exported and the Mata test executable loads the fetched `libmimalloc.so.2`. - `nix flake check --no-build` and the project formatter passed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved build configuration when a parent project already provides mimalloc, reducing unnecessary package searches. * Builds can proceed without network access when a mimalloc source override or existing source tree is available. * The fallback build uses the static mimalloc library, while shared builds select an available dynamic library where supported. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
cli: +feat Clap-based command line, completions, manual pages; build:… … mimalloc default; shared libmata and static/shared Nix packages; examples (#1165) ## Summary Ten commits shipped on top of `devel`. Cleans up the build/linkage surface, removes a per-process allocator hazard that crashed Python/runtimes, replaces the hand-rolled argument parser with `clap`, and adds a Mata Script example catalogue with runnable tests. - **69ec83e** cmake: +fix Export the installed include directory where the headers are installed. CMake dropped `$<INSTALL_INTERFACE:include>`; a `find_package(mata)` consumer previously failed whenever headers went to a separate `dev` output ("Imported target includes non-existent path"). The file-set already exports its install destination; don't hardcode it. - **6e21c5b** cmake: +feat Build libmata as a shared library with `BUILD_SHARED_LIBS`. Stays static by default. SHARED: soname `libmata.so.<major>.<minor>`, `re2::*` hidden (`src/libmata.map` on ELF, `.exp` on Mach-O), `find_package(mata)` and the install rule verify. Windows fails configure (no `dllexport` annotations). - **a30b991** nix: +feat Split the packages into outputs. `mata` → `out`/`dev`/`doc`; `mataPy` → `out`/`dist`/`doc`; `mataRust` → `out`/`doc`; `mataCli` → `out`. `mataRust`/`mataCli` link the `mata` derivation's `libmata.a` through `MATA_DIR` instead of rebuilding the C++ library twice. New `mataConsumer` check exercises `find_package` against the split `dev`/`out` package (it caught the include fix above). - **87bc93f** python: +fix Share one libmata between the extension modules. Each of the seven Cython modules previously carried its own `libmata.a`, so each had its own `MATA_DELTA_ALLOCATOR` selection (with `MATA_DELTA_ALLOCATOR=pool`, one module freed the other's block = UB). All modules now link one `.so`, dropped via `$ORIGIN/..` (Linux) / `@loader_path/..` (Darwin) rpath into the package. Counts down from 11.8 MB of partly duplicated third-party code to one copy (Mac wheels untested; nothing else changed). - **bbe45a1** build: Use mimalloc by default. CMake defaults `MATA_USE_MIMALLOC=ON` (was OFF). `find_package(mimalloc 2 QUIET)` first; if absent and Fetch is allowed, download pinned microsoft/mimalloc@`v3.5.3` (the nixpkgs one) statically. Disconnected builds fail with a hint to set `MATA_USE_MIMALLOC=OFF` (also useful for sanitizer setups). Users with sanitizers/etc. can flip the option. **Side note:** was already enabled in the Nix packages — now consistent. - **9c042ae** cli: +feat Generate the command line, completions and manual pages with clap. Replace ~700 lines of hand-rolled arg parsing in `mata-cli` (689 in `cli.rs`, 307 in `convert.rs`) with `#[derive(Parser)]`/`Args`; operations in `nfa`/`nft`/`strings` become runtime clap subcommands built from `OPERATIONS`. Help, completions (`mata completions SHELL`) and manual pages now share the definition. `mata generate-manpages DIR` writes `mata.1` + per-subcommand pages. `nix build .#mataCli.man` ships 12 pages; bash completion lands in `mataCli.out`. **Breaks userland:** usage errors print to stderr with status 2 and a usage hint; `mata --version` prints the three-line `mata version`. Test assertions rewritten accordingly. - **f6bc92c** nix: +feat Publish static and shared linkages separately. `mata` stays static; new `mataShared` (and `mataClangShared`) is the public name of the variant used internally by `mataPy`; `mataStatic` is the explicit name of `mata`. `nix build .#mataShared` gives `libmata.so.<ver>`,`*-dev` still has the same headers. README table updated. The `mataConsumer` check now also runs for the shared variant. - **e5a6103** examples: +feat Add Mata Script examples with an output-comparing runner. Five small `.matasc` scripts in `examples/mata-script/` (`01-first-steps`, `02-inputs-and-params`, `03-functions-and-lists`, `04-transducers`, `05-loops`) plus the `.mata` automata they reference. `examples/mata-script/run.sh` runs each file once per `; run:` line and diffs against `<name>.out`; `just examples::mata-script::check` builds release `mata-cli` and runs the suite (currently all five pass). `examples::mata-script::update` regenerates outputs. Notable unrelated side fix: - **2e6e5ec** nix: +fix Delete the unused `nix/package.nix` (dead copy, superseded by `nix/mata-cpp.nix`). - **c568d93** nix: +fix Export `mataDocs` from the overlay. ## Test plan - [x] `cargo test --package mata-cli`: **182 passed**; clippy `--all-targets --all-features -- -D warnings` clean. - [x] `nix fmt` clean; the per-crate `mataConsumer` check exercises `find_package(mata)` against split `dev`/`out` once per linkage. - [x] `nix build .#mataShared` produces `libmata.so.0.0.0` (soname correct); `mataCli.out` contains the 12 man pages plus the bash completion; `man mata` and `man mata-nfa` render the OPERATIONS section properly. - [x] `examples::mata-script::check`: all five scripts match their recorded `.out`. - [x] `nix flake check --keep-going`: all checks pass except treefmt (after which `nix fmt` was applied and treefmt rerun clean). - [x] The previous mixed-allocator crash (release-only segfault during libstdc++ static-init) is fixed on the Rust CLI path by **dropping the duplicated static override**, keeping mimalloc on by default. Verified locally with `LD_DEBUG=bindings` — the locale-init SIGSEGV signature (see linked `diagnose-mixed-allocator-crash`) disappears. Side note: `.gitignore` gains an exception for `examples/mata-script/*.out` so the expected-output files are tracked (the existing blanket `*.out` ignore was hiding them). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added support for building and packaging static or shared libraries, with separate package outputs for each. * Python extensions now bundle and load the shared library they need. * Added CLI shell-completion generation and generated manual pages. * Added Mata Script examples and commands to run, check, and update their expected output. * Added Nix packages for library consumers and expanded documentation outputs. * **Bug Fixes** * Improved mimalloc discovery across installed and fetched builds, including static and shared libraries. * **Documentation** * Updated build, packaging, CLI, and language-binding guidance for the new library options. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ## Later fixes - `c44a86b153a3` review: Address CodeRabbit findings on #1165 — runner `--mata PATH` resolution before `cd`; mata-py staging `libmata.*.dylib` on macOS; `_copy_libmata` picks newest soname by mtime; `_runtime_path_args` module-layout coupling documented; on macOS shared builds with override-only installed `mimalloc`, configure now fails with a clear message unless `mimalloc-static` is exported. Regenerated all five `examples/mata-script/*.out` fixtures under the corrected runner. - `9a9a61585961` round-2 review fixes: `_copy_libmata` derives the soname from the project VERSION (`get_version()`) instead of mtime order; runner fails fast on missing/unusable `--mata` and on unreadable `.matasc`; mata-cli mimalloc comment re-explains that libmata inherits the executable's allocator and `mata-sys` opts out of `MATA_USE_MIMALLOC`; examples Nix postInstall installs every binary and filters only known artifact extensions.
rust,bindings,site,docs: Turn loops and recursion on by default in Ma… …ta Script (#1163) Turn `:loops-and-recursion` on by default in Mata Script. Loops and recursion are now part of the language without any preamble: `Checker` and the interpreter start with the option on, and a script that wants the termination guarantee back can still write `(set-option :loops-and-recursion false)`. Turning the option off makes a `loop`, a `recur`, and a function that uses its own name errors before the script runs; encountering loops never aborts an accepted script, it only takes the termination guarantee away from the report, as before. Consequences handled: - `loop` and `recur` are now rejected by name in portable-core scripts (`'loop' is not in the portable core`), since the old rejection came for free from the option defaulting to off; an explicit `(set-option :loops-and-recursion true)` stays rejected there. - The needs-loops error text is unchanged: it names `(set-option :loops-and-recursion true)`, which remains the remedy when a script turned the option off. - The placement rule is unchanged: the option must be set before the first form that is not `set-option` or `set-info`. - Docs updated: the language page's design principles, the "Loops and recursion" section (now documented as on by default, with the off example), the options table (`true` (default), `false`), the portable-core section, and the CLI page's `script check` description. - The redundant `(set-option :loops-and-recursion true)` dropped from `examples/rmc/armc.matasc`, the playground examples, the web tests, and the wasm smoke test; the smoke test now demonstrates the off switch instead (a script that turns the option off rejects its `loop` with the needs-loops error). - `mata formats` output is unchanged; the feature stays listed as implemented. Verification: `nix fmt` clean; `cargo test -p mata-cli --all-features` (11 + 180 + 4 passed, 0 failed) and `--test web` (4 passed) after the flip and after the test cleanups; `cargo clippy -p mata-cli --all-targets --all-features` clean. The wasm smoke test runs in `website.yml` CI (no Emscripten toolchain here); its new off-switch assertion was replayed against the native CLI (exit 2, `'loop' needs (set-option :loops-and-recursion true) at 2:1`). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Loops, `recur`, and self-recursive functions are enabled by default. Scripts can disable them with `:loops-and-recursion false`; when disabled, these constructs are rejected. * Portable-core scripts reject attempts to enable loops and recursion or use loop constructs. * **Bug Fixes** * Empty binding lists in `let` and `loop` forms now produce clear errors instead of proceeding or failing unexpectedly. * Recursive calls now handle local definitions that shadow the function name correctly. * **Documentation** * Updated language and CLI guidance to reflect the default behavior and restrictions. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
PreviousNext