Skip to content

[AI Pasta] [main] translator: preserve quoted values in expression heads - #324

Open
godelclaw wants to merge 1 commit into
trueagi-io:mainfrom
godelclaw:fix/quote-expression-head-main-20261116
Open

godelclaw wants to merge 1 commit into
trueagi-io:mainfrom
godelclaw:fix/quote-expression-head-main-20261116

Conversation

@godelclaw

@godelclaw godelclaw commented Nov 16, 2026 •

Copy link
Copy Markdown

Main counterpart to #323. !(q4 ((quote (> 2 1)))) currently returns
(q4 (true)): the translator interprets a list-valued head again after
translating it. Reuse the evaluated head directly so the result is
(q4 ((> 2 1))), while translating the arguments as before.

Keep eval_data_term/3 and eval_data_list/3: main still uses them for the
malformed-case data fallback. Add the fourteen shared expression-head
regressions plus a control for that fallback and its existing warning.

Based directly on main (ee5cacb), with one commit and no PR dependencies.

Validation:

  • Full test.sh passes: 333 positive examples, 167 expected rejections,
    parser and fold tests, compiler matrices, fuzz checks and the soundness
    matrix. The harness reports one --oracle timeout for tilepuzzle.metta; the
    unchanged base also times out at the same 240-second limit.
  • All 15 new assertions pass in normal and strict mode on SWI 10.1.9 and
    patched 10.1.20. A 90-case eval/compiled comparison also passes.
  • Three execution controls preserve exact inference counts; the tested
    nested-data-head translation uses fewer inferences.

Optional Prolog -O runs retain the existing builtin-registry startup
diagnostic on both the unchanged base and this branch (#298); all 15 new
assertions pass there as well.

Fixes #322.

Port the quotation fix to main: the list-valued head is already translated, so construct data from that value and its translated arguments without interpreting the head again.

Retain eval_data_term/3 and eval_data_list/3 because main also uses them for malformed case syntax. Add the fourteen shared expression-head regressions and a control for that existing data fallback.
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.

[stable/main] Quoted code is evaluated through expression heads

1 participant