DFA: ignore ranges for float/double (was introduced during DfaFactType merge)

This commit is contained in:
Tagir Valeev
2017-05-18 10:52:52 +07:00
parent b60ae89a6c
commit af20bc97d0
2 changed files with 16 additions and 13 deletions
@@ -720,20 +720,17 @@ public class DfaMemoryStateImpl implements DfaMemoryState {
if (dfaLeft instanceof DfaUnknownValue || dfaRight instanceof DfaUnknownValue) return true;
RelationType relationType = dfaRelation.getRelation();
if (dfaLeft instanceof DfaVariableValue) {
LongRangeSet right = getValueFact(DfaFactType.RANGE, dfaRight);
if (right != null) {
if (!applyFact((DfaVariableValue)dfaLeft, DfaFactType.RANGE, right.fromRelation(relationType))) {
return false;
}
LongRangeSet left = getValueFact(DfaFactType.RANGE, dfaLeft);
LongRangeSet right = getValueFact(DfaFactType.RANGE, dfaRight);
if (left != null && right != null) {
if (dfaLeft instanceof DfaVariableValue &&
!applyFact((DfaVariableValue)dfaLeft, DfaFactType.RANGE, right.fromRelation(relationType))) {
return false;
}
}
if (dfaRight instanceof DfaVariableValue) {
LongRangeSet left = getValueFact(DfaFactType.RANGE, dfaLeft);
if (left != null) {
if (!applyFact((DfaVariableValue)dfaRight, DfaFactType.RANGE, left.fromRelation(relationType.getFlipped()))) {
return false;
}
if (dfaRight instanceof DfaVariableValue &&
!applyFact((DfaVariableValue)dfaRight, DfaFactType.RANGE, left.fromRelation(relationType.getFlipped()))) {
return false;
}
}
@@ -166,6 +166,12 @@ public class LongRangeBasics {
}
}
void testDouble(double d) {
if(d > 0 && d < 1) {
System.out.println("ok");
}
}
private int getState() {
return (int)(Math.random() * 100);
}