Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 395
    • Issues 395
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Merge requests
  • !432

Fixed issue #2392 and ensured that all unique objects in SaC indeed are not shared

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Sven-Bodo Scholz requested to merge sbs/sac2c:hotfix-2392 into develop Sep 06, 2025
  • Overview 0
  • Commits 4
  • Changes 4

Issue #2392 (closed) was a bug in the re-introduction of name sharing. It turns out that preventing an inlining of the generic to_ functions suffices to avoid the name clashes. The MR also resolves a conceptual problem of uniqueness types (not just in SaC but also in Clean where this problem remains unresolved!). The problem is that equational reasoning postulates that beta-reductions and eta-extensions can be done without changing the semantics of a program. This implies that { a = f(); return [a,a]; } and { return [f(), f()]; } should both have the same semantics. If a is of a unique type, this equality fails!

In SaC, the compiler ignores UNQ types after they have been checked and performs many optimisations that assume equational reasoning to hold (most prominently here CSE :-)

To re-enable full ER, we need to make the uniqueness explicit through a data-dependency (as we do for external states anyways). This MR weaves the global object TheControlFlow into all properly constructed constructors that use the generic functions to_<unq-type>. That way, two calls to a constructor f() now become distinct as they operate on conceptually different states of TheControlFlow.

This should ensure that all objects in SaC indeed cannot be shared and we should have proper uniqueness objects!

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: hotfix-2392