Skip to content

fix(clone): alias a theory cleared by a theory override - #1242

Merged
strub merged 1 commit into
mainfrom
fix/clone-cleared-theory-alias
Nov 24, 2026
Merged

strub merged 1 commit into
mainfrom
fix/clone-cleared-theory-alias

Conversation

@strub

@strub strub commented Nov 24, 2026

Copy link
Copy Markdown
Member

A theory override theory B <- T maps each item of B to the item
with the same name in T. When T was itself produced by a clone
that overrode one of its sub-theories with theory A <- U, that
sub-theory was cleared: the items of B.A have no target, and the
clone fails with:

unknown symbol: ...B.A.t

unless it also gives theory B.A <- U.

A clone now leaves a non-imported alias theory A = U in place of a
theory that theory A <- U has cleared, and theory overrides follow
these aliases, so that theory B <- T suffices. The alias is left
only when no more specific override departs from the theory override.
It also names U in qualified names: T.A.u is U.u.

Tests in tests/clone-theory-override-cleared.ec, and new cases in
tests/clone-theory-override-nested.ec and
tests/clone-theory-override-specific.ec.

Base automatically changed from feat/theory-alias-nested to main November 24, 2026 16:56
@strub strub self-assigned this Nov 24, 2026
@strub strub added the yolo-pr Don't bother reviewing, I will merge label Nov 24, 2026
A theory override `theory B <- T` maps each item of `B` to the item
with the same name in `T`. When `T` was itself produced by a clone
that overrode one of its sub-theories with `theory A <- U`, that
sub-theory was cleared: the items of `B.A` have no target, and the
clone fails with:

    unknown symbol: ...B.A.t

unless it also gives `theory B.A <- U`.

A clone now leaves a non-imported alias `theory A = U` in place of a
theory that `theory A <- U` has cleared, and theory overrides follow
these aliases, so that `theory B <- T` suffices. The alias is left
only when no more specific override departs from the theory override.
It also names `U` in qualified names: `T.A.u` is `U.u`.

Tests in tests/clone-theory-override-cleared.ec, and new cases in
tests/clone-theory-override-nested.ec and
tests/clone-theory-override-specific.ec.
@strub
strub force-pushed the fix/clone-cleared-theory-alias branch from cf175a1 to 50371bd Compare November 24, 2026 16:57
@strub
strub merged commit c090a95 into main Nov 24, 2026
5 checks passed
@strub
strub deleted the fix/clone-cleared-theory-alias branch November 24, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

yolo-pr Don't bother reviewing, I will merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant