Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to instantiate abstract ADT together with its constituent in abstract theory #567

Open
oskgo opened this issue Jun 25, 2024 · 0 comments

Comments

@oskgo
Copy link
Contributor

oskgo commented Jun 25, 2024

Usually we can instantiate an ADT with another that is defined the same way. This can fail when the definition includes a type that is also part of the abstract theory and thus also has to be instantiated.

The following example prints unknown symbol: Top.T.t:

abstract theory T.
  type t.
  type t' = [wrap of t].
  op usewrap: bool = predT wrap.
end T.

clone T as T1.

clone T as T2 with
type t <- T1.t,
type t' <- T1.t'.

Also instantiating usewrap fixes the issue, but this scales with the number of uses of wrap. Another workaround is to do the final clone in two steps:

clone T as Ttemp with
type t <- T1.t.

clone Ttemp as T2 with
type t' <- T1.t'.
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

No branches or pull requests

1 participant