Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Make test binary load, translate, and typecheck Cryptol.cry. #30

Merged
merged 6 commits into from
Aug 6, 2020

Conversation

brianhuffman
Copy link
Contributor

(This addresses part of #25.)

@brianhuffman brianhuffman marked this pull request as draft July 28, 2020 01:18
@brianhuffman
Copy link
Contributor Author

Marked as draft until I get the test passing.

@brianhuffman brianhuffman marked this pull request as ready for review July 28, 2020 02:34
@brianhuffman
Copy link
Contributor Author

As of 0042988, the test should be passing.

Brian Huffman added 3 commits July 30, 2020 14:14
Previously the translator would try to apply the dictionary
constructor `PSignedCmpWord`, which expects an argument of
type `Nat`, to an argument of type `Num`. We now have a new
function `PSignedCmpSeqBool` which expects an argument of
type `Num`, just like the existing `PCmpSeqBool`.
This is another step toward addressing #25.
Brian Huffman added 2 commits July 30, 2020 14:33
Three cryptol fp primitives were missing:
  * fpIsFinite
  * fpToRational
  * fpFromRational

Currently they are all implemented using the saw-core `error`
function; real implementations will be needed eventually.
The extra cryptol code comprises two files:
  * superclass.cry
  * instance.cry

These two files are copied from tests/regression in the cryptol
repository, and are intended to test all the implicit subclass
relationships and class instance rules of cryptol.
@brianhuffman
Copy link
Contributor Author

As of dc58a40 (which adds tests of cryptol code exercising all instance and subclass rules), there are a lot of translation failures due to missing class dictionaries. I'll have to implement all of them to get the test passing again.

@brianhuffman brianhuffman marked this pull request as draft July 30, 2020 23:51
This is accomplished by defining new dictionary constructors
in Cryptol.sawcore (currently mostly filled with `error` stubs)
and then adding cases to the translator to use them to
discharge class constraints.

NOTE: This revision of cryptol-verifier uses the cryptol library
functions `tIsRational` and `tIsFloat`, which were added in
GaloisInc/cryptol#855.

New instance rules:
  * Eq Rational
  * Cmp Rational
  * Zero Rational
  * Ring Rational
  * Field Rational
  * Round Rational
  * Literal Rational
  * Eq (Float e p)
  * Cmp (Float e p)
  * Field (Float e p)
  * Round (Float e p)
@brianhuffman brianhuffman marked this pull request as ready for review July 31, 2020 00:29
@brianhuffman
Copy link
Contributor Author

I think this is a good stopping point to merge the PR.

Copy link
Contributor

@robdockins robdockins left a comment

Choose a reason for hiding this comment

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

Seems good to me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants