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

Better error messages when instantiating a module #1497

Closed
yav opened this issue Feb 9, 2023 · 0 comments
Closed

Better error messages when instantiating a module #1497

yav opened this issue Feb 9, 2023 · 0 comments
Labels
parameterized modules Related to Cryptol's parameterized modules typechecker Issues related to type-checking Cryptol code. UX Issues related to the user experience (e.g., improved error messages)

Comments

@yav
Copy link
Member

yav commented Feb 9, 2023

This example is in the context of cryptol-specs (6c6f91e2a9e7f4a9f95d016db0784f875df12ddc)

shell> cryptol ./Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻  
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃  
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 2.13.0.99 (c0ff727)
https://cryptol.net  :? for help

Loading module Cryptol
Loading module Common::utils
Loading module Primitive::Keyless::Hash::SHA1
Loading module `where` argument of Primitive::Asymmetric::Signature::DSA::p1024_sha1
Loading module Common::bv
Loading module Common::mod_arith
Loading interface module `parameter` interface of Primitive::Asymmetric::Signature::DSA::DSA
Loading module Primitive::Asymmetric::Signature::DSA::DSA
Loading module Primitive::Asymmetric::Signature::DSA::p1024_sha1
[error] at Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry:1:8--1:57:
  • Unsolvable constraint:
      1024 == 2048
        arising from
        module instantiation
        at Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry:1:8--1:57
[error] at Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry:1:8--1:57:
  • Unsolvable constraint:
      160 == 224
        arising from
        module instantiation
        at Primitive/Asymmetric/Signature/DSA/p1024_sha1.cry:1:8--1:57

We should be able to give a more precise error, of what exactly we were doing when the error occurred (i.e., instantiating a particular parameter, or checking user specified constraints, etc).

@yav yav added typechecker Issues related to type-checking Cryptol code. parameterized modules Related to Cryptol's parameterized modules UX Issues related to the user experience (e.g., improved error messages) labels Feb 9, 2023
@yav yav closed this as completed Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameterized modules Related to Cryptol's parameterized modules typechecker Issues related to type-checking Cryptol code. UX Issues related to the user experience (e.g., improved error messages)
Projects
None yet
Development

No branches or pull requests

1 participant