kenmcmil / ivy

IVy is a research tool intended to allow interactive development of protocols and their proofs of correctness and to provide a platform for developing and experimenting with automated proof techniques. In particular, IVy provides interactive visualization of automated proofs, and supports a use model in which the human protocol designer and the automated tool interact to expose errors and prove correctness.
Other
77 stars 24 forks source link

curiosity lowering boolean variable in definition #31

Open graydon opened 2 years ago

graydon commented 2 years ago

Here is a reduced testcase that fails ivy_check:

#lang ivy1.7
object foobar = {
    relation foo(BAR:bool)
    definition foo(BAR:bool) = true
    invariant forall BAR. foo(BAR)
} 

ivy_check crashes with an assert False after emitting bad fmla: Var('BAR', BooleanSort()) inside formula_to_z3_int. It doesn't seem to like the BAR variable inside the definition of foo.

This version (with bar:bool in the definition) works:

#lang ivy1.7
object foobar = {
    relation foo(BAR:bool)
    definition foo(bar:bool) = true
    invariant forall BAR. foo(BAR)
} 

As does this version (with a 2-element non-bool type):

#lang ivy1.7
type booly = {truey, falsey}
object foobar = {
    relation foo(BAR:booly)
    definition foo(BAR:booly) = true
    invariant forall BAR. foo(BAR)
}