Skip to content

Non-deterministic compare #70

@BrunoDutertre

Description

@BrunoDutertre

In run_code, the evaluation of compare uses pointer comparison.

This looks like undefined C/C++ behavior.

It also means that the semantics of compare is not well defined and
that running the same code is not deterministic. Results may depend
on how symbols are stored in memory.

Example:

(declare sort type)
(declare x sort)
(declare y sort)
(run (compare x y 1 0))

On my computer, the result is 0 in most cases, but once in a while, it's 1:

[Running-sc (compare x y 1 0)] = 
0
Proof checked successfully!

time = 115
sym count = 0
marked count = 0

[Running-sc (compare x y 1 0)] = 
1
Proof checked successfully!

time = 189
sym count = 0
marked count = 0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions