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

Which description is correct? #53

Closed
waddlaw opened this issue Oct 25, 2017 · 7 comments
Closed

Which description is correct? #53

waddlaw opened this issue Oct 25, 2017 · 7 comments

Comments

@waddlaw
Copy link
Contributor

waddlaw commented Oct 25, 2017

Question: expression and predicate syntax.

Readme in liquidhaskell repo

expression

e := v                      -- variable
   | c                      -- constant
   | (e + e)                -- addition
   | (e - e)                -- subtraction
   | (c * e)                -- multiplication by constant
   | (v e1 e2 ... en)       -- uninterpreted function application
   | (if p then e else e)   -- if-then-else

predicate

p := (e r e)          -- binary relation
   | (v e1 e2 ... en) -- predicate (or alias) application
   | (p && p)         -- and
   | (p || p)         -- or
   | (p => p)         -- implies
   | (not p)          -- negation
   | true
   | false

But, this tutorial is below:

expression

    e := v                   -- variable
       | c                   -- constant
       | e + e               -- addition
       | e - e               -- subtraction
       | c * e               -- linear multiply
       | v e1 e2 ... en      -- uninterpreted function application

predicate

    p := true
       | false
       | e r e           -- atomic binary relation
       | v e1 e2 ... en  -- predicate application
       | p  && p         -- and
       | p  || p         -- or
       | p ==> p         -- implies
       | p <=> p         -- if and only if
       | not p           -- negation

Both of a bit different. Which is correct?

@ranjitjhala
Copy link
Member

ranjitjhala commented Oct 25, 2017 via email

@waddlaw
Copy link
Contributor Author

waddlaw commented Oct 25, 2017

@ranjitjhala Thanks for your reply.

I think the only difference between the two
is that the parentheses are explicit in the
LH README?

Yes of course.
And more, I think that (if p then e else e) of expression is different from LH README.
Also ==>, p <=> p of predicate.

Thank you.

@waddlaw
Copy link
Contributor Author

waddlaw commented Nov 6, 2017

I think that is correct predicate syntax below:

p := (e r e)          -- binary relation
   | (v e1 e2 ... en) -- predicate (or alias) application
   | (p && p)         -- and
   | (p || p)         -- or
   | (p => p) | (p ==> p)         -- implies
   | (p <=> p)
   | (not p)          -- negation
   | true | True
   | false | False

To verified, I used liquid v0.8.0.5.
Let me clarify my understanding here.Is my understanding correct?

@ranjitjhala
Copy link
Member

ranjitjhala commented Nov 6, 2017 via email

@waddlaw
Copy link
Contributor Author

waddlaw commented Nov 7, 2017

@ranjitjhala
Copy link
Member

ranjitjhala commented Nov 7, 2017 via email

@waddlaw
Copy link
Contributor Author

waddlaw commented Dec 5, 2017

Merged. closing this issue.

@waddlaw waddlaw closed this as completed Dec 5, 2017
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

2 participants