8000 [ivy1.7, ivy1.8] unsoundness with two `after init` blocks · Issue #82 · kenmcmil/ivy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ivy1.7, ivy1.8] unsoundness with two after init blocks #82

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

Open
plredmond opened this issue Nov 15, 2024 · 0 comments
Open

[ivy1.7, ivy1.8] unsoundness with two after init blocks #82

plredmond opened this issue Nov 15, 2024 · 0 comments

Comments

@plredmond
Copy link
plredmond commented Nov 15, 2024

Summary

If you have a specification { after init { ... } } containing assertions and also an implementation { after init { ... } } containing actions, you can assert false in the specification { after init { ... } } if the other assertions in specification { after init { ... } } relate to the result of actions in implementation { after init { ... } }.

Steps to reproduce

Put the following in oops.ivy.

#lang ivy1.7

individual x:bool

specification {
    after init {
        assert x = true;
        assert false;
    }
}

implementation {
    after init {
        x := true;
    }
}

Check the file with the following command.

$ ivy_check trace=true oops.ivy
  • Expected: Line 8 assert false; should fail.
  • Actual: Whole file passes.

Removing line 7 assert x = true; or removing line 17 x := true; fixes the issue (line 8 assert false; fails). Additionally, moving both the asserts and the actions into a single after init { ... } outside of either specification { ... } and implementation { ... } resolves the issue.

Present in versions

On kenmcmil/ivy@dbe45e7 on macOS Sonoma.

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
0