-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathRange.java.jpp
More file actions
799 lines (664 loc) · 22.9 KB
/
Range.java.jpp
File metadata and controls
799 lines (664 loc) · 22.9 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
#if 0
// Do not attempt to compile this file with a Java compiler such as javac.
// You first need to preprocess it with cpp, the C preprocessor.
// The correct way to build the system is to run 'make'.
#endif
#if defined(SCALAR)
#define RANGE RangeInt
#define SUPERCLASS SingleScalar
#define PRIMITIVE long
#define BASE_IS_TYPE baseIsIntegral()
#define ONEOF OneOfScalar
#define LOWER_BOUND LowerBound
#define UPPER_BOUND UpperBound
#elif defined(FLOAT)
#define RANGE RangeFloat
#define SUPERCLASS SingleFloat
#define PRIMITIVE double
#define BASE_IS_TYPE baseIsFloat()
#define ONEOF OneOfFloat
#define LOWER_BOUND LowerBoundFloat
#define UPPER_BOUND UpperBoundFloat
#elif defined(SCALARSEQ)
#define SEQ
#define RANGE EltRangeInt
#define SUPERCLASS SingleScalarSequence
#define PRIMITIVE long
#define BASE_IS_TYPE baseIsIntegral()
#define ONEOF EltOneOf
#define LOWER_BOUND EltLowerBound
#define UPPER_BOUND EltUpperBound
#elif defined(FLOATSEQ)
#define SEQ
#define RANGE EltRangeFloat
#define SUPERCLASS SingleFloatSequence
#define PRIMITIVE double
#define BASE_IS_TYPE baseIsFloat()
#define ONEOF EltOneOfFloat
#define LOWER_BOUND EltLowerBoundFloat
#define UPPER_BOUND EltUpperBoundFloat
#else
#error "TYPELONG, TYPEDOUBLE, TYPELONGSEQ, or TYPEDOUBLESEQ must be defined"
#endif
#if (defined(SEQ))
#define VAR1 x[]
#define VAR2 y[]
#define PACKAGE sequence
#define COMMENT_TXT corresponding elements of two PRIMITIVE sequences
#else
#define VAR1 x
#define VAR2 y
#define PACKAGE scalar
#define COMMENT_TXT two PRIMITIVE scalars
#endif
// ***** This file is automatically generated from Range.java.jpp
package daikon.inv.unary.PACKAGE;
import org.checkerframework.dataflow.qual.Pure;
import org.checkerframework.checker.lock.qual.GuardSatisfied;
import org.checkerframework.dataflow.qual.SideEffectFree;
import org.checkerframework.checker.interning.qual.Interned;
import org.checkerframework.checker.nullness.qual.Nullable;
import daikon.*;
import daikon.Quantify.QuantFlags;
import daikon.derive.unary.*;
import daikon.inv.*;
import daikon.inv.binary.sequenceScalar.*;
import daikon.inv.unary.sequence.*;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.plumelib.util.Intern;
import org.plumelib.util.UtilPlume;
import typequals.prototype.qual.NonPrototype;
import typequals.prototype.qual.Prototype;
/**
* Baseclass for unary range based invariants. Each invariant is a special stateless version of
* bound or oneof. For example EqualZero, BooleanVal, etc). These are never printed, but are used
* internally as suppressors for ni-suppressions.
*
* Each specific invariant is implemented in a subclass (typically in this file).
*/
public abstract class RANGE extends SUPERCLASS {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040311L;
protected RANGE(PptSlice ppt) {
super(ppt);
}
protected @Prototype RANGE() {
super();
}
/**
* Check that instantiation is ok. The type must be integral
* (not boolean or hash code).
*/
@Override
public boolean instantiate_ok(VarInfo[] vis) {
if (!valid_types(vis)) {
return false;
}
if (!vis[0].file_rep_type.BASE_IS_TYPE) {
return false;
}
return true;
}
/**
* Returns a string in the specified format that describes the invariant.
*
* The generic format string is obtained from the subclass specific get_format_str(). Instances of
* %var1% are replaced by the variable name in the specified format.
*/
@SideEffectFree
@Override
public String format_using(@GuardSatisfied RANGE this, OutputFormat format) {
String fmt_str = get_format_str(format);
VarInfo var1 = ppt.var_infos[0];
String v1 = null;
#if defined(SEQ)
if (format == OutputFormat.ESCJAVA) {
String[] form = VarInfo.esc_quantify(var1);
fmt_str = form[0] + "(" + fmt_str + ")" + form[2];
v1 = form[1];
} else if (format == OutputFormat.SIMPLIFY) {
String[] form = VarInfo.simplify_quantify(QuantFlags.element_wise(),
var1);
fmt_str = form[0] + " " + fmt_str + " " + form[2];
v1 = form[1];
} else if (format == OutputFormat.DAIKON) {
fmt_str += " (elementwise)";
}
#endif
if (v1 == null) {
v1 = var1.name_using(format);
}
fmt_str = fmt_str.replace("%var1%", v1);
return fmt_str;
}
#if defined(SEQ)
@Override
public InvariantStatus check_modified(PRIMITIVE @Interned [] x, int count) {
for (int i = 0; i < x.length; i++) {
if (!eq_check(x[i])) {
return InvariantStatus.FALSIFIED;
}
}
return InvariantStatus.NO_CHANGE;
}
@Override
public InvariantStatus add_modified(PRIMITIVE @Interned [] x, int count) {
return check_modified(x, count);
}
#else
@Override
public InvariantStatus check_modified(PRIMITIVE x, int count) {
if (eq_check(x)) {
return InvariantStatus.NO_CHANGE;
} else {
return InvariantStatus.FALSIFIED;
}
}
@Override
public InvariantStatus add_modified(PRIMITIVE x, int count) {
return check_modified(x, count);
}
#endif
@Override
protected double computeConfidence() {
if (ppt.num_samples() == 0) {
return CONFIDENCE_UNJUSTIFIED;
}
return CONFIDENCE_JUSTIFIED;
}
@Pure
@Override
public boolean isSameFormula(Invariant other) {
assert other.getClass() == getClass();
return true;
}
@Pure
@Override
public boolean isExclusiveFormula(Invariant other) {
return false;
}
/**
* All range invariants except Even and PowerOfTwo are obvious since they represented by some
* version of OneOf or Bound.
*/
@Pure
@Override
public @Nullable DiscardInfo isObviousDynamically(VarInfo[] vis) {
return new DiscardInfo(this, DiscardCode.obvious,
"Implied by Oneof or Bound");
}
/**
* Looks for a OneOf invariant over vis. Used by Even and PowerOfTwo to dynamically suppress those
* invariants if a OneOf exists.
*/
protected @Nullable ONEOF find_oneof(VarInfo[] vis) {
return (ONEOF) ppt.parent.find_inv_by_class(vis, ONEOF.class);
}
/**
* Return a format string for the specified output format. Each instance of %varN% will be
* replaced by the correct name for varN.
*/
public abstract String get_format_str(@GuardSatisfied RANGE this, OutputFormat format);
/** Returns true if x and y don't invalidate the invariant. */
public abstract boolean eq_check(PRIMITIVE x);
/**
* Returns a list of prototypes of all of the range
* invariants.
*/
public static List<@Prototype Invariant> get_proto_all() {
List<@Prototype Invariant> result = new ArrayList<>();
result.add(EqualZero.get_proto());
result.add(EqualOne.get_proto());
result.add(EqualMinusOne.get_proto());
result.add(GreaterEqualZero.get_proto());
result.add(GreaterEqual64.get_proto());
#if defined(SCALAR) || defined (SCALARSEQ)
result.add(BooleanVal.get_proto());
result.add(PowerOfTwo.get_proto());
result.add(Even.get_proto());
result.add(Bound0_63.get_proto());
#endif
return result;
}
/**
* Internal invariant representing PRIMITIVE scalars that are equal to zero. Used for
* non-instantiating suppressions. Will never print since OneOf accomplishes the same thing.
*/
public static class EqualZero extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected EqualZero(PptSlice ppt) {
super(ppt);
}
protected @Prototype EqualZero() {
super();
}
private static @Prototype EqualZero proto = new @Prototype EqualZero();
/** returns the prototype invariant */
public static @Prototype EqualZero get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return ONEOF.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public EqualZero instantiate_dyn(@Prototype EqualZero this, PptSlice slice) {
return new EqualZero(slice);
}
@Override
public String get_format_str(@GuardSatisfied EqualZero this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(EQ 0 %var1%)";
} else {
return "%var1% == 0";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return x == 0;
}
}
/**
* Internal invariant representing PRIMITIVE scalars that are equal to one. Used for
* non-instantiating suppressions. Will never print since OneOf accomplishes the same thing.
*/
public static class EqualOne extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected EqualOne(PptSlice ppt) {
super(ppt);
}
protected @Prototype EqualOne() {
super();
}
private static @Prototype EqualOne proto = new @Prototype EqualOne();
/** returns the prototype invariant */
public static @Prototype EqualOne get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return ONEOF.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public EqualOne instantiate_dyn(@Prototype EqualOne this, PptSlice slice) {
return new EqualOne(slice);
}
@Override
public String get_format_str(@GuardSatisfied EqualOne this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(EQ 1 %var1%)";
} else {
return "%var1% == 1";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return x == 1;
}
}
/**
* Internal invariant representing PRIMITIVE scalars that are equal to minus one. Used for
* non-instantiating suppressions. Will never print since OneOf accomplishes the same thing.
*/
public static class EqualMinusOne extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040824L;
protected EqualMinusOne(PptSlice ppt) {
super(ppt);
}
protected @Prototype EqualMinusOne() {
super();
}
private static @Prototype EqualMinusOne proto = new @Prototype EqualMinusOne();
/** returns the prototype invariant */
public static @Prototype EqualMinusOne get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return ONEOF.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public EqualMinusOne instantiate_dyn(@Prototype EqualMinusOne this, PptSlice slice) {
return new EqualMinusOne(slice);
}
@Override
public String get_format_str(@GuardSatisfied EqualMinusOne this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(EQ -1 %var1%)";
} else {
return "%var1% == -1";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return x == -1;
}
}
/**
* Internal invariant representing PRIMITIVE scalars that are greater than or equal to 0. Used
* for non-instantiating suppressions. Will never print since Bound accomplishes the same thing.
*/
public static class GreaterEqualZero extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected GreaterEqualZero(PptSlice ppt) {
super(ppt);
}
protected @Prototype GreaterEqualZero() {
super();
}
private static @Prototype GreaterEqualZero proto = new @Prototype GreaterEqualZero();
/** returns the prototype invariant */
public static @Prototype GreaterEqualZero get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return LOWER_BOUND.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public GreaterEqualZero instantiate_dyn(@Prototype GreaterEqualZero this, PptSlice slice) {
return new GreaterEqualZero(slice);
}
@Override
public String get_format_str(@GuardSatisfied GreaterEqualZero this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(>= %var1% 0)";
} else {
return "%var1% >= 0";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return x >= 0;
}
}
/**
* Internal invariant representing PRIMITIVE scalars that are greater than or equal to 64. Used
* for non-instantiating suppressions. Will never print since Bound accomplishes the same thing.
*/
public static class GreaterEqual64 extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected GreaterEqual64(PptSlice ppt) {
super(ppt);
}
protected @Prototype GreaterEqual64() {
super();
}
private static @Prototype GreaterEqual64 proto = new @Prototype GreaterEqual64();
/** returns the prototype invariant */
public static @Prototype GreaterEqual64 get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return LOWER_BOUND.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public GreaterEqual64 instantiate_dyn(@Prototype GreaterEqual64 this, PptSlice slice) {
return new GreaterEqual64(slice);
}
@Override
public String get_format_str(@GuardSatisfied GreaterEqual64 this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(>= %var1% 64)";
} else {
return "%var1% >= 64";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return x >= 64;
}
}
#if defined (SCALAR) || (SCALARSEQ)
/**
* Internal invariant representing longs whose values are always 0 or 1. Used for
* non-instantiating suppressions. Will never print since OneOf accomplishes the same thing.
*/
public static class BooleanVal extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected BooleanVal(PptSlice ppt) {
super(ppt);
}
protected @Prototype BooleanVal() {
super();
}
private static @Prototype BooleanVal proto = new @Prototype BooleanVal();
/** returns the prototype invariant */
public static @Prototype BooleanVal get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return LOWER_BOUND.dkconfig_enabled && UPPER_BOUND.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public BooleanVal instantiate_dyn(@Prototype BooleanVal this, PptSlice slice) {
return new BooleanVal(slice);
}
@Override
public String get_format_str(@GuardSatisfied BooleanVal this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(OR (EQ 0 %var1%) (EQ 1 %var1%))";
} else {
return "%var1% is boolean";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return (x == 0) || (x == 1);
}
}
/**
* Invariant representing longs whose values are always a power of 2 (exactly one bit is set).
* Used for non-instantiating suppressions. Since this is not covered by the Bound or OneOf
* invariants it is printed. Prints as {@code x is a power of 2}.
*/
public static class PowerOfTwo extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
/** Boolean. True if PowerOfTwo invariants should be considered. */
public static boolean dkconfig_enabled = Invariant.invariantEnabledDefault;
protected PowerOfTwo(PptSlice ppt) {
super(ppt);
}
protected @Prototype PowerOfTwo() {
super();
}
private static @Prototype PowerOfTwo proto = new @Prototype PowerOfTwo();
/** returns the prototype invariant */
public static @Prototype PowerOfTwo get_proto() {
return proto;
}
/** returns whether or not this invariant is enabled */
@Override
public boolean enabled() {
return dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public PowerOfTwo instantiate_dyn(@Prototype PowerOfTwo this, PptSlice slice) {
return new PowerOfTwo(slice);
}
@Override
public String get_format_str(@GuardSatisfied PowerOfTwo this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(EXISTS (p) (EQ %var1% (pow 2 p)))";
}
if (format == OutputFormat.JAVA) {
return "daikon.tools.runtimechecker.Runtime.isPowerOfTwo(%var1%)";
}
if (format == OutputFormat.CSHARPCONTRACT) {
return "%var1%.IsPowerOfTwo()";
} else {
return "%var1% is a power of 2";
}
}
/**
* Returns true if x is a power of 2 (has one bit on). The check is to and x with itself -
* 1. The theory is that if there are multiple bits turned on, at least one of those bits is
* unmodified by a subtract operation and thus the bitwise-and be non-zero. There is probably a
* more elegant way to do this.
*/
@Override
public boolean eq_check(PRIMITIVE x) {
return (x >= 1) && ((x & (x - 1)) == 0);
}
/**
* Since PowerOfTwo is not covered by Bound or OneOf, it is not obvious
* (and should thus be printed).
*/
@Pure
@Override
public @Nullable DiscardInfo isObviousDynamically(VarInfo[] vis) {
ONEOF oneof = find_oneof(vis);
if (oneof != null) {
return new DiscardInfo(this, DiscardCode.obvious, "Implied by Oneof");
}
return null;
}
}
/**
* Invariant representing longs whose values are always even. Used for non-instantiating
* suppressions. Since this is not covered by the Bound or OneOf invariants it is printed. Prints
* as {@code x is even}.
*/
public static class Even extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
/** Boolean. True if Even invariants should be considered. */
public static boolean dkconfig_enabled = false;
protected Even(PptSlice ppt) {
super(ppt);
}
protected @Prototype Even() {
super();
}
private static @Prototype Even proto = new @Prototype Even();
/** returns the prototype invariant */
public static @Prototype Even get_proto() {
return proto;
}
/** returns whether or not this invariant is enabled */
@Override
public boolean enabled() {
return dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public Even instantiate_dyn(@Prototype Even this, PptSlice slice) {
return new Even(slice);
}
@Override
public String get_format_str(@GuardSatisfied Even this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(EQ (MOD %var1% 2) 0)";
}
if (format == OutputFormat.CSHARPCONTRACT) {
return "%var1% % 2 == 0";
} else {
return "%var1% is even";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return (x & 1) == 0;
}
/**
* Since Even is not covered by Bound or OneOf, it is not obvious
* (and should thus be printed).
*/
@Pure
@Override
public @Nullable DiscardInfo isObviousDynamically(VarInfo[] vis) {
// If there is a oneof, it implies this
ONEOF oneof = find_oneof(vis);
if (oneof != null) {
return new DiscardInfo(this, DiscardCode.obvious, "Implied by Oneof");
}
return null;
}
}
/**
* Internal invariant representing longs whose values are between 0 and 63. Used for
* non-instantiating suppressions. Will never print since Bound accomplishes the same thing.
*/
public static class Bound0_63 extends RANGE {
// We are Serializable, so we specify a version to allow changes to
// method signatures without breaking serialization. If you add or
// remove fields, you should change this number to the current date.
static final long serialVersionUID = 20040113L;
protected Bound0_63(PptSlice ppt) {
super(ppt);
}
protected @Prototype Bound0_63() {
super();
}
private static @Prototype Bound0_63 proto = new @Prototype Bound0_63();
/** returns the prototype invariant */
public static @Prototype Bound0_63 get_proto() {
return proto;
}
/** Returns whether or not this invariant is enabled. */
@Override
public boolean enabled() {
return LOWER_BOUND.dkconfig_enabled && UPPER_BOUND.dkconfig_enabled;
}
/** instantiates the invariant on the specified slice */
@Override
public Bound0_63 instantiate_dyn(@Prototype Bound0_63 this, PptSlice slice) {
return new Bound0_63(slice);
}
@Override
public String get_format_str(@GuardSatisfied Bound0_63 this, OutputFormat format) {
if (format == OutputFormat.SIMPLIFY) {
return "(AND (>= %var1% 0) (>= 63 %var1%))";
} else {
return "0 <= %var1% <= 63";
}
}
@Override
public boolean eq_check(PRIMITIVE x) {
return (x >= 0) && (x <= 63);
}
}
#endif
}