Skip to content

some trigger updates#25

Open
yizhou7 wants to merge 8 commits into
dafny-lang:masterfrom
secure-foundations:collection-trigger-fix
Open

some trigger updates#25
yizhou7 wants to merge 8 commits into
dafny-lang:masterfrom
secure-foundations:collection-trigger-fix

Conversation

@yizhou7

@yizhou7 yizhou7 commented Oct 14, 2021

Copy link
Copy Markdown

removed some tiggers that repeats dafny's selection
added some comments for dafny selected trigger

@parno parno left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor suggestions. I think we had also discussed updating the README or STYLE file with a note along the lines of "The {:trigger} annotations used in the standard library are an advanced topic and should not be needed when starting out on Dafny projects."

Comment thread src/Collections/Sequences/Seq.dfy Outdated
Comment thread src/Collections/Sequences/Seq.dfy Outdated
Comment thread src/Collections/Sequences/Seq.dfy Outdated
@parno

parno commented Oct 15, 2021

Copy link
Copy Markdown
Contributor

Cool, thanks for the changes!

@RustanLeino RustanLeino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you. It really good to see so many manual triggers go. I have a few specific comments below.

Comment thread src/Collections/Maps/Imaps.dfy Outdated
Comment thread src/Collections/Maps/Imaps.dfy
Comment thread src/Collections/Maps/Imaps.dfy Outdated
Comment on lines +36 to 37
/* Dafny selected triggers: {x in xs}, {x in m}, {x in m'} */
ensures forall x {:trigger x in m'} :: x in m' ==> x in m && x !in xs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trigger in the other direction (that is, x in m) seems equally useful to me. Is there a reason not to include it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the ensures is an implication, we might only want the x in m'? My limited understanding is that we are ensuring the properties of m', rather than the original m. So might not be necessary to invoke this fact every time we see the original map.

Comment thread src/Collections/Sequences/Seq.dfy Outdated
Comment thread src/Collections/Sets/Isets.dfy Outdated
@parno

parno commented Dec 2, 2021

Copy link
Copy Markdown
Contributor

@RustanLeino I believe Yi has addressed all of the issues you raised. Is this ready to be merged?

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.

3 participants