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

[Civl] Ticket example #828

Merged
merged 1 commit into from
Dec 11, 2023
Merged

[Civl] Ticket example #828

merged 1 commit into from
Dec 11, 2023

Conversation

shazqadeer
Copy link
Contributor

  • add test driver back
  • remove nil in favor of Option
  • use Lval and Lset

Copy link
Member

@bkragl bkragl left a 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.

Comment on lines +220 to +221
function Choice<T>(a: [T]bool): T;
axiom (forall<T> a: [T]bool :: {Choice(a)} a == MapConst(false) || a[Choice(a)]);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Comment on lines +220 to +221
function Choice<T>(a: [T]bool): T;
axiom (forall<T> a: [T]bool :: {Choice(a)} a == MapConst(false) || a[Choice(a)]);
Copy link
Member

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.

@shazqadeer
Copy link
Contributor Author

Set T is defined here. It was added just so we could consolidate reasoning about cardinality of finite sets in one place.

@shazqadeer shazqadeer merged commit 2d83955 into master Dec 11, 2023
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants