Builtins of COLIBRI and Colibri2

The symbols that COLIBRI and Colibri2 accept in SMT-LIB files besides the standard theories. The column Why3 gives the functions of the Why3 standard library that the Why3 drivers of the solvers (colibri.drv, colibri2.drv) translate to the builtin.

Versions: COLIBRI 2026.06 and Colibri2 0.7. ✓: accepted by the solver; ⚠: accepted, but the solver fails on the example (see the notes). Each example states a fact about the builtin and asserts its negation: the expected answer is unsat. They are run on both solvers.

Integer and real arithmetic

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
colibri_abs_int (Int) Int absolute value |x| ✓ ✓ int.Abs.abs Colibri2 maps it to Dolmen's Int.abs (same symbol as the SMT-LIB abs).
colibri_abs_real (Real) Real absolute value |x| ✓ ✓ real.Abs.abs
colibri_cdiv (Int Int) Int integer division rounded toward zero (truncated, C-style) ✓ ✓ int.ComputerDivision.div Colibri2: Dolmen Int.div_t. Value for divisor 0 is unspecified (Colibri2 leaves it uninterpreted).
colibri_crem (Int Int) Int remainder of the truncated division (sign of the dividend), x - y*cdiv(x,y) ✓ ✓ int.ComputerDivision.mod Colibri2: Dolmen Int.rem_t.
colibri_floor (Real) Real largest integer <= x, as a real ✓ ✓ No driver uses it: both map real.Truncate.floor to the SMT-LIB to_int. Colibri2: Dolmen Real.floor.
colibri_ceil (Real) Real smallest integer >= x, as a real ✓ ✓ real.Truncate.ceil, as colibri2.drv maps real.Truncate.ceil to (- (to_int (- x))) instead. Colibri2: Dolmen Real.ceiling.
colibri_truncate (Real) Real x rounded toward zero to an integer, as a real ✓ ✓ real.Truncate.truncate, as Colibri2: Dolmen Real.truncate.
colibri_truncate_to_int (Real) Int x rounded toward zero, as an integer ✓
colibri_round (Real) Real x rounded to the nearest integer, ties to even, as a real ✓ COLIBRI interprets round(x) as round(rne, x) ('round to nearest integral'); ties-to-even read from the rne mode, not tested.
colibri_pow_int_int (Int Int) Int x^n for n >= 0 ✓ ✓ int.Power.power
bv.Pow2int.pow2, as
Colibri2: value unspecified (uninterpreted) for n < 0.
colibri_pow_real_int (Real Int) Real x^n for n >= 0 ✓ ✓ real.PowerInt.power
colibri_min_int (Int Int) Int minimum ✓ ⚠ int.MinMax.min Colibri2 0.7 fails on the example: no interpretation in the model check.
colibri_max_int (Int Int) Int maximum ✓ ⚠ int.MinMax.max Colibri2 0.7 fails on the example: no interpretation in the model check.
colibri_min_real (Real Real) Real minimum ✓ real.MinMax.min
colibri_max_real (Real Real) Real maximum ✓ real.MinMax.max
colibri_real_isIntegral (Real) Bool x is an integer ⚠ COLIBRI 2026.06 rejects the example: "Unknown function colibri_isIntegral".
colibri_setIntegral (Real) Real returns x and constrains x to be an integer ✓ For experts.
colibri_range (Real Real Real) Real colibri_range x l h returns x and constrains l <= x <= h ✓ For experts.

Square root, transcendental functions and constants

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
colibri_sqrt (Real) Real square root (non negative) ✓ ✓ real.Square.sqrt colibri.drv does not map real.Square.sqrt.
colibri_exp (Real) Real exponential e^x ✓ real.ExpLog.exp Declared Real -> Real; colibri_exp_real is the same. colibri.drv has the mapping of real.ExpLog.log to colibri_ln commented out.
colibri_exp_real (Real) Real exponential e^x ✓ Alias of colibri_exp.
colibri_ln (Real) Real natural logarithm ✓ Mapping from real.ExpLog.log is commented out in colibri.drv:104.
colibri_ln_real (Real) Real natural logarithm ✓ Alias of colibri_ln.
colibri_sin (Real) Real sine (radians) ✓
colibri_cos (Real) Real cosine (radians) ✓
colibri_tan (Real) Real tangent (radians) ✓ May not work in COLIBRI.
colibri_asin (Real) Real arc sine ✓
colibri_acos (Real) Real arc cosine ✓
colibri_atan (Real) Real arc tangent ✓ May not work in COLIBRI.
colibri_pi () Real the constant pi ✓
colibri_e () Real the constant e (Euler's number) ✓

Floating-point

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
colibri_fp_isIntegral (Float(e,s)) Bool x is a finite float with an integer value ⚠ COLIBRI 2026.06 rejects the example: "Unknown function colibri_isIntegral".
colibri_min_fp (Float(e,s) Float(e,s)) Float(e,s) minimum, mapped to SMT-LIB fp.min ✓ Rewritten to fp.min by check_overloaded.
colibri_max_fp (Float(e,s) Float(e,s)) Float(e,s) maximum, mapped to SMT-LIB fp.max ✓ Rewritten to fp.max by check_overloaded.
colibri_exp_fp (Float(e,s)) Float(e,s) floating-point exponential (fp_exp) ✓ No rounding-mode argument; the rounding/accuracy of fp_exp is not stated in the parser.
colibri_ln_fp (Float(e,s)) Float(e,s) floating-point natural logarithm (fp_ln) ✓ Same caveats as colibri_exp_fp.
colibri_fe () Float32 the constant e as a Float32 ✓ Declared fp(8,24). The rounding of e used is not stated in the parser (presumably nearest).
colibri_de () Float64 the constant e as a Float64 ✓ Rounding not stated.
colibri_isFinite (Float(e,s)) Bool x is neither infinite nor NaN ✓ Plain SMT-LIB equivalent: (not (or (fp.isInfinite x) (fp.isNaN x))).

Bit-vector / integer conversions

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
bv2nat (BV(n)) Int unsigned value of the bit-vector, in [0, 2^n) ✓ ✓ bv.BV_Gen.to_uint
bv.BV8/16/32/64/128/256.t'int
cvc4/z3 name; SMT-LIB 2.7 calls it ubv_to_int. Colibri2: since 0.6 (CHANGES).
bv2int (BV(n)) Int signed (two's complement) value of the bit-vector, in [-2^(n-1), 2^(n-1)) ⚠ ✓ bv.BV8/16/32/64/128/256.to_int Signed in both solvers (COLIBRI: intN_from_uint, comment 'on va vers des entiers signés'). SMT-LIB 2.7 calls it sbv_to_int. Note: in z3/cvc4 bv2int is unsigned. COLIBRI 2026.06 fails on the example (internal syntax error).
nat2bv ((_ nat2bv n) Int) BV(n) x mod 2^n as a bit-vector of size n ✓ ✓ bv.BV8/16/32/64/128/256.of_int, as Indexed.
int2bv ((_ int2bv n) Int) BV(n) x mod 2^n as a bit-vector of size n ✓ ✓ Indexed; cvc4/z3 name, SMT-LIB 2.7 int_to_bv. The mapping of bv.BVn.of_int to int2bv is commented out in Why3's cvc4_bv.gen (imported by colibri.drv).

Integer bitwise operators

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
colibri_testbit_int (Int Int) Bool colibri_testbit_int x i: bit i of x (false for i < 0) ✓ int.Bitwise.testbit New in 0.7. Bit at i < 0 read from Zbit.bittest (spec only for i >= 0); treat as unspecified. The Why3 mapping is in the Why3 versions after 1.9.
colibri_and_int (Int Int) Int bitwise and ✓ int.Bitwise.land New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_ior_int (Int Int) Int bitwise inclusive or ✓ int.Bitwise.lor New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_xor_int (Int Int) Int bitwise exclusive or ✓ int.Bitwise.lxor New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_not_int (Int) Int bitwise not, -x-1 ✓ int.Bitwise.lnot New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_rshift_int (Int Int) Int colibri_rshift_int x k: arithmetic shift right, floor(x / 2^k); a negative k shifts left (x * 2^-k) ✓ int.Bitwise.asr
int.Bitwise.lsl
New in 0.7. CHANGES: reasoned on in the BDD domain for constant shifts. The Why3 mapping is in the Why3 versions after 1.9.
colibri_extract_int (Int Int Int) Int colibri_extract_int x off len: the len bits of x from position off, as a non-negative integer (0 if len <= 0) ✓ int.Bitwise.extract New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_signed_extract_int (Int Int Int) Int colibri_signed_extract_int x off len: the len bits of x from position off, sign-extended from the highest one (0 if len <= 0) ✓ int.Bitwise.signed_extract New in 0.7. The Why3 mapping is in the Why3 versions after 1.9.
colibri_update_int (Int Int Int Int) Int colibri_update_int dst off len src: dst with its len bits from position off replaced by the len lowest bits of src (dst if len <= 0) ✓ int.Bitwise.update New in 0.7. Argument order is (dst off len src). The Why3 mapping is in the Why3 versions after 1.9.

Arrays

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
const (B) (Array A B) constant array: every index maps to v ✓ ✓ z3-style constant array. Both accept a plain application (const v), the index sort being inferred; ((as const (Array A B)) v) is Dolmen's own and works too.
colibri2_array_const (B) (Array A B) constant array ⚠ Internal to the array theory of Colibri2: accepted, not meant for users. Colibri2 0.7 fails on the example: no interpretation in the model check.
colibri2_array_diff ((Array A B) (Array A B)) A an index where the two arrays differ (any index if they are equal) - extensionality witness ✓ Internal to the array theory of Colibri2: accepted, not meant for users.
colibri2_array_default_index ((Array A B)) A internal: index associated with the array's default value ✓ Internal to the array theory of Colibri2: accepted, not meant for users.
colibri2_array_default_value ((Array A B)) B internal: the default (constant) value of the array ✓ Internal to the array theory of Colibri2: accepted, not meant for users.
colibri2_array_map ((-> B ... B C) (Array A B) ... (Array A B)) (Array A C) pointwise map of an n-ary function over n arrays ✓ Internal to the array theory of Colibri2: accepted, not meant for users.
colibri_array_update ((Array Int A) Int Int Int (Array Int A)) (Array Int A) colibri_array_update dst pos len src_pos src: dst with [pos, pos+len) replaced by src[src_pos, src_pos+len) ✓ New in 0.7 (dseq library).
colibri_array_update_with_seq ((Array Int A) Int Int (DSeq A)) (Array Int A) colibri_array_update_with_seq dst pos len src: dst with [pos, pos+len) replaced by the elements 0..len-1 of the sequence src ✓ New in 0.7 (dseq library).
colibri_array_submem ((Array Int A) Int Int (Array Int A)) Bool colibri_array_submem a pos len b: a and b agree on [pos, pos+len), i.e. a = colibri_array_update a pos len pos b ✓ New in 0.7 (dseq library).

Sequences

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
DSeq sort (DSeq A) sort of sequences of A with a length and a default value ✓ A sort, not a function.
dseq.length ((DSeq A)) Int length ✓
dseq.default ((DSeq A)) A default value (returned by out-of-bounds reads) ✓
dseq.get ((DSeq A) Int) A element at index i; the default value if i is out of [0, length) ✓
dseq.const (Int A) (DSeq A) dseq.const len v: sequence of length len, all elements and default v ✓
dseq.set ((DSeq A) Int A) (DSeq A) s with element i set to v; s unchanged if i is out of bounds ✓
dseq.extract ((DSeq A) Int Int) (DSeq A) dseq.extract s pos len: the subsequence s[pos..pos+len-1] (length max(len,0)), same default ✓
dseq.update ((DSeq A) Int Int (DSeq A)) (DSeq A) dseq.update dst pos len src: dst with indices [max(0,pos), min(length dst, pos+len)) replaced by src[k-pos]; length and default of dst ✓
dseq.diff ((DSeq A) (DSeq A)) Int an index where the two sequences differ (extensionality witness) ✓ Mostly internal.
dseq.from_array (Int A (Array Int A)) (DSeq A) dseq.from_array len def a: the sequence a[0..len-1] with default def ✓
dseq.update_seq_with_array ((DSeq A) Int Int Int (Array Int A)) (DSeq A) dseq.update_seq_with_array dst pos len src_pos src: dst with [pos, pos+len) replaced by src[src_pos, src_pos+len) ✓ Meaning from argument names (Shared_slices.update_at).
dseq.rev ((DSeq A)) (DSeq A) reversal: element i becomes element length-1-i ✓
dseq.int_to_seq (Int Int) (DSeq Bool) dseq.int_to_seq x len: the bits 0..len-1 of x (two's complement, bit 0 first) as Booleans, default false ✓ Argument order (value, length).
dseq.seq_to_int ((DSeq Bool)) Int unsigned integer whose bit i is element i ✓
NSeq sort (NSeq A) sort of sequences indexed on an integer interval [first, last] ✓
nseq.first ((NSeq A)) Int first index ✓
nseq.last ((NSeq A)) Int last index ✓
nseq.length ((NSeq A)) Int length (last - first + 1, presumably 0 if empty) ✓
nseq.content ((NSeq A)) (Array Int A) the underlying array ✓
nseq.get ((NSeq A) Int) A element at index i ✓
nseq.set ((NSeq A) Int A) (NSeq A) s with element i set to v ✓
nseq.const (Int Int A) (NSeq A) nseq.const first last v: sequence on [first, last] with all elements v ✓
nseq.concat ((NSeq A) (NSeq A)) (NSeq A) concatenation ✓
nseq.relocate ((NSeq A) Int) (NSeq A) nseq.relocate s f: the same elements re-indexed to start at f ✓
nseq.slice ((NSeq A) Int Int) (NSeq A) nseq.slice s f l: the subsequence on [f, l] (same indices) ✓
nseq.update ((NSeq A) (NSeq A)) (NSeq A) nseq.update a b: a with the elements on b's indices replaced by b's ✓
Seq sort (Seq A) sort of finite sequences (cvc5 theory of sequences) ✓ Registered with the NSeq theory (disabled by --no-nseq).
seq.empty () (Seq A) empty sequence ✓
seq.unit (A) (Seq A) one-element sequence ✓
seq.len ((Seq A)) Int length ✓
seq.nth ((Seq A) Int) A element at index i (0-based) ✓
seq.update ((Seq A) Int (Seq A)) (Seq A) seq.update s i t: s with the elements from i overwritten by t, within the length of s ✓ Also accepts an element instead of a sequence as third argument (then a single-element set).
seq.extract ((Seq A) Int Int) (Seq A) seq.extract s i n: subsequence of length n from index i ✓
seq.++ ((Seq A) (Seq A) ...) (Seq A) concatenation (n-ary) ✓

Other

SymbolSignatureMeaningCOLIBRIColibri2Why3NotesExample
:rewrite-rule attribute (! (forall ...) :rewrite-rule) marks a universally quantified equation to be used as a rewrite rule ✓ Attribute, not a function. New in 0.7.
:colibri2 attribute (! f :colibri2 goal|check) tags an assertion as the goal, or as a formula to check in the model ✓