Alloy integer comparison semantics using "Forbid Overflow: Yes" -
i have following alloy module , run command:
sig { x : set } run {all a: a| #a.x<3 , #a.x>1} 2 a, 2 int
with "forbid overflow: no" alloy analyzer 4.2 (build date: 2012-09-25) not find instance. believe reason due overflow of constant 3
run predicate reads {all a: a| #a.x<-1 , #a.x>1}
.
with "forbid overflow: yes" alloy analyzer finds instance.
---instance--- integers={-2, -1, 0, 1} univ={-1, -2, 0, 1, a$0, a$1} int={-1, -2, 0, 1} seq/int={0} string={} none={} this/a={a$0, a$1} this/a<:x={a$0->a$0, a$0->a$1, a$1->a$0, a$1->a$1}
the alloy evaluator tells me predicate {all a: a| #a.x<3 , #a.x>1}
used in run command evaluates false
.
could please explain behavior? there difference in sematics of integer comparisons in evaluator , analyzer?
edit: noticed behavior different in latest experimental version: alloy 4.2_2014-03-07. not find instance. behavior expected.
you provided right answers in question, can reiterate them
- the expected behavior (no instance) "correct" behavior model;
- version 4.2 has known bugs regarding handling overflows, that's reason finds instance (those should fixed in latest version, hence correct behavior model);
- under "wraparound" semantics of integers (overflow detection turned off), there still no instance, reason described (-3 being treated -1);
- the evaluator still has issues (even in latest version), use wraparound semantics.
Comments
Post a Comment