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

Counterexample doesn't make sense #207

Closed
tommy11jo opened this issue Apr 14, 2023 · 3 comments
Closed

Counterexample doesn't make sense #207

tommy11jo opened this issue Apr 14, 2023 · 3 comments

Comments

@tommy11jo
Copy link

My counterexample should show values of 1000 but instead it shows values of 0. Am I missing something?

module main {
    var test1 : bv64;
    var test2 : bv64;
    procedure adder(x: bv64, y: bv64) returns (z: bv64) {
        // CASE 1
        z = 1000bv64;
        // CASE 2
        // z = x + y;

    }
    procedure test_assertions() {
    } 
    init {
        test1 = 1000bv64;
        test2 = 1000bv64;
        // call (test1) = adder(1bv64, 2bv64);
        // call (test2) = adder(1bv64, 3bv64);
        assert (test1 == 3bv64);
        assert (test2 == 4bv64);
        // call test_assertions();
    }
    
    next {
        
    }
    
    control {
        f = bmc(2);
        check;
        f.print_cex();
        print_results;
    }
}

Output:

root@c60cbb3d330c:/c3-docker/play# uclid simple.ucl
Successfully parsed 1 and instantiated 1 module(s).
CEX for f [Step #0] assertion @ simple.ucl, line 18
=================================
Step #0
  test1 : 0
  test2 : 0
=================================
CEX for f [Step #0] assertion @ simple.ucl, line 19
=================================
Step #0
  test1 : 0
  test2 : 0
=================================
0 assertions passed.
2 assertions failed.
0 assertions indeterminate.
  FAILED -> f [Step #0] assertion @ simple.ucl, line 18
  FAILED -> f [Step #0] assertion @ simple.ucl, line 19
Finished execution for module: main.
@polgreen
Copy link
Contributor

Yes, looks like a bug with the counterexample printing (the underlying SMT query is correct).

@adwait @lichye would you mind looking into this, please?

@lichye
Copy link
Contributor

lichye commented Apr 15, 2023

Thank you tom11my, it looks like a bug in print of counterexample for handling assert. We will look into this part of code and fix it up.

@polgreen
Copy link
Contributor

Now fixed

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

3 participants