-
Notifications
You must be signed in to change notification settings - Fork 106
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
Monads: refactor reader_option and nondet connection #722
Conversation
08b1b74
to
0ca0a8e
Compare
Could you explain what you're trying to do? I'm seeing some theory files renamed and some proofs moved, and the commits refer to "reader_option and nondet connection" without any further description. I'm guessing you're doing something you then need for integration with the trace monad, but I'm really lost as to the intent. What do you mean by connection? |
My overall aim with these changes is to make it possible to use the reader_option monad with the trace monad, in the same way that it can currently be used with the nondet monad. Without these changes, the reader_option files
shows that the nondet concept of validity of
What I've done in the first commit is to basically reverse the dependency: the |
That's a very good explanation! Any chance some of it could make it to the commits? I had no idea until you explained it |
bf54526
to
6f477aa
Compare
Done, do those commit descriptions make sense to you? I also rebased and updated copyrights, which I had forgotten to do. |
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 works for me with the updated commit messages. You might still foreshadow in the first msg why you're doing that refactor (so that you can produce the same setup later for the trace monad).
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 wish I knew more about the trace monad stuff to comment on that, but this looks like a very good thing to do!
Thanks! What Gerwin said. Also, two commits have "reader_option" but one has "reader option". |
6f477aa
to
6431dae
Compare
Commit messages updated, rebased over #725, and I realised that I had left a lemma collection in the nondet and trace files that was just about reader_option concepts and moved it. |
6431dae
to
8610075
Compare
This reverses the dependency between reader_option and nondet. The reader_option directory now only contains definitions and lemmas for the reader_option monad and there's a file in nondet that has the lemmas connecting the two monads. In addition to resulting in a more structured divide between the reader_option and nondet monad, it also makes it possible to setup reader_option for use with other monads, such as the trace monad. Signed-off-by: Corey Lewis <[email protected]>
Signed-off-by: Corey Lewis <[email protected]>
This duplicates nondet/Nondet_Reader_Option.thy but for the trace monad instead. It proves various lemmas connecting reader_option concepts with trace concepts. Signed-off-by: Corey Lewis <[email protected]>
8610075
to
a8e8f5e
Compare
My overall aim with these changes is to make it possible to use the reader_option monad with the trace monad, in the same way that it can currently be used with the nondet monad.
Without these changes, the reader_option files
Reader_Option_ND.thy
andReader_Option_VCG.thy
depend onnondet
files, and prove various lemmas connecting reader_option concepts with nondet concepts. As an example,shows that the nondet concept of validity of
gets_the f
can be derived from the reader_option concept of validity. Most of these lemmas were inReader_Option_ND.thy
, which was described by a comment asWhat I've done in the first commit is to basically reverse the dependency: the
reader_option
directory now only contains definitions and lemmas for the reader_option monad and there's a file innondet
that has the lemmas connecting the two monads. The third commit then adds a file intrace
that is basically the same thing but for the trace monad.I am very open to suggestions if anyone has an idea for a nicer way to structure this or to reduce the copied content. I had a brief attempt at a locale but couldn't find a way to get it to work that didn't involve even more copying.