-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpr.java
More file actions
1806 lines (1618 loc) · 52.5 KB
/
Expr.java
File metadata and controls
1806 lines (1618 loc) · 52.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* This file was automatically generated from Expr.cs
* w/ further modifications by:
* @author Christoph M. Wintersteiger (cwinter)
**/
package com.microsoft.z3;
import com.microsoft.z3.enumerations.Z3_ast_kind;
import com.microsoft.z3.enumerations.Z3_decl_kind;
import com.microsoft.z3.enumerations.Z3_lbool;
import com.microsoft.z3.enumerations.Z3_sort_kind;
/* using System; */
/**
* Expressions are terms.
**/
public class Expr extends AST
{
/**
* Returns a simplified version of the expression
**/
public Expr simplify() throws Z3Exception
{
return simplify(null);
}
/**
* Returns a simplified version of the expression
* A set of
* parameters <param name="p" /> to configure the simplifier
* <seealso cref="Context.SimplifyHelp"/>
**/
public Expr simplify(Params p) throws Z3Exception
{
if (p == null)
return Expr.create(getContext(),
Native.simplify(getContext().nCtx(), getNativeObject()));
else
return Expr.create(
getContext(),
Native.simplifyEx(getContext().nCtx(), getNativeObject(),
p.getNativeObject()));
}
/**
* The function declaration of the function that is applied in this
* expression.
**/
public FuncDecl getFuncDecl() throws Z3Exception
{
return new FuncDecl(getContext(), Native.getAppDecl(getContext().nCtx(),
getNativeObject()));
}
/**
* Indicates whether the expression is the true or false expression or
* something else (Z3_L_UNDEF).
**/
public Z3_lbool getBoolValue() throws Z3Exception
{
return Z3_lbool.fromInt(Native.getBoolValue(getContext().nCtx(),
getNativeObject()));
}
/**
* The number of arguments of the expression.
**/
public int getNumArgs() throws Z3Exception
{
return Native.getAppNumArgs(getContext().nCtx(), getNativeObject());
}
/**
* The arguments of the expression.
**/
public Expr[] getArgs() throws Z3Exception
{
int n = getNumArgs();
Expr[] res = new Expr[n];
for (int i = 0; i < n; i++)
res[i] = Expr.create(getContext(),
Native.getAppArg(getContext().nCtx(), getNativeObject(), i));
return res;
}
/**
* Update the arguments of the expression using the arguments <paramref
* name="args"/> The number of new arguments should coincide with the
* current number of arguments.
**/
public void update(Expr[] args) throws Z3Exception
{
getContext().checkContextMatch(args);
if (args.length != getNumArgs())
throw new Z3Exception("Number of arguments does not match");
setNativeObject(Native.updateTerm(getContext().nCtx(), getNativeObject(),
(int) args.length, Expr.arrayToNative(args)));
}
/**
* Substitute every occurrence of <code>from[i]</code> in the expression
* with <code>to[i]</code>, for <code>i</code> smaller than
* <code>num_exprs</code>. <remarks> The result is the new expression. The
* arrays <code>from</code> and <code>to</code> must have size
* <code>num_exprs</code>. For every <code>i</code> smaller than
* <code>num_exprs</code>, we must have that sort of <code>from[i]</code>
* must be equal to sort of <code>to[i]</code>. </remarks>
**/
public Expr substitute(Expr[] from, Expr[] to) throws Z3Exception
{
getContext().checkContextMatch(from);
getContext().checkContextMatch(to);
if (from.length != to.length)
throw new Z3Exception("Argument sizes do not match");
return Expr.create(getContext(), Native.substitute(getContext().nCtx(),
getNativeObject(), (int) from.length, Expr.arrayToNative(from),
Expr.arrayToNative(to)));
}
/**
* Substitute every occurrence of <code>from</code> in the expression with
* <code>to</code>. <seealso cref="Substitute(Expr[],Expr[])"/>
**/
public Expr substitute(Expr from, Expr to) throws Z3Exception
{
return substitute(new Expr[] { from }, new Expr[] { to });
}
/**
* Substitute the free variables in the expression with the expressions in
* <paramref name="to"/> <remarks> For every <code>i</code> smaller than
* <code>num_exprs</code>, the variable with de-Bruijn index <code>i</code>
* is replaced with term <code>to[i]</code>. </remarks>
**/
public Expr substituteVars(Expr[] to) throws Z3Exception
{
getContext().checkContextMatch(to);
return Expr.create(getContext(), Native.substituteVars(getContext().nCtx(),
getNativeObject(), (int) to.length, Expr.arrayToNative(to)));
}
/**
* Translates (copies) the term to the Context <paramref name="ctx"/>.
* <param name="ctx">A context</param>
*
* @return A copy of the term which is associated with <paramref
* name="ctx"/>
**/
public Expr translate(Context ctx) throws Z3Exception
{
if (getContext() == ctx)
return this;
else
return Expr.create(
ctx,
Native.translate(getContext().nCtx(), getNativeObject(),
ctx.nCtx()));
}
/**
* Returns a string representation of the expression.
**/
public String toString()
{
return super.toString();
}
/**
* Indicates whether the term is a numeral
**/
public boolean isNumeral() throws Z3Exception
{
return Native.isNumeralAst(getContext().nCtx(), getNativeObject());
}
/**
* Indicates whether the term is well-sorted.
*
* @return True if the term is well-sorted, false otherwise.
**/
public boolean isWellSorted() throws Z3Exception
{
return Native.isWellSorted(getContext().nCtx(), getNativeObject());
}
/**
* The Sort of the term.
**/
public Sort getSort() throws Z3Exception
{
return Sort.create(getContext(),
Native.getSort(getContext().nCtx(), getNativeObject()));
}
/**
* Indicates whether the term represents a constant.
**/
public boolean isConst() throws Z3Exception
{
return isApp() && getNumArgs() == 0 && getFuncDecl().getDomainSize() == 0;
}
/**
* Indicates whether the term is an integer numeral.
**/
public boolean isIntNum() throws Z3Exception
{
return isNumeral() && isInt();
}
/**
* Indicates whether the term is a real numeral.
**/
public boolean isRatNum() throws Z3Exception
{
return isNumeral() && isReal();
}
/**
* Indicates whether the term is an algebraic number
**/
public boolean isAlgebraicNumber() throws Z3Exception
{
return Native.isAlgebraicNumber(getContext().nCtx(), getNativeObject());
}
/**
* Indicates whether the term has Boolean sort.
**/
public boolean isBool() throws Z3Exception
{
return (isExpr() && Native.isEqSort(getContext().nCtx(),
Native.mkBoolSort(getContext().nCtx()),
Native.getSort(getContext().nCtx(), getNativeObject())));
}
/**
* Indicates whether the term is the constant true.
**/
public boolean isTrue() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TRUE;
}
/**
* Indicates whether the term is the constant false.
**/
public boolean isFalse() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_FALSE;
}
/**
* Indicates whether the term is an equality predicate.
**/
public boolean isEq() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EQ;
}
/**
* Indicates whether the term is an n-ary distinct predicate (every argument
* is mutually distinct).
**/
public boolean isDistinct() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_DISTINCT;
}
/**
* Indicates whether the term is a ternary if-then-else term
**/
public boolean isITE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ITE;
}
/**
* Indicates whether the term is an n-ary conjunction
**/
public boolean isAnd() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_AND;
}
/**
* Indicates whether the term is an n-ary disjunction
**/
public boolean isOr() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_OR;
}
/**
* Indicates whether the term is an if-and-only-if (Boolean equivalence,
* binary)
**/
public boolean isIff() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IFF;
}
/**
* Indicates whether the term is an exclusive or
**/
public boolean isXor() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_XOR;
}
/**
* Indicates whether the term is a negation
**/
public boolean isNot() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_NOT;
}
/**
* Indicates whether the term is an implication
**/
public boolean isImplies() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IMPLIES;
}
/**
* Indicates whether the term is of integer sort.
**/
public boolean isInt() throws Z3Exception
{
return (Native.isNumeralAst(getContext().nCtx(), getNativeObject()) && Native
.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_INT_SORT
.toInt());
}
/**
* Indicates whether the term is of sort real.
**/
public boolean isReal() throws Z3Exception
{
return Native.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_REAL_SORT
.toInt();
}
/**
* Indicates whether the term is an arithmetic numeral.
**/
public boolean isArithmeticNumeral() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ANUM;
}
/**
* Indicates whether the term is a less-than-or-equal
**/
public boolean isLE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LE;
}
/**
* Indicates whether the term is a greater-than-or-equal
**/
public boolean isGE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_GE;
}
/**
* Indicates whether the term is a less-than
**/
public boolean isLT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_LT;
}
/**
* Indicates whether the term is a greater-than
**/
public boolean isGT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_GT;
}
/**
* Indicates whether the term is addition (binary)
**/
public boolean isAdd() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ADD;
}
/**
* Indicates whether the term is subtraction (binary)
**/
public boolean isSub() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SUB;
}
/**
* Indicates whether the term is a unary minus
**/
public boolean isUMinus() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UMINUS;
}
/**
* Indicates whether the term is multiplication (binary)
**/
public boolean isMul() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_MUL;
}
/**
* Indicates whether the term is division (binary)
**/
public boolean isDiv() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_DIV;
}
/**
* Indicates whether the term is integer division (binary)
**/
public boolean isIDiv() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IDIV;
}
/**
* Indicates whether the term is remainder (binary)
**/
public boolean isRemainder() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_REM;
}
/**
* Indicates whether the term is modulus (binary)
**/
public boolean isModulus() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_MOD;
}
/**
* Indicates whether the term is a coercion of integer to real (unary)
**/
public boolean isIntToReal() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TO_REAL;
}
/**
* Indicates whether the term is a coercion of real to integer (unary)
**/
public boolean isRealToInt() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_TO_INT;
}
/**
* Indicates whether the term is a check that tests whether a real is
* integral (unary)
**/
public boolean isRealIsInt() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_IS_INT;
}
/**
* Indicates whether the term is of an array sort.
**/
public boolean isArray() throws Z3Exception
{
return (Native.isApp(getContext().nCtx(), getNativeObject()) && Z3_sort_kind
.fromInt(Native.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject()))) == Z3_sort_kind.Z3_ARRAY_SORT);
}
/**
* Indicates whether the term is an array store. <remarks>It satisfies
* select(store(a,i,v),j) = if i = j then v else select(a,j). Array store
* takes at least 3 arguments. </remarks>
**/
public boolean isStore() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_STORE;
}
/**
* Indicates whether the term is an array select.
**/
public boolean isSelect() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SELECT;
}
/**
* Indicates whether the term is a constant array. <remarks>For example,
* select(const(v),i) = v holds for every v and i. The function is
* unary.</remarks>
**/
public boolean isConstantArray() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_CONST_ARRAY;
}
/**
* Indicates whether the term is a default array. <remarks>For example
* default(const(v)) = v. The function is unary.</remarks>
**/
public boolean isDefaultArray() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ARRAY_DEFAULT;
}
/**
* Indicates whether the term is an array map. <remarks>It satisfies
* map[f](a1,..,a_n)[i] = f(a1[i],...,a_n[i]) for every i.</remarks>
**/
public boolean isArrayMap() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ARRAY_MAP;
}
/**
* Indicates whether the term is an as-array term. <remarks>An as-array term
* is n array value that behaves as the function graph of the function
* passed as parameter.</remarks>
**/
public boolean isAsArray() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_AS_ARRAY;
}
/**
* Indicates whether the term is set union
**/
public boolean isSetUnion() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_UNION;
}
/**
* Indicates whether the term is set intersection
**/
public boolean isSetIntersect() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_INTERSECT;
}
/**
* Indicates whether the term is set difference
**/
public boolean isSetDifference() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_DIFFERENCE;
}
/**
* Indicates whether the term is set complement
**/
public boolean isSetComplement() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_COMPLEMENT;
}
/**
* Indicates whether the term is set subset
**/
public boolean isSetSubset() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SET_SUBSET;
}
/**
* Indicates whether the terms is of bit-vector sort.
**/
public boolean isBV() throws Z3Exception
{
return Native.getSortKind(getContext().nCtx(),
Native.getSort(getContext().nCtx(), getNativeObject())) == Z3_sort_kind.Z3_BV_SORT
.toInt();
}
/**
* Indicates whether the term is a bit-vector numeral
**/
public boolean isBVNumeral() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNUM;
}
/**
* Indicates whether the term is a one-bit bit-vector with value one
**/
public boolean isBVBitOne() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BIT1;
}
/**
* Indicates whether the term is a one-bit bit-vector with value zero
**/
public boolean isBVBitZero() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BIT0;
}
/**
* Indicates whether the term is a bit-vector unary minus
**/
public boolean isBVUMinus() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNEG;
}
/**
* Indicates whether the term is a bit-vector addition (binary)
**/
public boolean isBVAdd() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BADD;
}
/**
* Indicates whether the term is a bit-vector subtraction (binary)
**/
public boolean isBVSub() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSUB;
}
/**
* Indicates whether the term is a bit-vector multiplication (binary)
**/
public boolean isBVMul() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BMUL;
}
/**
* Indicates whether the term is a bit-vector signed division (binary)
**/
public boolean isBVSDiv() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSDIV;
}
/**
* Indicates whether the term is a bit-vector unsigned division (binary)
**/
public boolean isBVUDiv() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUDIV;
}
/**
* Indicates whether the term is a bit-vector signed remainder (binary)
**/
public boolean isBVSRem() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSREM;
}
/**
* Indicates whether the term is a bit-vector unsigned remainder (binary)
**/
public boolean isBVURem() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUREM;
}
/**
* Indicates whether the term is a bit-vector signed modulus
**/
public boolean isBVSMod() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSMOD;
}
/**
* Indicates whether the term is a bit-vector signed division by zero
**/
boolean IsBVSDiv0() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSDIV0;
}
/**
* Indicates whether the term is a bit-vector unsigned division by zero
**/
boolean IsBVUDiv0() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUDIV0;
}
/**
* Indicates whether the term is a bit-vector signed remainder by zero
**/
boolean IsBVSRem0() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSREM0;
}
/**
* Indicates whether the term is a bit-vector unsigned remainder by zero
**/
boolean IsBVURem0() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BUREM0;
}
/**
* Indicates whether the term is a bit-vector signed modulus by zero
**/
boolean IsBVSMod0() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSMOD0;
}
/**
* Indicates whether the term is an unsigned bit-vector less-than-or-equal
**/
public boolean isBVULE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ULEQ;
}
/**
* Indicates whether the term is a signed bit-vector less-than-or-equal
**/
public boolean isBVSLE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SLEQ;
}
/**
* Indicates whether the term is an unsigned bit-vector
* greater-than-or-equal
**/
public boolean isBVUGE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UGEQ;
}
/**
* Indicates whether the term is a signed bit-vector greater-than-or-equal
**/
public boolean isBVSGE() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SGEQ;
}
/**
* Indicates whether the term is an unsigned bit-vector less-than
**/
public boolean isBVULT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ULT;
}
/**
* Indicates whether the term is a signed bit-vector less-than
**/
public boolean isBVSLT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SLT;
}
/**
* Indicates whether the term is an unsigned bit-vector greater-than
**/
public boolean isBVUGT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_UGT;
}
/**
* Indicates whether the term is a signed bit-vector greater-than
**/
public boolean isBVSGT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SGT;
}
/**
* Indicates whether the term is a bit-wise AND
**/
public boolean isBVAND() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BAND;
}
/**
* Indicates whether the term is a bit-wise OR
**/
public boolean isBVOR() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BOR;
}
/**
* Indicates whether the term is a bit-wise NOT
**/
public boolean isBVNOT() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNOT;
}
/**
* Indicates whether the term is a bit-wise XOR
**/
public boolean isBVXOR() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BXOR;
}
/**
* Indicates whether the term is a bit-wise NAND
**/
public boolean isBVNAND() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNAND;
}
/**
* Indicates whether the term is a bit-wise NOR
**/
public boolean isBVNOR() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BNOR;
}
/**
* Indicates whether the term is a bit-wise XNOR
**/
public boolean isBVXNOR() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BXNOR;
}
/**
* Indicates whether the term is a bit-vector concatenation (binary)
**/
public boolean isBVConcat() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_CONCAT;
}
/**
* Indicates whether the term is a bit-vector sign extension
**/
public boolean isBVSignExtension() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_SIGN_EXT;
}
/**
* Indicates whether the term is a bit-vector zero extension
**/
public boolean isBVZeroExtension() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ZERO_EXT;
}
/**
* Indicates whether the term is a bit-vector extraction
**/
public boolean isBVExtract() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXTRACT;
}
/**
* Indicates whether the term is a bit-vector repetition
**/
public boolean isBVRepeat() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_REPEAT;
}
/**
* Indicates whether the term is a bit-vector reduce OR
**/
public boolean isBVReduceOR() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BREDOR;
}
/**
* Indicates whether the term is a bit-vector reduce AND
**/
public boolean isBVReduceAND() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BREDAND;
}
/**
* Indicates whether the term is a bit-vector comparison
**/
public boolean isBVComp() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BCOMP;
}
/**
* Indicates whether the term is a bit-vector shift left
**/
public boolean isBVShiftLeft() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BSHL;
}
/**
* Indicates whether the term is a bit-vector logical shift right
**/
public boolean isBVShiftRightLogical() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BLSHR;
}
/**
* Indicates whether the term is a bit-vector arithmetic shift left
**/
public boolean isBVShiftRightArithmetic() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BASHR;
}
/**
* Indicates whether the term is a bit-vector rotate left
**/
public boolean isBVRotateLeft() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ROTATE_LEFT;
}
/**
* Indicates whether the term is a bit-vector rotate right
**/
public boolean isBVRotateRight() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_ROTATE_RIGHT;
}
/**
* Indicates whether the term is a bit-vector rotate left (extended)
* <remarks>Similar to Z3_OP_ROTATE_LEFT, but it is a binary operator
* instead of a parametric one.</remarks>
**/
public boolean isBVRotateLeftExtended() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_LEFT;
}
/**
* Indicates whether the term is a bit-vector rotate right (extended)
* <remarks>Similar to Z3_OP_ROTATE_RIGHT, but it is a binary operator
* instead of a parametric one.</remarks>
**/
public boolean isBVRotateRightExtended() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_EXT_ROTATE_RIGHT;
}
/**
* Indicates whether the term is a coercion from integer to bit-vector
* <remarks>This function is not supported by the decision procedures. Only
* the most rudimentary simplification rules are applied to this
* function.</remarks>
**/
public boolean isIntToBV() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_INT2BV;
}
/**
* Indicates whether the term is a coercion from bit-vector to integer
* <remarks>This function is not supported by the decision procedures. Only
* the most rudimentary simplification rules are applied to this
* function.</remarks>
**/
public boolean isBVToInt() throws Z3Exception
{
return getFuncDecl().getDeclKind() == Z3_decl_kind.Z3_OP_BV2INT;
}