|
12 | 12 | import static scala.collection.JavaConverters.collectionAsScalaIterableConverter; |
13 | 13 |
|
14 | 14 | import ap.api.SimpleAPI; |
| 15 | +import ap.basetypes.IdealInt; |
15 | 16 | import ap.parameters.GlobalSettings; |
16 | 17 | import ap.parser.BooleanCompactifier; |
17 | 18 | import ap.parser.Environment.EnvironmentException; |
|
22 | 23 | import ap.parser.IFunApp; |
23 | 24 | import ap.parser.IFunction; |
24 | 25 | import ap.parser.IIntFormula; |
| 26 | +import ap.parser.IIntLit; |
25 | 27 | import ap.parser.IIntRelation; |
26 | 28 | import ap.parser.IPlus; |
27 | 29 | import ap.parser.ITerm; |
@@ -590,6 +592,18 @@ static FormulaType<?> getFormulaType(IExpression pFormula) { |
590 | 592 | FormulaType<?> t1 = getFormulaType(plus.left()); |
591 | 593 | FormulaType<?> t2 = getFormulaType(plus.right()); |
592 | 594 | return mergeFormulaTypes(t1, t2); |
| 595 | + } else if (pFormula instanceof IFunApp |
| 596 | + && ((IFunApp) pFormula).fun().equals(ModuloArithmetic.bv_extract())) { |
| 597 | + IIntLit upper = (IIntLit) pFormula.apply(0); |
| 598 | + IIntLit lower = (IIntLit) pFormula.apply(1); |
| 599 | + IdealInt bwResult = upper.value().$minus(lower.value()); |
| 600 | + return FormulaType.getBitvectorTypeWithSize(bwResult.intValue()); |
| 601 | + } else if (pFormula instanceof IFunApp |
| 602 | + && ((IFunApp) pFormula).fun().equals(ModuloArithmetic.bv_concat())) { |
| 603 | + IIntLit upper = (IIntLit) pFormula.apply(0); |
| 604 | + IIntLit lower = (IIntLit) pFormula.apply(1); |
| 605 | + IdealInt bwResult = upper.value().$plus(lower.value()); |
| 606 | + return FormulaType.getBitvectorTypeWithSize(bwResult.intValue()); |
593 | 607 | } else { |
594 | 608 | final Sort sort = Sort$.MODULE$.sortOf((ITerm) pFormula); |
595 | 609 | try { |
|
0 commit comments