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

Can you add logical operations for predicates? #2

Open
Atalay-Ileri opened this issue Jun 15, 2019 · 3 comments
Open

Can you add logical operations for predicates? #2

Atalay-Ileri opened this issue Jun 15, 2019 · 3 comments

Comments

@Atalay-Ileri
Copy link

As far as I can see, AND, OR, NOT and FORALL is missing for predicates. Can you add them so I can combine predicates?

@tchajed
Copy link
Owner

tchajed commented Jun 18, 2019

forall makes sense to me so I just added it. The other connectives are quite awkward to work with in separation logic, so I'd rather not have them in the library if there's no real support for using them. Why do you need them?

@pseudohuman92
Copy link

One simple example is possible results of a Write operation. If it fails, disk contents aft the given address stays the same, if it succeeds content changes.

If you don't want to include them, I can fork and extend the library. Automation may not be as good as native support but it can work.

@tchajed
Copy link
Owner

tchajed commented Jun 18, 2019

You can express that particular example within separation logic - exists! v', [v' = v0 \/ v' = v] * a |-> v' would be the postcondition of Write(a, v).

The types are all transparent, so you can actually just define your own connectives for predicates on top. You just have to wrap your predicate (of type (A -> option V) -> Prop) in the mkPred constructor.

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

3 participants