File tree Expand file tree Collapse file tree 6 files changed +45
-1
lines changed
src/org/sosy_lab/java_smt Expand file tree Collapse file tree 6 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,24 @@ public enum FunctionDeclarationKind {
181
181
/** Arithmetic right-shift over bitvectors (fill from left with value of first bit). */
182
182
BV_ASHR ,
183
183
184
+ /** Performs a circular left rotation on the bitvector. */
185
+ BV_ROTATE_LEFT ,
186
+
187
+ /** Performs a circular right rotation on the bitvector. */
188
+ BV_ROTATE_RIGHT ,
189
+
190
+ /**
191
+ * Performs a circular left rotation on the bitvector by a specified number of positions,
192
+ * determined by an integer value.
193
+ */
194
+ BV_ROTATE_LEFT_BY_INT ,
195
+
196
+ /**
197
+ * Performs a circular right rotation on the bitvector by a specified number of positions,
198
+ * determined by an integer value.
199
+ */
200
+ BV_ROTATE_RIGHT_BY_INT ,
201
+
184
202
/** Cast an unsigned bitvector to a floating-point number. */
185
203
BV_UCASTTO_FP ,
186
204
Original file line number Diff line number Diff line change @@ -305,8 +305,16 @@ private FunctionDeclarationKind getDeclarationKind(Term term) {
305
305
return FunctionDeclarationKind .FP_CASTTO_UBV ;
306
306
} else if (kind .equals (Kind .BV_XOR )) {
307
307
return FunctionDeclarationKind .BV_XOR ;
308
+ } else if (kind .equals (Kind .BV_ROL )) {
309
+ return FunctionDeclarationKind .BV_ROTATE_LEFT ;
310
+ } else if (kind .equals (Kind .BV_ROR )) {
311
+ return FunctionDeclarationKind .BV_ROTATE_RIGHT ;
312
+ } else if (kind .equals (Kind .BV_ROLI )) {
313
+ return FunctionDeclarationKind .BV_ROTATE_LEFT_BY_INT ;
314
+ } else if (kind .equals (Kind .BV_RORI )) {
315
+ return FunctionDeclarationKind .BV_ROTATE_RIGHT_BY_INT ;
308
316
}
309
- throw new UnsupportedOperationException ( "Can not discern formula kind " + kind ) ;
317
+ return FunctionDeclarationKind . OTHER ;
310
318
}
311
319
312
320
@ SuppressWarnings ("unchecked" )
Original file line number Diff line number Diff line change @@ -458,6 +458,8 @@ private Expr normalize(Expr operator) {
458
458
.put (Kind .BITVECTOR_SHL , FunctionDeclarationKind .BV_SHL )
459
459
.put (Kind .BITVECTOR_ASHR , FunctionDeclarationKind .BV_ASHR )
460
460
.put (Kind .BITVECTOR_LSHR , FunctionDeclarationKind .BV_LSHR )
461
+ .put (Kind .BITVECTOR_ROTATE_LEFT , FunctionDeclarationKind .BV_ROTATE_LEFT_BY_INT )
462
+ .put (Kind .BITVECTOR_ROTATE_RIGHT , FunctionDeclarationKind .BV_ROTATE_RIGHT_BY_INT )
461
463
.put (Kind .BITVECTOR_NOT , FunctionDeclarationKind .BV_NOT )
462
464
.put (Kind .BITVECTOR_NEG , FunctionDeclarationKind .BV_NEG )
463
465
.put (Kind .BITVECTOR_EXTRACT , FunctionDeclarationKind .BV_EXTRACT )
Original file line number Diff line number Diff line change @@ -578,6 +578,8 @@ private Term normalize(Term operator) {
578
578
.put (Kind .BITVECTOR_SHL , FunctionDeclarationKind .BV_SHL )
579
579
.put (Kind .BITVECTOR_ASHR , FunctionDeclarationKind .BV_ASHR )
580
580
.put (Kind .BITVECTOR_LSHR , FunctionDeclarationKind .BV_LSHR )
581
+ .put (Kind .BITVECTOR_ROTATE_LEFT , FunctionDeclarationKind .BV_ROTATE_LEFT_BY_INT )
582
+ .put (Kind .BITVECTOR_ROTATE_RIGHT , FunctionDeclarationKind .BV_ROTATE_RIGHT_BY_INT )
581
583
// Floating-point theory
582
584
.put (Kind .TO_INTEGER , FunctionDeclarationKind .FLOOR )
583
585
.put (Kind .TO_REAL , FunctionDeclarationKind .TO_REAL )
Original file line number Diff line number Diff line change 23
23
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_NEG ;
24
24
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_NOT ;
25
25
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_OR ;
26
+ import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_ROL ;
27
+ import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_ROR ;
26
28
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SDIV ;
27
29
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SEXT ;
28
30
import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SLE ;
@@ -458,6 +460,10 @@ private FunctionDeclarationKind getDeclarationKind(long pF) {
458
460
return FunctionDeclarationKind .BV_SIGN_EXTENSION ;
459
461
case MSAT_TAG_BV_ZEXT :
460
462
return FunctionDeclarationKind .BV_ZERO_EXTENSION ;
463
+ case MSAT_TAG_BV_ROL :
464
+ return FunctionDeclarationKind .BV_ROTATE_LEFT_BY_INT ;
465
+ case MSAT_TAG_BV_ROR :
466
+ return FunctionDeclarationKind .BV_ROTATE_RIGHT_BY_INT ;
461
467
462
468
case MSAT_TAG_FP_NEG :
463
469
return FunctionDeclarationKind .FP_NEG ;
Original file line number Diff line number Diff line change @@ -707,6 +707,14 @@ private FunctionDeclarationKind getDeclarationKind(long f) {
707
707
return FunctionDeclarationKind .BV_SIGN_EXTENSION ;
708
708
case Z3_OP_ZERO_EXT :
709
709
return FunctionDeclarationKind .BV_ZERO_EXTENSION ;
710
+ case Z3_OP_ROTATE_LEFT :
711
+ return FunctionDeclarationKind .BV_ROTATE_LEFT_BY_INT ;
712
+ case Z3_OP_ROTATE_RIGHT :
713
+ return FunctionDeclarationKind .BV_ROTATE_RIGHT_BY_INT ;
714
+ case Z3_OP_EXT_ROTATE_LEFT :
715
+ return FunctionDeclarationKind .BV_ROTATE_LEFT ;
716
+ case Z3_OP_EXT_ROTATE_RIGHT :
717
+ return FunctionDeclarationKind .BV_ROTATE_RIGHT ;
710
718
711
719
case Z3_OP_FPA_NEG :
712
720
return FunctionDeclarationKind .FP_NEG ;
You can’t perform that action at this time.
0 commit comments