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

Can't infer Arith ([inf]a) from Arith a #596

Closed
brianhuffman opened this issue May 24, 2019 · 1 comment
Closed

Can't infer Arith ([inf]a) from Arith a #596

brianhuffman opened this issue May 24, 2019 · 1 comment

Comments

@brianhuffman
Copy link
Contributor

When loading the following file

foo : {a} (Arith a) => [inf]a -> [inf]a -> [inf]a
foo x y = x + y

I get the following error message:

Loading module Main
[error] at ./arithinf.cry:2:1--2:16:
  Failed to validate user-specified signature.
    in the definition of 'Main::foo', at ./arithinf.cry:2:1--2:4,
    we need to show that
      for any type a
      assuming
        • Arith a
      the following constraints hold:
        • Arith ([inf]a)
            arising from
            use of expression (Cryptol::+)
            at ./arithinf.cry:2:11--2:16

I would expect Cryptol to be able to infer Arith ([inf]a) from Arith a.

@yav yav closed this as completed in 4ce64e9 May 28, 2019
@yav
Copy link
Member

yav commented May 28, 2019

Interesting---currently we are not reducing this because we are waiting to see if a might be bit or not. However, if we know that the sequence length is inf we could reduce to Arith a as we know that in that case the Word-based operations would not apply. I just made the change.

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

No branches or pull requests

2 participants