Design StarLang expert compiler and Prolog lowering #124

Open
lost-rob0t wants to merge 2 commits from design/star-lang-prolog-expert-system into main
lost-rob0t commented 2026-08-15 23:56:14 +00:00 (Migrated from github.com)

Scope

Promote the maintainer-approved STAR-LANG-RESEARCH-023 expert-system semantics into two implementation-oriented child designs without prematurely implementing against moving compiler contracts.

STAR-LANG-010

Defines the backend-neutral expert compiler and IR:

  • closed expert-system source lowering
  • typed lexical rule bindings
  • fact/session/derived/question roles
  • StarIntel object reuse without expert-only application copies
  • explicit identity/provenance requirements
  • semantic-profile derivation
  • named logic operations through the approved star.logic.api/1 boundary
  • deterministic expert IR and diagnostics
  • fake-backend-first implementation order

It explicitly corrects the stale backend syntax still present in STAR-LANG-007: implementation must use the dedicated pragma contract rather than (:backend ...) metadata.

STAR-LANG-011

Defines SWI-Prolog and N-Prolog expert lowering:

  • closed compiler-owned Prolog artifact AST
  • no raw Prolog source or caller-selected goals
  • identity-preserving StarIntel relational projections
  • named generated wrapper operations
  • SWI MQI lifecycle and profile-gated tabling/transactions
  • N-Prolog framed worker model and portable subset
  • normalized proofs, cancellation, budgets, replay, and conformance gates

Deliberate implementation block

Do not start expert-system implementation from this PR.

Current hard blockers are recorded in the designs:

  1. lost-rob0t/star-lang research 000–009 conformance ledger is still BLOCKED.
  2. Issue #5 finite binary64/RFC8785 float support is unfinished.
  3. Issue #6 still requires full SHA-256 enforcement, target -> destination, lock-graph fixtures, and permanent conformance CI.
  4. STAR-LANG-RESEARCH-026 backend-selection pragma semantics remain under review.
  5. STAR-LANG-RESEARCH-027 general pragma semantics remain under review.
  6. STAR-LANG-007 must be amended to remove the obsolete (:backend ...) source spelling.
  7. Final portable logic systems must load independently before expert lowering is added.

The next implementation work should therefore finish the core StarLang conformance blockers before widening the language surface.

## Scope Promote the maintainer-approved STAR-LANG-RESEARCH-023 expert-system semantics into two implementation-oriented child designs without prematurely implementing against moving compiler contracts. ### STAR-LANG-010 Defines the backend-neutral expert compiler and IR: - closed `expert-system` source lowering - typed lexical rule bindings - fact/session/derived/question roles - StarIntel object reuse without expert-only application copies - explicit identity/provenance requirements - semantic-profile derivation - named logic operations through the approved `star.logic.api/1` boundary - deterministic expert IR and diagnostics - fake-backend-first implementation order It explicitly corrects the stale backend syntax still present in STAR-LANG-007: implementation must use the dedicated pragma contract rather than `(:backend ...)` metadata. ### STAR-LANG-011 Defines SWI-Prolog and N-Prolog expert lowering: - closed compiler-owned Prolog artifact AST - no raw Prolog source or caller-selected goals - identity-preserving StarIntel relational projections - named generated wrapper operations - SWI MQI lifecycle and profile-gated tabling/transactions - N-Prolog framed worker model and portable subset - normalized proofs, cancellation, budgets, replay, and conformance gates ## Deliberate implementation block Do **not** start expert-system implementation from this PR. Current hard blockers are recorded in the designs: 1. `lost-rob0t/star-lang` research 000–009 conformance ledger is still BLOCKED. 2. Issue #5 finite binary64/RFC8785 float support is unfinished. 3. Issue #6 still requires full SHA-256 enforcement, `target -> destination`, lock-graph fixtures, and permanent conformance CI. 4. STAR-LANG-RESEARCH-026 backend-selection pragma semantics remain under review. 5. STAR-LANG-RESEARCH-027 general pragma semantics remain under review. 6. STAR-LANG-007 must be amended to remove the obsolete `(:backend ...)` source spelling. 7. Final portable logic systems must load independently before expert lowering is added. The next implementation work should therefore finish the core StarLang conformance blockers before widening the language surface.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin design/star-lang-prolog-expert-system:design/star-lang-prolog-expert-system
git switch design/star-lang-prolog-expert-system

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff design/star-lang-prolog-expert-system
git switch design/star-lang-prolog-expert-system
git rebase main
git switch main
git merge --ff-only design/star-lang-prolog-expert-system
git switch design/star-lang-prolog-expert-system
git rebase main
git switch main
git merge --no-ff design/star-lang-prolog-expert-system
git switch main
git merge --squash design/star-lang-prolog-expert-system
git switch main
git merge --ff-only design/star-lang-prolog-expert-system
git switch main
git merge design/star-lang-prolog-expert-system
git push origin main
Sign in to join this conversation.
No description provided.