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

feat: Actions and streaming standard libraries #6074

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from

Conversation

robin-aws
Copy link
Member

@robin-aws robin-aws commented Jan 24, 2025

(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.

@robin-aws robin-aws changed the title Actions and streaming stdlibs feat: Actions and streaming standard libraries Jan 24, 2025
@@ -774,6 +774,25 @@ module Std.Collections.Seq {
}
}

lemma {:induction false} LemmaMapPartialFunctionDistributesOverConcat<T,R>(f: (T --> R), xs: seq<T>, ys: seq<T>)
Copy link
Member Author

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)
Copy link
Collaborator

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()
Copy link
Collaborator

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))
Copy link
Collaborator

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).

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