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 {
181181 /** Arithmetic right-shift over bitvectors (fill from left with value of first bit). */
182182 BV_ASHR ,
183183
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+
184202 /** Cast an unsigned bitvector to a floating-point number. */
185203 BV_UCASTTO_FP ,
186204
Original file line number Diff line number Diff line change @@ -305,8 +305,16 @@ private FunctionDeclarationKind getDeclarationKind(Term term) {
305305 return FunctionDeclarationKind .FP_CASTTO_UBV ;
306306 } else if (kind .equals (Kind .BV_XOR )) {
307307 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 ;
308316 }
309- throw new UnsupportedOperationException ( "Can not discern formula kind " + kind ) ;
317+ return FunctionDeclarationKind . OTHER ;
310318 }
311319
312320 @ SuppressWarnings ("unchecked" )
Original file line number Diff line number Diff line change @@ -458,6 +458,8 @@ private Expr normalize(Expr operator) {
458458 .put (Kind .BITVECTOR_SHL , FunctionDeclarationKind .BV_SHL )
459459 .put (Kind .BITVECTOR_ASHR , FunctionDeclarationKind .BV_ASHR )
460460 .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 )
461463 .put (Kind .BITVECTOR_NOT , FunctionDeclarationKind .BV_NOT )
462464 .put (Kind .BITVECTOR_NEG , FunctionDeclarationKind .BV_NEG )
463465 .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) {
578578 .put (Kind .BITVECTOR_SHL , FunctionDeclarationKind .BV_SHL )
579579 .put (Kind .BITVECTOR_ASHR , FunctionDeclarationKind .BV_ASHR )
580580 .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 )
581583 // Floating-point theory
582584 .put (Kind .TO_INTEGER , FunctionDeclarationKind .FLOOR )
583585 .put (Kind .TO_REAL , FunctionDeclarationKind .TO_REAL )
Original file line number Diff line number Diff line change 2323import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_NEG ;
2424import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_NOT ;
2525import 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 ;
2628import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SDIV ;
2729import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SEXT ;
2830import static org .sosy_lab .java_smt .solvers .mathsat5 .Mathsat5NativeApi .MSAT_TAG_BV_SLE ;
@@ -458,6 +460,10 @@ private FunctionDeclarationKind getDeclarationKind(long pF) {
458460 return FunctionDeclarationKind .BV_SIGN_EXTENSION ;
459461 case MSAT_TAG_BV_ZEXT :
460462 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 ;
461467
462468 case MSAT_TAG_FP_NEG :
463469 return FunctionDeclarationKind .FP_NEG ;
Original file line number Diff line number Diff line change @@ -707,6 +707,14 @@ private FunctionDeclarationKind getDeclarationKind(long f) {
707707 return FunctionDeclarationKind .BV_SIGN_EXTENSION ;
708708 case Z3_OP_ZERO_EXT :
709709 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 ;
710718
711719 case Z3_OP_FPA_NEG :
712720 return FunctionDeclarationKind .FP_NEG ;
You can’t perform that action at this time.
0 commit comments