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

An interval also includes the upperbound #57

Open
wmo opened this issue Jul 21, 2021 · 0 comments
Open

An interval also includes the upperbound #57

wmo opened this issue Jul 21, 2021 · 0 comments

Comments

@wmo
Copy link

wmo commented Jul 21, 2021

First of all, thanks for making your notes available.

There is a minor correction I want to make regarding:
https://docs.plutus-community.com/docs/lectures/Lecture3.html

It says: @interval a b@ includes all values that are greater than or equal to @A@ and smaller than @b@. Therefore it includes @A@ but it does not include @b@.

That is wrong, because upperbound b is also included. Try it in the REPL.

let iv = interval (10 :: Integer) 20
member 10 iv    GIVES   True
member 20 iv    GIVES   True
member 21 iv    GIVES   False

If you look at lines 203-206 of source code plutus-ledger-api/src/Plutus/V1/Ledger/Interval.hs
-- | @interval a b@ includes all values that are greater than or equal to @A@
-- and smaller than or equal to @b@. Therefore it includes @A@ and @b@.

(all this may be due to a plutus source code change?)

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