Skip to content

Commit 96ca981

Browse files
committed
Align Windows JNI and constructors with Yices 2.7
1 parent ee77d75 commit 96ca981

2 files changed

Lines changed: 52 additions & 42 deletions

File tree

src/main/java/com/sri/yices/Constructor.java

Lines changed: 44 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,64 +11,66 @@ public enum Constructor {
1111
// atomic terms
1212
BOOL_CONSTANT(0), // boolean constant
1313
ARITH_CONSTANT(1), // rational constant
14-
BV_CONSTANT(2), // bitvector constant
15-
SCALAR_CONSTANT(3), // constant of uninterpreted or scalar type
16-
VARIABLE(4), // variable in quantifiers
17-
UNINTERPRETED_TERM(5), // (i.e., global variables, can't be bound)
14+
FF_CONSTANT(2), // finite field constant
15+
BV_CONSTANT(3), // bitvector constant
16+
SCALAR_CONSTANT(4), // constant of uninterpreted or scalar type
17+
VARIABLE(5), // variable in quantifiers
18+
UNINTERPRETED_TERM(6), // (i.e., global variables, can't be bound)
1819

1920
// composite terms
20-
ITE_TERM(6), // if-then-else
21-
APP_TERM(7), // application of an uninterpreted function
22-
UPDATE_TERM(8), // function update
23-
TUPLE_TERM(9), // tuple constructor
24-
EQ_TERM(10), // equality
25-
DISTINCT_TERM(11), // distinct t_1 ... t_n
26-
FORALL_TERM(12), // quantifier
27-
LAMBDA_TERM(13), // lambda
28-
NOT_TERM(14), // (not t)
29-
OR_TERM(15), // n-ary OR
30-
XOR_TERM(16), // n-ary XOR
21+
ITE_TERM(7), // if-then-else
22+
APP_TERM(8), // application of an uninterpreted function
23+
UPDATE_TERM(9), // function update
24+
TUPLE_TERM(10), // tuple constructor
25+
EQ_TERM(11), // equality
26+
DISTINCT_TERM(12), // distinct t_1 ... t_n
27+
FORALL_TERM(13), // quantifier
28+
LAMBDA_TERM(14), // lambda
29+
NOT_TERM(15), // (not t)
30+
OR_TERM(16), // n-ary OR
31+
XOR_TERM(17), // n-ary XOR
3132

32-
BV_ARRAY(17), // array of boolean terms
33-
BV_DIV(18), // unsigned division
34-
BV_REM(19), // unsigned remainder
35-
BV_SDIV(20), // signed division
36-
BV_SREM(21), // remainder in signed division (rounding to 0)
37-
BV_SMOD(22), // remainder in signed division (rounding to -infinity)
38-
BV_SHL(23), // shift left (padding with 0)
39-
BV_LSHR(24), // logical shift right (padding with 0)
40-
BV_ASHR(25), // arithmetic shift right (padding with sign bit)
41-
BV_GE_ATOM(26), // unsigned comparison: (t1 >= t2)
42-
BV_SGE_ATOM(27), // signed comparison (t1 >= t2)
43-
ARITH_GE_ATOM(28), // atom (t1 >= t2) for arithmetic terms: t2 is always 0
44-
ARITH_ROOT_ATOM(29), // atom (0 <= k <= root_count(p)) && (x r root(p, k)) for r in <, <=, ==, !=, >, >=
33+
BV_ARRAY(18), // array of boolean terms
34+
BV_DIV(19), // unsigned division
35+
BV_REM(20), // unsigned remainder
36+
BV_SDIV(21), // signed division
37+
BV_SREM(22), // remainder in signed division (rounding to 0)
38+
BV_SMOD(23), // remainder in signed division (rounding to -infinity)
39+
BV_SHL(24), // shift left (padding with 0)
40+
BV_LSHR(25), // logical shift right (padding with 0)
41+
BV_ASHR(26), // arithmetic shift right (padding with sign bit)
42+
BV_GE_ATOM(27), // unsigned comparison: (t1 >= t2)
43+
BV_SGE_ATOM(28), // signed comparison (t1 >= t2)
44+
ARITH_GE_ATOM(29), // atom (t1 >= t2) for arithmetic terms: t2 is always 0
45+
ARITH_ROOT_ATOM(30), // atom (0 <= k <= root_count(p)) && (x r root(p, k)) for r in <, <=, ==, !=, >, >=
4546

46-
ABS(30), // absolute value
47-
CEIL(31), // ceil
48-
FLOOR(32), // floor
49-
RDIV(33), // real division (as in x/y)
50-
IDIV(34), // integer division
51-
IMOD(35), // modulo
52-
IS_INT_ATOM(36), // integrality test: (is-int t)
53-
DIVIDES_ATOM(37), // divisibility test: (divides t1 t2)
47+
ABS(31), // absolute value
48+
CEIL(32), // ceil
49+
FLOOR(33), // floor
50+
RDIV(34), // real division (as in x/y)
51+
IDIV(35), // integer division
52+
IMOD(36), // modulo
53+
IS_INT_ATOM(37), // integrality test: (is-int t)
54+
DIVIDES_ATOM(38), // divisibility test: (divides t1 t2)
5455

5556
// projections
56-
SELECT_TERM(38), // tuple projection
57-
BIT_TERM(39), // bit-select: extract the i-th bit of a bitvector
57+
SELECT_TERM(39), // tuple projection
58+
BIT_TERM(40), // bit-select: extract the i-th bit of a bitvector
5859

5960
// sums
60-
BV_SUM(40), // sum of pairs a * t where a is a bitvector constant (and t is a bitvector term)
61-
ARITH_SUM(41), // sum of pairs a * t where a is a rational (and t is an arithmetic term)
61+
BV_SUM(41), // sum of pairs a * t where a is a bitvector constant (and t is a bitvector term)
62+
ARITH_SUM(42), // sum of pairs a * t where a is a rational (and t is an arithmetic term)
63+
FF_SUM(43), // sum of pairs a * t where a is a finite-field constant (and t is a finite-field term)
6264

6365
// products
64-
POWER_PRODUCT(42) // power products: (t1^d1 * ... * t_n^d_n)
66+
POWER_PRODUCT(44) // power products: (t1^d1 * ... * t_n^d_n)
6567
;
6668

6769
private int index;
6870
Constructor(int id) { this.index = id; }
6971
public int getIndex() { return index; }
7072

71-
public static final int NUM_CONSTRUCTORS = 43;
73+
public static final int NUM_CONSTRUCTORS = 45;
7274
private static final Constructor[] table;
7375

7476
static {

src/main/java/com/sri/yices/yicesJNIforWindows.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323

2424
#define YICES_ERROR_REQUIRES_AT_LEAST_2_6_2 -262
2525

26+
/**
27+
* Assumes that for each __YICES_VERSION __YICES_VERSION_MAJOR and __YICES_VERSION_PATCHLEVEL
28+
* are between 0 and less than 100.
29+
*/
30+
JNIEXPORT jlong JNICALL Java_com_sri_yices_Yices_versionOrdinal(JNIEnv *env, jclass){
31+
return (10000 * __YICES_VERSION) + (100 * __YICES_VERSION_MAJOR) + __YICES_VERSION_PATCHLEVEL;
32+
}
33+
2634

2735
/*
2836
* On Windows, jint and int32_t are not the same type:

0 commit comments

Comments
 (0)