-
Notifications
You must be signed in to change notification settings - Fork 4
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
Constraint conjunction #123
Comments
Adding this might also be helpful for #130, as we could synthesise
whenever post-state divergence modelling is needed. |
Just trying to think how to handle the problem of, say
We can't just rename one of the constraints to the parameters of the other, and I'd rather not introduce a massive wad of alpha renaming logic. I think what we might need to do is rename all constraint parameters to positional names during desugaring:
Then we can desugar directly to
This shouldn't be too difficult, though it's definitely nontrivial software engineering work. |
Makes sense. Though if we had this, does it simplify any of our examples?
…On 2 February 2017 at 11:12, Matt Windsor ***@***.***> wrote:
Just trying to think how to handle the problem of, say
shared bool foo, bar;
constraint baz(foo, x) -> bar == foo;
constraint baz(x, bar) -> bar == foo;
We can't just rename one of the constraints to the parameters of the
other, and I'd rather not introduce a massive wad of alpha renaming logic.
I think what we might need to do is rename all constraint parameters to
positional names during desugaring:
shared bool foo, bar;
constraint baz($1, $2) -> bar == $1;
constraint baz($1, $2) -> $2 == foo;
Then we can desugar directly to
constraint baz($1, $2) -> (bar == $1) && ($2 == foo);
This shouldn't be too difficult, though it's definitely nontrivial
software engineering work.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANd9vs4Dn6Pf2-2jrhBVClMZg5D1b8eks5rYboUgaJpZM4LMAGd>
.
|
@septract I'll go fishing in the examples, I seem to remember there was something where we ideally wanted to AND a |
@septract in the array version of Peterson's algorithm we have:
Ideally this should be replaced with something like
|
Ah, so the current `disjoint` keyword doesn't do quite what we want because
of this issue. Got it, that makes sense.
…On 2 February 2017 at 11:28, Matt Windsor ***@***.***> wrote:
@septract <https://github.com/septract> in the array version of
Peterson's algorithm
<https://github.com/septract/starling-tool/blob/master/Examples/Pass/petersonArray.cvf>
we have:
constraint holdLock(me) * waiting(you) -> me != you && turn == you;
constraint flagDown(me) * flagDown(you) -> me != you;
constraint flagUp(me) * flagUp(you) -> me != you;
constraint flagUp(me) * waiting(you) -> me != you;
constraint flagUp(me) * holdLock(you) -> me != you;
constraint waiting(me) * waiting(you) -> me != you;
Ideally this should be replaced with something like
disjoint holdLock, flagDown, flagUp, waiting;
constraint holdLock(me) * waiting(you) -> turn == you;
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#123 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANd9kRWSKgUU5dy2JU5WU3ZQhSLPq-qks5rYb3vgaJpZM4LMAGd>
.
|
If we write
Starling should collapse this to
It should be ok to substitute the first set of parameters for all subsequent instances of the constraint as long as all substitutions are done in parallel.
If we write
it should perhaps be an error (eventually this might have special semantics, eg. allowing HSF to infer a constraint no weaker than
baz
.This is needed for #122 but is useful on its own.
The text was updated successfully, but these errors were encountered: