Conversation
|
Oops, I forgot to add an implementation of |
6544981 to
6a136fd
Compare
cryptol-saw-core/saw/Cryptol.sawcore
Outdated
| PFLiteral : (a : sort 0) -> sort 0; | ||
| PFLiteral _ = #(); |
There was a problem hiding this comment.
Is there any reason not to put all four arguments in? Unless it comes unstuck that seems preferable when someone goes to actually implement it...
There was a problem hiding this comment.
(also, what do the arguments mean? the only documentation I can find is GaloisInc/cryptol#1654, which isn't very explicit)
There was a problem hiding this comment.
I originally punted on making PFLiteral actually use the arguments, since other parts of SAW will choke on Rational/Float values anyway. But fair enough, I might as well fill this part in while I'm in the neighborhood. I've pushed a new version of the PR which does this.
(also, what do the arguments mean? the only documentation I can find is GaloisInc/cryptol#1654, which isn't very explicit)
These are explained in the docstring for the FLiteral class (here).
54f250a to
f3a5c67
Compare
| C.PFLiteral -> -- we omit the first three arguments to class FLiteral | ||
| do a <- go (tyargs !! 3) | ||
| scGlobalApply sc "Cryptol.PFLiteral" [a] |
There was a problem hiding this comment.
also I don't think this is right any more
There was a problem hiding this comment.
This is correct. The type of PFLiteral is still sort 0 -> sort 0, so we only need to supply it with a single argument. The remaining three arguments (m, n, and r) are only used when actually invoking a PFLiteral dictionary to construct a fractional value, as seen in the implementations of things like PFLiteralRational.
f3a5c67 to
00ac6f5
Compare
Fixes #3045.