-
Notifications
You must be signed in to change notification settings - Fork 62
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
Functions scCryptolType
and mkTypedTerm
considered harmful
#718
Comments
This is a step toward fixing #718. The use of mkTypedTerm is redundant in these cases in the SAWScript.Prover modules, as the computed schema in all cases is only used to check that the return type is Bool, and the prior calls to `propToPredicate` already ensure that.
The fundamental reason why |
Do we have a plan for addressing this? Ultimately, I think the problem here is assuming that a Maybe we should just get rid of the |
See also #1248 |
Or, perhaps less drastically, make |
Yes, making The other thing I want to do is make a new saw-core encoding of cryptol tuples and records (again) so that the mapping from cryptol types to saw-core types is injective. Instead of getting rid of |
OK, I think I'm going to take a crack at making |
This currently fails because `mkTypedTerm` doesn't know what to do with `Cryptol.Num` values, etc. CF #718
This currently fails because `mkTypedTerm` doesn't know what to do with `Cryptol.Num` values, etc. CF #718
Actually pass through the replacement value tuples. This currently fails because `mkTypedTerm` doesn't know what to do with `Cryptol.Num` values, etc. CF #718 Make `extract_uninterp2` return tuples containing only the Cryptol-value arguments to an uninterpreted function.
Actually pass through the replacement value tuples. This currently fails because `mkTypedTerm` doesn't know what to do with `Cryptol.Num` values, etc. CF #718 Make `extract_uninterp2` return tuples containing only the Cryptol-value arguments to an uninterpreted function.
Closing because avoiding |
Function
scCryptolType
from moduleVerifier.SAW.Cryptol
in packagecryptol-verifier
should pretty much never be used. Nor should functionmkTypedTerm
from moduleVerifier.SAW.TypedTerm
, orscCryptolEq
from moduleVerifier.SAW.Cryptol
, which are defined in terms of it.The main problem is that
scCryptolType
can callerror
orpanic
if it is given a type that it cannot recognize as corresponding to a Cryptol type. The second problem is that it is supposed to be an inverse function toimportType
, which converts a Cryptol type to a saw-core term, but it's not:importType
is not injective, so even if it works, it may return a different Cryptol type than the one you started with.Unfortunately
scCryptolType
and especiallymkTypedTerm
are used in lots of places in saw-script. Every one of these uses is a potential bug or panic waiting to happen. We need to remove all of them.The text was updated successfully, but these errors were encountered: