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

bug, in splitAtV? #140

Closed
msaaltink opened this issue Nov 11, 2014 · 2 comments
Closed

bug, in splitAtV? #140

msaaltink opened this issue Nov 11, 2014 · 2 comments
Labels
bug Something not working correctly typechecker Issues related to type-checking Cryptol code.
Milestone

Comments

@msaaltink
Copy link
Contributor

With this pointless definition

bar: {a, b} [a+b] -> [a] -> [b]
bar x y = take x

we can trigger a bug:

Main> bar (zero:[inf]) 0xf
cryptol: You have encountered a bug in Cryptol's implementation.
%< --------------------------------------------------- 
  Revision:  0352dca57a32ef79a0575c97047a405b99d49c84
  Branch:    master (non-committed files present during build)
  Location:  [Eval] splitAtV
  Message:   invalid `front` len
%< --------------------------------------------------- 
@weaversa
Copy link
Collaborator

You're a man after my own heart!

@brianhuffman
Copy link
Contributor

This definition of bar should cause a type error. The type of take is

take : {front, back, elem} (fin front) => [front + back]elem -> [front]elem

so the type of bar should be required to have a fin b constraint:

bar : {a, b} fin b => [a+b] -> [a] -> [b]

I suspect this is related to #58.

@kiniry kiniry added typechecker Issues related to type-checking Cryptol code. bug Something not working correctly labels Dec 3, 2014
@kiniry kiniry added this to the Someday milestone Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something not working correctly typechecker Issues related to type-checking Cryptol code.
Projects
None yet
Development

No branches or pull requests

4 participants