Skip to content

pNegNumeric panic with prime numeric constraint guard #2089

Description

@RyanGlScott

The following program causes the master branch of Cryptol (as of commit 6de5aa8) to panic:

f : {n} [n]
f | prime n => zero
  | fin n => zero
  | n == n => zero
$ cabal -v0 run exe:cryptol -- Bug.cry 
┏━╸┏━┓╻ ╻┏━┓╺┳╸┏━┓╻  
┃  ┣┳┛┗┳┛┣━┛ ┃ ┃ ┃┃  
┗━╸╹┗╸ ╹ ╹   ╹ ┗━┛┗━╸
version 3.5.0.99 (6de5aa8, modified)
https://cryptol.net  :? for help

Loading module Cryptol
Loading module Main
cryptol: You have encountered a bug in Cryptol's implementation.
*** Please create an issue at https://github.com/GaloisInc/cryptol/issues

%< --------------------------------------------------- 
  Revision:  6de5aa8cc28e4b5fed8438a41a3549ecbe857002
  Branch:    master (uncommited files present)
  Location:  pNegNumeric
  Message:   Unexpected numeric constraint:
             prime n`901
CallStack (from HasCallStack):
  panic, called at src/Cryptol/Utils/Panic.hs:21:9 in cryptol-3.5.0.99-inplace:Cryptol.Utils.Panic
  panic, called at src/Cryptol/TypeCheck/Type.hs:1018:9 in cryptol-3.5.0.99-inplace:Cryptol.TypeCheck.Type
%< --------------------------------------------------- 

Metadata

Metadata

Assignees

Labels

bugSomething not working correctly

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions