-
Notifications
You must be signed in to change notification settings - Fork 112
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
[Civl] Ticket example #828
Conversation
shazqadeer
commented
Dec 11, 2023
- add test driver back
- remove nil in favor of Option
- use Lval and Lset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment/question about the changed choice function.
function Choice<T>(a: [T]bool): T; | ||
axiom (forall<T> a: [T]bool :: {Choice(a)} a == MapConst(false) || a[Choice(a)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ditch the Set_
prefix and working with the Set
wrapper type?
Would it be of any use to make the return type Option<T>
and return None
for empty sets instead of an unconstrained T
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The earlier Set_Choose was defined on the type Set T
of finite sets. In the ticket sample, I want to make a choice on the domain of an Lset which is [T]bool
. So I thought I would generalize Set_Choose to Choice allowing the idea to work on any set, finite or infinite.
Would it be of any use to make the return type Option and return None for empty sets instead of an unconstrained T?
Currently, I don't see any advantage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did not realize that Set
is for finite sets. Otherwise the domain of an Lset
could have been a Set
.
function Choice<T>(a: [T]bool): T; | ||
axiom (forall<T> a: [T]bool :: {Choice(a)} a == MapConst(false) || a[Choice(a)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did not realize that Set
is for finite sets. Otherwise the domain of an Lset
could have been a Set
.
|