Skip to content

Check_ExprEqvInContext Contradiction from the Assumptions #569

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

Open
SamirDroubi opened this issue Feb 2, 2024 · 0 comments
Open

Check_ExprEqvInContext Contradiction from the Assumptions #569

SamirDroubi opened this issue Feb 2, 2024 · 0 comments
Labels
C: Prog Analysis Related to formal analysis, SMT, etc. T: Bug Something isn't working

Comments

@SamirDroubi
Copy link
Collaborator

SamirDroubi commented Feb 2, 2024

def test_eliminate_dead_code8(golden):
    @proc
    def foo(n: size):
        a: f32
        for i in seq(n, n):
            if i < n:
                a = 1.0
    foo = eliminate_dead_code(foo, foo.find("if _ : _"))

This test generates the following query:

*******
*******
*******
assume  M(n > 0 ∧ (n ≤ i ∧ i < n) ∧ (n > 0 ∧ (n ≤ i ∧ i < n)))
to verify
i < n == True
(i_252 < n_250) == True
smtlib2
; benchmark generated from python API
(set-info :status unknown)
(declare-fun n_250 () Int)
(declare-fun i_252 () Int)
(assert
 (let (($x91 (and (< 0 n_250) (and (<= n_250 i_252) (< i_252 n_250)))))
 (and $x91 $x91)))
(assert
 (let (($x21 (< i_252 n_250)))
 (let (($x15 (= $x21 true)))
 (not $x15))))
(check-sat)


# sat = True

Which solves to true. However, we know from the assumptions that n <= i so i < n shouldn't be equal to True. There is a contradiction in the assumption itself. I am not sure if that's where the bug originates from?

This is what's currently outputted from the scheduling operation:

def foo(n: size):
    a: f32 @ DRAM
    for i in seq(n, n):
        a = 1.0

However, the output should be:

def foo(n: size):
    a: f32 @ DRAM
    for i in seq(n, n):
        pass
@SamirDroubi SamirDroubi added T: Bug Something isn't working C: Prog Analysis Related to formal analysis, SMT, etc. labels Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Prog Analysis Related to formal analysis, SMT, etc. T: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant