Add :- to op table (prec 1200 xfx); enable assert/asserta/assertz with rule terms
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

- parser.sx: add (":-" 1200 "xfx") to pl-op-table so (head :- body) parses
  inside paren expressions (parens reset prec to 1200, allowing xfx match)
- parser.sx: extend pl-token-op to accept "op" token type, not just "atom",
  since the tokenizer emits :- as {:type "op" :value ":-"}
- tests/assert_rules.sx: 15 new tests covering assertz/asserta with rule
  terms, conjunction in rule body, recursive rules, and ordering
- conformance.sh: wire in assert_rules suite
- 456 → 471 tests, all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 13:22:09 +00:00
parent 1aca2c7bc5
commit 2075db62ba
6 changed files with 241 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
# Prolog scoreboard
**456 / 456 passing** (0 failure(s)).
Generated 2026-04-25T13:00:15+00:00.
**471 / 471 passing** (0 failure(s)).
Generated 2026-04-25T13:21:37+00:00.
| Suite | Passed | Total | Status |
|-------|--------|-------|--------|
@@ -27,6 +27,7 @@ Generated 2026-04-25T13:00:15+00:00.
| set_predicates | 15 | 15 | ok |
| char_predicates | 27 | 27 | ok |
| io_predicates | 24 | 24 | ok |
| assert_rules | 15 | 15 | ok |
Run `bash lib/prolog/conformance.sh` to refresh. Override the binary
with `SX_SERVER=path/to/sx_server.exe bash …`.