-
Notifications
You must be signed in to change notification settings - Fork 269
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
feat: Actions and streaming standard libraries #6074
base: master
Are you sure you want to change the base?
Conversation
…-streaming-stdlibs
…-streaming-stdlibs # Conflicts: # Source/DafnyStandardLibraries/src/Std/Collections/Seq.dfy
…-streaming-stdlibs
…/dafny into actions-and-streaming-stdlibs
@@ -774,6 +774,25 @@ module Std.Collections.Seq { | |||
} | |||
} | |||
|
|||
lemma {:induction false} LemmaMapPartialFunctionDistributesOverConcat<T,R>(f: (T --> R), xs: seq<T>, ys: seq<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.
I found this was necessary because MapPartialFunction was introduced, not sure if there's a better solution?
ghost predicate Valid() | ||
reads this, Repr | ||
ensures Valid() ==> this in Repr | ||
ensures Valid() ==> CanProduce(history) |
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.
(This is the first occurrences of CanProduce
I see, so maybe the answer to my thought will be clear to me later, but) my first impression is that CanProduce
ought to be separate from Valid
&& nextValue == |history| | ||
} | ||
|
||
constructor() |
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.
Code style: constructor()
looks like JavaScript to me. I would have written it with a space before the ()
, just like a named constructor constructor Init()
but with an empty-string name.
for enumerated := 0 to 5 | ||
invariant e.Valid() | ||
invariant enumerated == |e.history| | ||
invariant fresh(e.Repr - old@before(e.Repr)) |
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.
Is old@before(e.Repr)
all fresh as well? If so, you could just write fresh(e.Repr)
.
(Still WIP but worth a first review pass)
What was changed?
See documentation.
How has this been tested?
See ActionsExamples.dfy etc.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.