z3_sys/lib.rs
1//! # Z3
2//!
3//! Z3 is a theorem prover [from Microsoft Research](https://github.com/Z3Prover/z3/).
4//!
5//! This crate provides low-level bindings that provide no real
6//! affordances for usage from Rust and that mirror the C API.
7//!
8//! For bindings that are easier to use from Rust, see the higher level
9//! bindings in the [Z3](https://crates.io/crates/z3/) crate.
10//!
11//! Example:
12//!
13//! ```
14//! use z3_sys::*;
15//!
16//! unsafe {
17//! let cfg = Z3_mk_config().unwrap();
18//! let ctx = Z3_mk_context(cfg).unwrap();
19//!
20//! let a = Z3_mk_not(ctx, Z3_mk_eq(ctx, Z3_mk_false(ctx).unwrap(), Z3_mk_true(ctx).unwrap()).unwrap()).unwrap();
21//! let b = Z3_mk_not(ctx, Z3_mk_iff(ctx, Z3_mk_false(ctx).unwrap(), Z3_mk_true(ctx).unwrap()).unwrap()).unwrap();
22//! assert_eq!(Z3_mk_true(ctx), Z3_simplify(ctx, a));
23//! assert_eq!(Z3_mk_true(ctx), Z3_simplify(ctx, b));
24//!
25//! Z3_del_config(cfg);
26//! Z3_del_context(ctx);
27//! }
28//! ```
29
30#![allow(non_camel_case_types)]
31#![allow(clippy::unreadable_literal)]
32#![warn(clippy::doc_markdown)]
33#![no_std]
34
35use core::ptr::NonNull;
36
37mod generated;
38
39#[doc(hidden)]
40#[repr(C)]
41#[derive(Debug, Copy, Clone)]
42pub struct _Z3_symbol {
43 _unused: [u8; 0],
44}
45/// Lisp-like symbol used to name types, constants, and functions.
46/// A symbol can be created using string or integers.
47///
48/// # See also:
49///
50/// - [`Z3_get_symbol_int`]
51/// - [`Z3_get_symbol_kind`]
52/// - [`Z3_get_symbol_string`]
53/// - [`Z3_mk_int_symbol`]
54/// - [`Z3_mk_string_symbol`]
55pub type Z3_symbol = NonNull<_Z3_symbol>;
56
57#[doc(hidden)]
58#[repr(C)]
59#[derive(Debug, Copy, Clone)]
60pub struct _Z3_literals {
61 _unused: [u8; 0],
62}
63
64pub type Z3_literals = NonNull<_Z3_literals>;
65
66#[doc(hidden)]
67#[repr(C)]
68#[derive(Debug, Copy, Clone)]
69pub struct _Z3_config {
70 _unused: [u8; 0],
71}
72/// Configuration object used to initialize logical contexts.
73pub type Z3_config = NonNull<_Z3_config>;
74
75#[doc(hidden)]
76#[repr(C)]
77#[derive(Debug, Copy, Clone)]
78pub struct _Z3_context {
79 _unused: [u8; 0],
80}
81/// Manager of all other Z3 objects, global configuration options, etc.
82pub type Z3_context = NonNull<_Z3_context>;
83
84#[doc(hidden)]
85#[repr(C)]
86#[derive(Debug, Copy, Clone)]
87pub struct _Z3_sort {
88 _unused: [u8; 0],
89}
90/// Kind of AST used to represent types.
91pub type Z3_sort = NonNull<_Z3_sort>;
92
93#[doc(hidden)]
94#[repr(C)]
95#[derive(Debug, Copy, Clone)]
96pub struct _Z3_func_decl {
97 _unused: [u8; 0],
98}
99/// Kind of AST used to represent function symbols.
100pub type Z3_func_decl = NonNull<_Z3_func_decl>;
101
102#[doc(hidden)]
103#[repr(C)]
104#[derive(Debug, Copy, Clone)]
105pub struct _Z3_ast {
106 _unused: [u8; 0],
107}
108/// Abstract Syntax Tree node. That is, the data structure used in Z3
109/// to represent terms, formulas, and types.
110pub type Z3_ast = NonNull<_Z3_ast>;
111
112#[doc(hidden)]
113#[repr(C)]
114#[derive(Debug, Copy, Clone)]
115pub struct _Z3_app {
116 _unused: [u8; 0],
117}
118/// Kind of AST used to represent function applications.
119pub type Z3_app = NonNull<_Z3_app>;
120
121#[doc(hidden)]
122#[repr(C)]
123#[derive(Debug, Copy, Clone)]
124pub struct _Z3_pattern {
125 _unused: [u8; 0],
126}
127/// Kind of AST used to represent pattern and multi-patterns used
128/// to guide quantifier instantiation.
129pub type Z3_pattern = NonNull<_Z3_pattern>;
130
131#[doc(hidden)]
132#[repr(C)]
133#[derive(Debug, Copy, Clone)]
134pub struct _Z3_model {
135 _unused: [u8; 0],
136}
137/// Model for the constraints inserted into the logical context.
138pub type Z3_model = NonNull<_Z3_model>;
139
140#[doc(hidden)]
141#[repr(C)]
142#[derive(Debug, Copy, Clone)]
143pub struct _Z3_constructor {
144 _unused: [u8; 0],
145}
146/// Type constructor for a (recursive) datatype.
147pub type Z3_constructor = NonNull<_Z3_constructor>;
148
149#[doc(hidden)]
150#[repr(C)]
151#[derive(Debug, Copy, Clone)]
152pub struct _Z3_constructor_list {
153 _unused: [u8; 0],
154}
155/// List of constructors for a (recursive) datatype.
156pub type Z3_constructor_list = NonNull<_Z3_constructor_list>;
157
158#[doc(hidden)]
159#[repr(C)]
160#[derive(Debug, Copy, Clone)]
161pub struct _Z3_params {
162 _unused: [u8; 0],
163}
164/// Parameter set used to configure many components such as:
165/// simplifiers, tactics, solvers, etc.
166pub type Z3_params = NonNull<_Z3_params>;
167
168#[doc(hidden)]
169#[repr(C)]
170#[derive(Debug, Copy, Clone)]
171pub struct _Z3_param_descrs {
172 _unused: [u8; 0],
173}
174/// Provides a collection of parameter names, their types,
175/// default values and documentation strings. Solvers, tactics,
176/// and other objects accept different collection of parameters.
177pub type Z3_param_descrs = NonNull<_Z3_param_descrs>;
178
179#[doc(hidden)]
180#[repr(C)]
181#[derive(Debug, Copy, Clone)]
182pub struct _Z3_goal {
183 _unused: [u8; 0],
184}
185/// Set of formulas that can be solved and/or transformed using
186/// tactics and solvers.
187pub type Z3_goal = NonNull<_Z3_goal>;
188
189#[doc(hidden)]
190#[repr(C)]
191#[derive(Debug, Copy, Clone)]
192pub struct _Z3_tactic {
193 _unused: [u8; 0],
194}
195/// Basic building block for creating custom solvers for specific
196/// problem domains.
197pub type Z3_tactic = NonNull<_Z3_tactic>;
198
199#[doc(hidden)]
200#[repr(C)]
201#[derive(Debug, Copy, Clone)]
202pub struct _Z3_probe {
203 _unused: [u8; 0],
204}
205/// Function/predicate used to inspect a goal and collect information
206/// that may be used to decide which solver and/or preprocessing step
207/// will be used.
208pub type Z3_probe = NonNull<_Z3_probe>;
209
210#[doc(hidden)]
211#[repr(C)]
212#[derive(Debug, Copy, Clone)]
213pub struct _Z3_stats {
214 _unused: [u8; 0],
215}
216/// Statistical data for a solver.
217pub type Z3_stats = NonNull<_Z3_stats>;
218
219#[doc(hidden)]
220#[repr(C)]
221#[derive(Debug, Copy, Clone)]
222pub struct _Z3_solver {
223 _unused: [u8; 0],
224}
225/// (Incremental) solver, possibly specialized by a particular
226/// tactic or logic.
227pub type Z3_solver = NonNull<_Z3_solver>;
228
229#[doc(hidden)]
230#[repr(C)]
231#[derive(Debug, Copy, Clone)]
232pub struct _Z3_ast_vector {
233 _unused: [u8; 0],
234}
235/// Vector of [`Z3_ast`] objects.
236pub type Z3_ast_vector = NonNull<_Z3_ast_vector>;
237
238#[doc(hidden)]
239#[repr(C)]
240#[derive(Debug, Copy, Clone)]
241pub struct _Z3_ast_map {
242 _unused: [u8; 0],
243}
244/// Mapping from [`Z3_ast`] to [`Z3_ast`] objects.
245pub type Z3_ast_map = NonNull<_Z3_ast_map>;
246
247#[doc(hidden)]
248#[repr(C)]
249#[derive(Debug, Copy, Clone)]
250pub struct _Z3_apply_result {
251 _unused: [u8; 0],
252}
253/// Collection of subgoals resulting from applying of a tactic
254/// to a goal.
255pub type Z3_apply_result = NonNull<_Z3_apply_result>;
256
257#[doc(hidden)]
258#[repr(C)]
259#[derive(Debug, Copy, Clone)]
260pub struct _Z3_func_interp {
261 _unused: [u8; 0],
262}
263/// Interpretation of a function in a model.
264pub type Z3_func_interp = NonNull<_Z3_func_interp>;
265
266#[doc(hidden)]
267#[repr(C)]
268#[derive(Debug, Copy, Clone)]
269pub struct _Z3_func_entry {
270 _unused: [u8; 0],
271}
272/// Representation of the value of a [`Z3_func_interp`]
273/// at a particular point.
274pub type Z3_func_entry = NonNull<_Z3_func_entry>;
275
276#[doc(hidden)]
277#[repr(C)]
278#[derive(Debug, Copy, Clone)]
279pub struct _Z3_fixedpoint {
280 _unused: [u8; 0],
281}
282/// Context for the recursive predicate solver.
283pub type Z3_fixedpoint = NonNull<_Z3_fixedpoint>;
284
285#[doc(hidden)]
286#[repr(C)]
287#[derive(Debug, Copy, Clone)]
288pub struct _Z3_optimize {
289 _unused: [u8; 0],
290}
291/// Context for solving optimization queries.
292pub type Z3_optimize = NonNull<_Z3_optimize>;
293
294#[doc(hidden)]
295#[repr(C)]
296#[derive(Debug, Copy, Clone)]
297pub struct _Z3_rcf_num {
298 _unused: [u8; 0],
299}
300pub type Z3_rcf_num = NonNull<_Z3_rcf_num>;
301
302/// Z3 string type. It is just an alias for `const char *`.
303pub type Z3_string = *const ::core::ffi::c_char;
304
305pub type Z3_string_ptr = *mut Z3_string;
306
307pub const Z3_L_FALSE: Z3_lbool = -1;
308pub const Z3_L_UNDEF: Z3_lbool = 0;
309pub const Z3_L_TRUE: Z3_lbool = 1;
310
311/// Lifted Boolean type: `false`, `undefined`, `true`.
312pub type Z3_lbool = i32;
313
314/// The different kinds of symbol.
315/// In Z3, a symbol can be represented using integers and
316/// strings. See [`Z3_get_symbol_kind`].
317///
318/// This corresponds to `Z3_symbol_kind` in the C API.
319///
320/// # See also:
321///
322/// - [`Z3_mk_int_symbol`]
323/// - [`Z3_mk_string_symbol`]
324/// - [`Z3_symbol`]
325#[repr(u32)]
326#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
327pub enum SymbolKind {
328 /// An integer symbol.
329 ///
330 /// This corresponds to `Z3_INT_SYMBOL` in the C API.
331 Int = generated::Z3_symbol_kind::Z3_INT_SYMBOL as u32,
332 /// A string symbol.
333 ///
334 /// This corresponds to `Z3_STRING_SYMBOL` in the C API.
335 String = generated::Z3_symbol_kind::Z3_STRING_SYMBOL as u32,
336}
337
338/// The different kinds of parameters that can be associated with function symbols.
339///
340/// This corresponds to `Z3_parameter_kind` in the C API.
341///
342/// # See also:
343///
344/// - [`Z3_get_decl_num_parameters`]
345/// - [`Z3_get_decl_parameter_kind`]
346#[repr(u32)]
347#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
348pub enum ParameterKind {
349 /// An integer parameter.
350 ///
351 /// This corresponds to `Z3_PARAMETER_INT` in the C API.
352 Int = generated::Z3_parameter_kind::Z3_PARAMETER_INT as u32,
353 /// A double parameter.
354 ///
355 /// This corresponds to `Z3_PARAMETER_DOUBLE` in the C API.
356 Double = generated::Z3_parameter_kind::Z3_PARAMETER_DOUBLE as u32,
357 /// A rational number parameter.
358 ///
359 /// This corresponds to `Z3_PARAMETER_RATIONAL` in the C API.
360 Rational = generated::Z3_parameter_kind::Z3_PARAMETER_RATIONAL as u32,
361 /// A symbol parameter.
362 ///
363 /// This corresponds to `Z3_PARAMETER_SYMBOL` in the C API.
364 Symbol = generated::Z3_parameter_kind::Z3_PARAMETER_SYMBOL as u32,
365 /// A sort parameter.
366 ///
367 /// This corresponds to `Z3_PARAMETER_SORT` in the C API.
368 Sort = generated::Z3_parameter_kind::Z3_PARAMETER_SORT as u32,
369 /// An expression parameter.
370 ///
371 /// This corresponds to `Z3_PARAMETER_AST` in the C API.
372 AST = generated::Z3_parameter_kind::Z3_PARAMETER_AST as u32,
373 /// A function declaration parameter.
374 ///
375 /// This corresponds to `Z3_PARAMETER_FUNC_DECL` in the C API.
376 FuncDecl = generated::Z3_parameter_kind::Z3_PARAMETER_FUNC_DECL as u32,
377}
378
379/// The different kinds of Z3 types.
380///
381/// This corresponds to `Z3_sort_kind` in the C API.
382#[repr(u32)]
383#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
384pub enum SortKind {
385 /// This corresponds to `Z3_UNINTERPRETED_SORT` in the C API.
386 Uninterpreted = generated::Z3_sort_kind::Z3_UNINTERPRETED_SORT as u32,
387 /// This corresponds to `Z3_BOOL_SORT` in the C API.
388 Bool = generated::Z3_sort_kind::Z3_BOOL_SORT as u32,
389 /// This corresponds to `Z3_INT_SORT` in the C API.
390 Int = generated::Z3_sort_kind::Z3_INT_SORT as u32,
391 /// This corresponds to `Z3_REAL_SORT` in the C API.
392 Real = generated::Z3_sort_kind::Z3_REAL_SORT as u32,
393 /// This corresponds to `Z3_BV_SORT` in the C API.
394 BV = generated::Z3_sort_kind::Z3_BV_SORT as u32,
395 /// This corresponds to `Z3_ARRAY_SORT` in the C API.
396 Array = generated::Z3_sort_kind::Z3_ARRAY_SORT as u32,
397 /// This corresponds to `Z3_DATATYPE_SORT` in the C API.
398 Datatype = generated::Z3_sort_kind::Z3_DATATYPE_SORT as u32,
399 /// This corresponds to `Z3_RELATION_SORT` in the C API.
400 Relation = generated::Z3_sort_kind::Z3_RELATION_SORT as u32,
401 /// This corresponds to `Z3_FINITE_DOMAIN_SORT` in the C API.
402 FiniteDomain = generated::Z3_sort_kind::Z3_FINITE_DOMAIN_SORT as u32,
403 /// This corresponds to `Z3_FLOATING_POINT_SORT` in the C API.
404 FloatingPoint = generated::Z3_sort_kind::Z3_FLOATING_POINT_SORT as u32,
405 /// This corresponds to `Z3_ROUNDING_MODE_SORT` in the C API.
406 RoundingMode = generated::Z3_sort_kind::Z3_ROUNDING_MODE_SORT as u32,
407 /// This corresponds to `Z3_SEQ_SORT` in the C API.
408 Seq = generated::Z3_sort_kind::Z3_SEQ_SORT as u32,
409 /// This corresponds to `Z3_RE_SORT` in the C API.
410 RE = generated::Z3_sort_kind::Z3_RE_SORT as u32,
411 /// This corresponds to `Z3_UNKNOWN_SORT` in the C API.
412 Unknown = generated::Z3_sort_kind::Z3_UNKNOWN_SORT as u32,
413}
414
415/// The different kinds of Z3 AST (abstract syntax trees). That is, terms, formulas and types.
416///
417/// This corresponds to `Z3_ast_kind` in the C API.
418#[repr(u32)]
419#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
420pub enum AstKind {
421 /// numeral constants
422 ///
423 /// This corresponds to `Z3_NUMERAL_AST` in the C API.
424 Numeral = generated::Z3_ast_kind::Z3_NUMERAL_AST as u32,
425 /// constant and applications
426 ///
427 /// This corresponds to `Z3_APP_AST` in the C API.
428 App = generated::Z3_ast_kind::Z3_APP_AST as u32,
429 /// bound variables
430 ///
431 /// This corresponds to `Z3_VAR_AST` in the C API.
432 Var = generated::Z3_ast_kind::Z3_VAR_AST as u32,
433 /// quantifiers
434 ///
435 /// This corresponds to `Z3_QUANTIFIER_AST` in the C API.
436 Quantifier = generated::Z3_ast_kind::Z3_QUANTIFIER_AST as u32,
437 /// sort
438 ///
439 /// This corresponds to `Z3_SORT_AST` in the C API.
440 Sort = generated::Z3_ast_kind::Z3_SORT_AST as u32,
441 /// function declaration
442 ///
443 /// This corresponds to `Z3_FUNC_DECL_AST` in the C API.
444 FuncDecl = generated::Z3_ast_kind::Z3_FUNC_DECL_AST as u32,
445 /// internal
446 ///
447 /// This corresponds to `Z3_UNKNOWN_AST` in the C API.
448 Unknown = generated::Z3_ast_kind::Z3_UNKNOWN_AST as u32,
449}
450
451/// The different kinds of interpreted function kinds.
452///
453/// This corresponds to `Z3_decl_kind` in the C API.
454#[repr(u32)]
455#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
456pub enum DeclKind {
457 /// The constant `true`.
458 TRUE = generated::Z3_decl_kind::Z3_OP_TRUE as u32,
459 /// The constant `false`.
460 FALSE = generated::Z3_decl_kind::Z3_OP_FALSE as u32,
461 /// The equality predicate.
462 EQ = generated::Z3_decl_kind::Z3_OP_EQ as u32,
463 /// The n-ary distinct predicate (every argument is mutually distinct).
464 DISTINCT = generated::Z3_decl_kind::Z3_OP_DISTINCT as u32,
465 /// The ternary if-then-else term.
466 ITE = generated::Z3_decl_kind::Z3_OP_ITE as u32,
467 /// n-ary conjunction.
468 AND = generated::Z3_decl_kind::Z3_OP_AND as u32,
469 /// n-ary disjunction.
470 OR = generated::Z3_decl_kind::Z3_OP_OR as u32,
471 /// equivalence (binary).
472 IFF = generated::Z3_decl_kind::Z3_OP_IFF as u32,
473 /// Exclusive or.
474 XOR = generated::Z3_decl_kind::Z3_OP_XOR as u32,
475 /// Negation.
476 NOT = generated::Z3_decl_kind::Z3_OP_NOT as u32,
477 /// Implication.
478 IMPLIES = generated::Z3_decl_kind::Z3_OP_IMPLIES as u32,
479 /// Binary equivalence modulo namings. This binary predicate is used
480 /// in proof terms. It captures equisatisfiability and equivalence
481 /// modulo renamings.
482 OEQ = generated::Z3_decl_kind::Z3_OP_OEQ as u32,
483 /// Arithmetic numeral.
484 ANUM = generated::Z3_decl_kind::Z3_OP_ANUM as u32,
485 /// Arithmetic algebraic numeral. Algebraic numbers are used to
486 /// represent irrational numbers in Z3.
487 AGNUM = generated::Z3_decl_kind::Z3_OP_AGNUM as u32,
488 /// `<=`.
489 LE = generated::Z3_decl_kind::Z3_OP_LE as u32,
490 /// `>=`.
491 GE = generated::Z3_decl_kind::Z3_OP_GE as u32,
492 /// `<`.
493 LT = generated::Z3_decl_kind::Z3_OP_LT as u32,
494 /// `>`.
495 GT = generated::Z3_decl_kind::Z3_OP_GT as u32,
496 /// Addition - Binary.
497 ADD = generated::Z3_decl_kind::Z3_OP_ADD as u32,
498 /// Binary subtraction.
499 SUB = generated::Z3_decl_kind::Z3_OP_SUB as u32,
500 /// Unary minus.
501 UMINUS = generated::Z3_decl_kind::Z3_OP_UMINUS as u32,
502 /// Multiplication - Binary.
503 MUL = generated::Z3_decl_kind::Z3_OP_MUL as u32,
504 /// Division - Binary.
505 DIV = generated::Z3_decl_kind::Z3_OP_DIV as u32,
506 /// Integer division - Binary.
507 IDIV = generated::Z3_decl_kind::Z3_OP_IDIV as u32,
508 /// Remainder - Binary.
509 REM = generated::Z3_decl_kind::Z3_OP_REM as u32,
510 /// Modulus - Binary.
511 MOD = generated::Z3_decl_kind::Z3_OP_MOD as u32,
512 /// Coercion of integer to real - Unary.
513 TO_REAL = generated::Z3_decl_kind::Z3_OP_TO_REAL as u32,
514 /// Coercion of real to integer - Unary.
515 TO_INT = generated::Z3_decl_kind::Z3_OP_TO_INT as u32,
516 /// Check if real is also an integer - Unary.
517 IS_INT = generated::Z3_decl_kind::Z3_OP_IS_INT as u32,
518 /// Power operator `x^y`.
519 POWER = generated::Z3_decl_kind::Z3_OP_POWER as u32,
520 /// Array store. It satisfies `select(store(a,i,v),j) = if i = j then v else select(a,j)`.
521 /// Array store takes at least 3 arguments.
522 STORE = generated::Z3_decl_kind::Z3_OP_STORE as u32,
523 /// Array select.
524 SELECT = generated::Z3_decl_kind::Z3_OP_SELECT as u32,
525 /// The constant array. For example, `select(const(v),i) = v`
526 /// holds for every `v` and `i`. The function is unary.
527 CONST_ARRAY = generated::Z3_decl_kind::Z3_OP_CONST_ARRAY as u32,
528 /// Array map operator.
529 /// It satisfies `map[f](a1,..,a_n)[i] = f(a1[i],...,a_n[i])` for every `i`.
530 ARRAY_MAP = generated::Z3_decl_kind::Z3_OP_ARRAY_MAP as u32,
531 /// Default value of arrays. For example `default(const(v)) = v`. The function is unary.
532 ARRAY_DEFAULT = generated::Z3_decl_kind::Z3_OP_ARRAY_DEFAULT as u32,
533 /// Set union between two Boolean arrays (two arrays whose range
534 /// type is Boolean). The function is binary.
535 SET_UNION = generated::Z3_decl_kind::Z3_OP_SET_UNION as u32,
536 /// Set intersection between two Boolean arrays. The function is binary.
537 SET_INTERSECT = generated::Z3_decl_kind::Z3_OP_SET_INTERSECT as u32,
538 /// Set difference between two Boolean arrays. The function is binary.
539 SET_DIFFERENCE = generated::Z3_decl_kind::Z3_OP_SET_DIFFERENCE as u32,
540 /// Set complement of a Boolean array. The function is unary.
541 SET_COMPLEMENT = generated::Z3_decl_kind::Z3_OP_SET_COMPLEMENT as u32,
542 /// Subset predicate between two Boolean arrays. The relation is binary.
543 SET_SUBSET = generated::Z3_decl_kind::Z3_OP_SET_SUBSET as u32,
544 /// An array value that behaves as the function graph of the
545 /// function passed as parameter.
546 AS_ARRAY = generated::Z3_decl_kind::Z3_OP_AS_ARRAY as u32,
547 /// Array extensionality function. It takes two arrays as arguments and
548 /// produces an index, such that the arrays
549 /// are different if they are different on the index.
550 ARRAY_EXT = generated::Z3_decl_kind::Z3_OP_ARRAY_EXT as u32,
551 /// Bit-vector numeral.
552 BNUM = generated::Z3_decl_kind::Z3_OP_BNUM as u32,
553 /// One bit bit-vector.
554 BIT1 = generated::Z3_decl_kind::Z3_OP_BIT1 as u32,
555 /// Zero bit bit-vector.
556 BIT0 = generated::Z3_decl_kind::Z3_OP_BIT0 as u32,
557 /// Unary minus.
558 BNEG = generated::Z3_decl_kind::Z3_OP_BNEG as u32,
559 /// Binary addition.
560 BADD = generated::Z3_decl_kind::Z3_OP_BADD as u32,
561 /// Binary subtraction.
562 BSUB = generated::Z3_decl_kind::Z3_OP_BSUB as u32,
563 /// Binary multiplication.
564 BMUL = generated::Z3_decl_kind::Z3_OP_BMUL as u32,
565 /// Binary signed division.
566 BSDIV = generated::Z3_decl_kind::Z3_OP_BSDIV as u32,
567 /// Binary unsigned division.
568 BUDIV = generated::Z3_decl_kind::Z3_OP_BUDIV as u32,
569 /// Binary signed remainder.
570 BSREM = generated::Z3_decl_kind::Z3_OP_BSREM as u32,
571 /// Binary unsigned remainder.
572 BUREM = generated::Z3_decl_kind::Z3_OP_BUREM as u32,
573 /// Binary signed modulus.
574 BSMOD = generated::Z3_decl_kind::Z3_OP_BSMOD as u32,
575 /// Unary function. `bsdiv(x, 0)` is congruent to `bsdiv0(x)`.
576 BSDIV0 = generated::Z3_decl_kind::Z3_OP_BSDIV0 as u32,
577 /// Unary function. `budiv(x, 0)` is congruent to `budiv0(x)`.
578 BUDIV0 = generated::Z3_decl_kind::Z3_OP_BUDIV0 as u32,
579 /// Unary function. `bsrem(x, 0)` is congruent to `bsrem0(x)`.
580 BSREM0 = generated::Z3_decl_kind::Z3_OP_BSREM0 as u32,
581 /// Unary function. `burem(x, 0)` is congruent to `burem0(x)`.
582 BUREM0 = generated::Z3_decl_kind::Z3_OP_BUREM0 as u32,
583 /// Unary function. `bsmod(x, 0)` is congruent to `bsmod0(x)`.
584 BSMOD0 = generated::Z3_decl_kind::Z3_OP_BSMOD0 as u32,
585 /// Unsigned bit-vector <= - Binary relation.
586 ULEQ = generated::Z3_decl_kind::Z3_OP_ULEQ as u32,
587 /// Signed bit-vector <= - Binary relation.
588 SLEQ = generated::Z3_decl_kind::Z3_OP_SLEQ as u32,
589 /// Unsigned bit-vector >= - Binary relation.
590 UGEQ = generated::Z3_decl_kind::Z3_OP_UGEQ as u32,
591 /// Signed bit-vector >= - Binary relation.
592 SGEQ = generated::Z3_decl_kind::Z3_OP_SGEQ as u32,
593 /// Unsigned bit-vector < - Binary relation.
594 ULT = generated::Z3_decl_kind::Z3_OP_ULT as u32,
595 /// Signed bit-vector < - Binary relation.
596 SLT = generated::Z3_decl_kind::Z3_OP_SLT as u32,
597 /// Unsigned bit-vector > - Binary relation.
598 UGT = generated::Z3_decl_kind::Z3_OP_UGT as u32,
599 /// Signed bit-vector > - Binary relation.
600 SGT = generated::Z3_decl_kind::Z3_OP_SGT as u32,
601 /// Bit-wise and - Binary.
602 BAND = generated::Z3_decl_kind::Z3_OP_BAND as u32,
603 /// Bit-wise or - Binary.
604 BOR = generated::Z3_decl_kind::Z3_OP_BOR as u32,
605 /// Bit-wise not - Unary.
606 BNOT = generated::Z3_decl_kind::Z3_OP_BNOT as u32,
607 /// Bit-wise xor - Binary.
608 BXOR = generated::Z3_decl_kind::Z3_OP_BXOR as u32,
609 /// Bit-wise nand - Binary.
610 BNAND = generated::Z3_decl_kind::Z3_OP_BNAND as u32,
611 /// Bit-wise nor - Binary.
612 BNOR = generated::Z3_decl_kind::Z3_OP_BNOR as u32,
613 /// Bit-wise xnor - Binary.
614 BXNOR = generated::Z3_decl_kind::Z3_OP_BXNOR as u32,
615 /// Bit-vector concatenation - Binary.
616 CONCAT = generated::Z3_decl_kind::Z3_OP_CONCAT as u32,
617 /// Bit-vector sign extension.
618 SIGN_EXT = generated::Z3_decl_kind::Z3_OP_SIGN_EXT as u32,
619 /// Bit-vector zero extension.
620 ZERO_EXT = generated::Z3_decl_kind::Z3_OP_ZERO_EXT as u32,
621 /// Bit-vector extraction.
622 EXTRACT = generated::Z3_decl_kind::Z3_OP_EXTRACT as u32,
623 /// Repeat bit-vector n times.
624 REPEAT = generated::Z3_decl_kind::Z3_OP_REPEAT as u32,
625 /// Bit-vector reduce or - Unary.
626 BREDOR = generated::Z3_decl_kind::Z3_OP_BREDOR as u32,
627 /// Bit-vector reduce and - Unary.
628 BREDAND = generated::Z3_decl_kind::Z3_OP_BREDAND as u32,
629 BCOMP = generated::Z3_decl_kind::Z3_OP_BCOMP as u32,
630 /// Shift left.
631 BSHL = generated::Z3_decl_kind::Z3_OP_BSHL as u32,
632 /// Logical shift right.
633 BLSHR = generated::Z3_decl_kind::Z3_OP_BLSHR as u32,
634 /// Arithmetical shift right.
635 BASHR = generated::Z3_decl_kind::Z3_OP_BASHR as u32,
636 /// Left rotation.
637 ROTATE_LEFT = generated::Z3_decl_kind::Z3_OP_ROTATE_LEFT as u32,
638 /// Right rotation.
639 ROTATE_RIGHT = generated::Z3_decl_kind::Z3_OP_ROTATE_RIGHT as u32,
640 /// (extended) Left rotation. Similar to `DeclKind::ROTATE_LEFT`,
641 /// but it is a binary operator instead of a parametric one.
642 EXT_ROTATE_LEFT = generated::Z3_decl_kind::Z3_OP_EXT_ROTATE_LEFT as u32,
643 /// (extended) Right rotation. Similar to `DeclKind::ROTATE_RIGHT`,
644 /// but it is a binary operator instead of a parametric one.
645 EXT_ROTATE_RIGHT = generated::Z3_decl_kind::Z3_OP_EXT_ROTATE_RIGHT as u32,
646 BIT2BOOL = generated::Z3_decl_kind::Z3_OP_BIT2BOOL as u32,
647 /// Coerce integer to bit-vector.
648 ///
649 /// NB. This function is not supported by the decision procedures.
650 /// Only the most rudimentary simplification rules are applied to
651 /// this function.
652 INT2BV = generated::Z3_decl_kind::Z3_OP_INT2BV as u32,
653 /// Coerce bit-vector to integer.
654 ///
655 /// NB. This function is not supported by the decision procedures.
656 /// Only the most rudimentary simplification rules are applied to
657 /// this function.
658 BV2INT = generated::Z3_decl_kind::Z3_OP_BV2INT as u32,
659 /// Compute the carry bit in a full-adder.
660 /// The meaning is given by the equivalence:
661 ///
662 /// ```text
663 /// (carry l1 l2 l3) <=> (or (and l1 l2) (and l1 l3) (and l2 l3)))
664 /// ```
665 CARRY = generated::Z3_decl_kind::Z3_OP_CARRY as u32,
666 /// Compute ternary XOR.
667 ///
668 /// The meaning is given by the equivalence:
669 ///
670 /// ```text
671 /// (xor3 l1 l2 l3) <=> (xor (xor l1 l2) l3)
672 /// ```
673 XOR3 = generated::Z3_decl_kind::Z3_OP_XOR3 as u32,
674 /// Check that bit-wise signed multiplication does not overflow.
675 ///
676 /// Signed multiplication overflows if the operands have the
677 /// same sign and the result of multiplication does not fit
678 /// within the available bits.
679 ///
680 /// # See also:
681 ///
682 /// - [`Z3_mk_bvmul_no_overflow`]
683 BSMUL_NO_OVFL = generated::Z3_decl_kind::Z3_OP_BSMUL_NO_OVFL as u32,
684 /// Check that bit-wise unsigned multiplication does not overflow.
685 ///
686 /// Unsigned multiplication overflows if the result does not fit
687 /// within the available bits.
688 ///
689 /// # See also:
690 ///
691 /// - [`Z3_mk_bvmul_no_overflow`]
692 BUMUL_NO_OVFL = generated::Z3_decl_kind::Z3_OP_BUMUL_NO_OVFL as u32,
693 /// Check that bit-wise signed multiplication does not underflow.
694 ///
695 /// Signed multiplication underflows if the operands have opposite
696 /// signs and the result of multiplication does not fit within the
697 /// available bits.
698 ///
699 /// # See also:
700 ///
701 /// - [`Z3_mk_bvmul_no_underflow`]
702 BSMUL_NO_UDFL = generated::Z3_decl_kind::Z3_OP_BSMUL_NO_UDFL as u32,
703 /// Binary signed division.
704 ///
705 /// It has the same semantics as `DeclKind::BSDIV`, but created in
706 /// a context where the second operand can be assumed to be non-zero.
707 BSDIV_I = generated::Z3_decl_kind::Z3_OP_BSDIV_I as u32,
708 /// Binary unsigned division.
709 ///
710 /// It has the same semantics as `DeclKind::BUDIV`, but created in a
711 /// context where the second operand can be assumed to be non-zero.
712 BUDIV_I = generated::Z3_decl_kind::Z3_OP_BUDIV_I as u32,
713 /// Binary signed remainder.
714 ///
715 /// It has the same semantics as `DeclKind::BSREM`, but created in a
716 /// context where the second operand can be assumed to be non-zero.
717 BSREM_I = generated::Z3_decl_kind::Z3_OP_BSREM_I as u32,
718 /// Binary unsigned remainder.
719 ///
720 /// It has the same semantics as `DeclKind::BUREM`, but created in a
721 /// context where the second operand can be assumed to be non-zero.
722 BUREM_I = generated::Z3_decl_kind::Z3_OP_BUREM_I as u32,
723 /// Binary signed modulus.
724 ///
725 /// It has the same semantics as `DeclKind::BSMOD`, but created in a
726 /// context where the second operand can be assumed to be non-zero.
727 BSMOD_I = generated::Z3_decl_kind::Z3_OP_BSMOD_I as u32,
728 /// Undef/Null proof object.
729 PR_UNDEF = generated::Z3_decl_kind::Z3_OP_PR_UNDEF as u32,
730 /// Proof for the expression 'true'.
731 PR_TRUE = generated::Z3_decl_kind::Z3_OP_PR_TRUE as u32,
732 /// Proof for a fact asserted by the user.
733 PR_ASSERTED = generated::Z3_decl_kind::Z3_OP_PR_ASSERTED as u32,
734 /// Proof for a fact (tagged as goal) asserted by the user.
735 PR_GOAL = generated::Z3_decl_kind::Z3_OP_PR_GOAL as u32,
736 /// Given a proof for p and a proof for (implies p q), produces a proof for q.
737 ///
738 /// ```text
739 /// T1: p
740 /// T2: (implies p q)
741 /// [mp T1 T2]: q
742 /// ```
743 ///
744 /// The second antecedents may also be a proof for `(iff p q)`.
745 PR_MODUS_PONENS = generated::Z3_decl_kind::Z3_OP_PR_MODUS_PONENS as u32,
746 /// A proof for `(R t t)`, where `R` is a reflexive relation.
747 ///
748 /// This proof object has no antecedents.
749 ///
750 /// The only reflexive relations that are used are
751 /// equivalence modulo namings, equality and equivalence.
752 /// That is, `R` is either `~`, `=` or `iff`.
753 PR_REFLEXIVITY = generated::Z3_decl_kind::Z3_OP_PR_REFLEXIVITY as u32,
754 /// Given an symmetric relation `R` and a proof for `(R t s)`,
755 /// produces a proof for `(R s t)`.
756 ///
757 /// ```text
758 /// T1: (R t s)
759 /// [symmetry T1]: (R s t)
760 /// ```
761 ///
762 /// `T1` is the antecedent of this proof object.
763 PR_SYMMETRY = generated::Z3_decl_kind::Z3_OP_PR_SYMMETRY as u32,
764 /// Given a transitive relation `R`, and proofs for `(R t s)` and
765 /// `(R s u)`, produces a proof for `(R t u)`.
766 ///
767 /// ```text
768 /// T1: (R t s)
769 /// T2: (R s u)
770 /// [trans T1 T2]: (R t u)
771 /// ```
772 PR_TRANSITIVITY = generated::Z3_decl_kind::Z3_OP_PR_TRANSITIVITY as u32,
773 /// Condensed transitivity proof.
774 ///
775 /// It combines several symmetry and transitivity proofs.
776 ///
777 /// Example:
778 ///
779 /// ```text
780 /// T1: (R a b)
781 /// T2: (R c b)
782 /// T3: (R c d)
783 /// [trans* T1 T2 T3]: (R a d)
784 /// ```
785 ///
786 /// `R` must be a symmetric and transitive relation.
787 ///
788 /// Assuming that this proof object is a proof for `(R s t)`, then
789 /// a proof checker must check if it is possible to prove `(R s t)`
790 /// using the antecedents, symmetry and transitivity. That is,
791 /// if there is a path from `s` to `t`, if we view every
792 /// antecedent `(R a b)` as an edge between `a` and `b`.
793 PR_TRANSITIVITY_STAR = generated::Z3_decl_kind::Z3_OP_PR_TRANSITIVITY_STAR as u32,
794 /// Monotonicity proof object.
795 ///
796 /// ```text
797 /// T1: (R t_1 s_1)
798 /// ...
799 /// Tn: (R t_n s_n)
800 /// [monotonicity T1 ... Tn]: (R (f t_1 ... t_n) (f s_1 ... s_n))
801 /// ```
802 ///
803 /// Remark: if `t_i == s_i`, then the antecedent `Ti` is suppressed.
804 /// That is, reflexivity proofs are suppressed to save space.
805 PR_MONOTONICITY = generated::Z3_decl_kind::Z3_OP_PR_MONOTONICITY as u32,
806 /// Given a proof for `(~ p q)`, produces a proof for
807 /// `(~ (forall (x) p) (forall (x) q))`.
808 ///
809 /// ```text
810 /// T1: (~ p q)
811 /// [quant-intro T1]: (~ (forall (x) p) (forall (x) q))
812 /// ```
813 PR_QUANT_INTRO = generated::Z3_decl_kind::Z3_OP_PR_QUANT_INTRO as u32,
814
815 /// Given a proof `p`, produces a proof of `lambda x . p`, where `x` are free
816 /// variables in `p`.
817 ///
818 /// ```text
819 /// T1: f
820 /// [proof-bind T1] forall (x) f
821 /// ```
822 PR_BIND = generated::Z3_decl_kind::Z3_OP_PR_BIND as u32,
823 /// Distributivity proof object.
824 ///
825 /// Given that `f (= or)` distributes over `g (= and)`, produces a proof for
826 ///
827 /// ```text
828 /// (= (f a (g c d))
829 /// (g (f a c) (f a d)))
830 /// ```
831 ///
832 /// If `f` and `g` are associative, this proof also justifies the following equality:
833 ///
834 /// ```text
835 /// (= (f (g a b) (g c d))
836 /// (g (f a c) (f a d) (f b c) (f b d)))
837 /// ```
838 ///
839 /// where each `f` and `g` can have arbitrary number of arguments.
840 ///
841 /// This proof object has no antecedents.
842 ///
843 /// Remark: This rule is used by the CNF conversion pass and
844 /// instantiated by `f = or`, and `g = and`.
845 PR_DISTRIBUTIVITY = generated::Z3_decl_kind::Z3_OP_PR_DISTRIBUTIVITY as u32,
846 /// Given a proof for `(and l_1 ... l_n)`, produces a proof
847 /// for `l_i`.
848 ///
849 /// ```text
850 /// T1: (and l_1 ... l_n)
851 /// [and-elim T1]: l_i
852 /// ```
853 PR_AND_ELIM = generated::Z3_decl_kind::Z3_OP_PR_AND_ELIM as u32,
854 /// Given a proof for `(not (or l_1 ... l_n))`, produces a
855 /// proof for `(not l_i)`.
856 ///
857 /// ```text
858 /// T1: (not (or l_1 ... l_n))
859 /// [not-or-elim T1]: (not l_i)
860 /// ```
861 PR_NOT_OR_ELIM = generated::Z3_decl_kind::Z3_OP_PR_NOT_OR_ELIM as u32,
862 /// A proof for a local rewriting step `(= t s)`.
863 ///
864 /// The head function symbol of `t` is interpreted.
865 ///
866 /// This proof object has no antecedents.
867 ///
868 /// The conclusion of a rewrite rule is either an equality `(= t s)`,
869 /// an equivalence `(iff t s)`, or equi-satisfiability `(~ t s)`.
870 ///
871 /// Remark: if `f` is `bool`, then `=` is `iff`.
872 ///
873 /// Examples:
874 ///
875 /// ```text
876 /// (= (+ x 0) x)
877 /// (= (+ x 1 2) (+ 3 x))
878 /// (iff (or x false) x)
879 /// ```
880 PR_REWRITE = generated::Z3_decl_kind::Z3_OP_PR_REWRITE as u32,
881 /// A proof for rewriting an expression `t` into an expression `s`.
882 ///
883 /// This proof object can have `n` antecedents. The antecedents are
884 /// proofs for equalities used as substitution rules.
885 ///
886 /// The object is also used in a few cases. The cases are:
887 ///
888 /// - When applying contextual simplification `(CONTEXT_SIMPLIFIER=true)`.
889 /// - When converting bit-vectors to Booleans `(BIT2BOOL=true)`.
890 PR_REWRITE_STAR = generated::Z3_decl_kind::Z3_OP_PR_REWRITE_STAR as u32,
891 /// A proof for `(iff (f (forall (x) q(x)) r) (forall (x) (f (q x) r)))`.
892 ///
893 /// This proof object has no antecedents.
894 PR_PULL_QUANT = generated::Z3_decl_kind::Z3_OP_PR_PULL_QUANT as u32,
895 /// A proof for:
896 ///
897 /// ```text
898 /// (iff (forall (x_1 ... x_m) (and p_1[x_1 ... x_m] ... p_n[x_1 ... x_m]))
899 /// (and (forall (x_1 ... x_m) p_1[x_1 ... x_m])
900 /// ...
901 /// (forall (x_1 ... x_m) p_n[x_1 ... x_m])))
902 /// ```
903 ///
904 /// This proof object has no antecedents.
905 PR_PUSH_QUANT = generated::Z3_decl_kind::Z3_OP_PR_PUSH_QUANT as u32,
906 /// A proof for
907 ///
908 /// ```text
909 /// (iff (forall (x_1 ... x_n y_1 ... y_m) p[x_1 ... x_n])
910 /// (forall (x_1 ... x_n) p[x_1 ... x_n]))
911 /// ```
912 ///
913 /// It is used to justify the elimination of unused variables.
914 ///
915 /// This proof object has no antecedents.
916 PR_ELIM_UNUSED_VARS = generated::Z3_decl_kind::Z3_OP_PR_ELIM_UNUSED_VARS as u32,
917 /// A proof for destructive equality resolution:
918 ///
919 /// ```text
920 /// (iff (forall (x) (or (not (= x t)) P[x])) P[t])
921 /// ```
922 ///
923 /// if `x` does not occur in `t`.
924 ///
925 /// This proof object has no antecedents.
926 ///
927 /// Several variables can be eliminated simultaneously.
928 PR_DER = generated::Z3_decl_kind::Z3_OP_PR_DER as u32,
929 /// A proof of `(or (not (forall (x) (P x))) (P a))`.
930 PR_QUANT_INST = generated::Z3_decl_kind::Z3_OP_PR_QUANT_INST as u32,
931 /// Mark a hypothesis in a natural deduction style proof.
932 PR_HYPOTHESIS = generated::Z3_decl_kind::Z3_OP_PR_HYPOTHESIS as u32,
933 /// ```text
934 /// T1: false
935 /// [lemma T1]: (or (not l_1) ... (not l_n))
936 /// ```
937 ///
938 /// This proof object has one antecedent: a hypothetical proof for false.
939 ///
940 /// It converts the proof in a proof for `(or (not l_1) ... (not l_n))`,
941 /// when `T1` contains the open hypotheses: `l_1, ..., l_n`.
942 ///
943 /// The hypotheses are closed after an application of a lemma.
944 ///
945 /// Furthermore, there are no other open hypotheses in the subtree covered by
946 /// the lemma.
947 PR_LEMMA = generated::Z3_decl_kind::Z3_OP_PR_LEMMA as u32,
948 /// ```text
949 /// T1: (or l_1 ... l_n l_1' ... l_m')
950 /// T2: (not l_1)
951 /// ...
952 /// T(n+1): (not l_n)
953 /// [unit-resolution T1 ... T(n+1)]: (or l_1' ... l_m')
954 /// ```
955 PR_UNIT_RESOLUTION = generated::Z3_decl_kind::Z3_OP_PR_UNIT_RESOLUTION as u32,
956 /// ```text
957 /// T1: p
958 /// [iff-true T1]: (iff p true)
959 /// ```
960 PR_IFF_TRUE = generated::Z3_decl_kind::Z3_OP_PR_IFF_TRUE as u32,
961 /// ```text
962 /// T1: (not p)
963 /// [iff-false T1]: (iff p false)
964 /// ```
965 PR_IFF_FALSE = generated::Z3_decl_kind::Z3_OP_PR_IFF_FALSE as u32,
966 /// ```text
967 /// [comm]: (= (f a b) (f b a))
968 /// ```
969 ///
970 /// `f` is a commutative operator.
971 ///
972 /// This proof object has no antecedents.
973 ///
974 /// Remark: if `f` is `bool`, then `=` is `iff`.
975 PR_COMMUTATIVITY = generated::Z3_decl_kind::Z3_OP_PR_COMMUTATIVITY as u32,
976 /// Proof object used to justify Tseitin's like axioms:
977 ///
978 /// ```text
979 /// (or (not (and p q)) p)
980 /// (or (not (and p q)) q)
981 /// (or (not (and p q r)) p)
982 /// (or (not (and p q r)) q)
983 /// (or (not (and p q r)) r)
984 /// ...
985 /// (or (and p q) (not p) (not q))
986 /// (or (not (or p q)) p q)
987 /// (or (or p q) (not p))
988 /// (or (or p q) (not q))
989 /// (or (not (iff p q)) (not p) q)
990 /// (or (not (iff p q)) p (not q))
991 /// (or (iff p q) (not p) (not q))
992 /// (or (iff p q) p q)
993 /// (or (not (ite a b c)) (not a) b)
994 /// (or (not (ite a b c)) a c)
995 /// (or (ite a b c) (not a) (not b))
996 /// (or (ite a b c) a (not c))
997 /// (or (not (not a)) (not a))
998 /// (or (not a) a)
999 /// ```
1000 ///
1001 /// This proof object has no antecedents.
1002 ///
1003 /// Note: all axioms are propositional tautologies.
1004 /// Note also that `and` and `or` can take multiple arguments.
1005 /// You can recover the propositional tautologies by
1006 /// unfolding the Boolean connectives in the axioms a small
1007 /// bounded number of steps `(=3)`.
1008 PR_DEF_AXIOM = generated::Z3_decl_kind::Z3_OP_PR_DEF_AXIOM as u32,
1009 /// Introduces a name for a formula/term.
1010 ///
1011 /// Suppose `e` is an expression with free variables `x`, and
1012 /// `def-intro` introduces the name `n(x)`. The possible cases are:
1013 ///
1014 /// When e is of Boolean type:
1015 ///
1016 /// ```text
1017 /// [def-intro]: (and (or n (not e)) (or (not n) e))
1018 /// ```
1019 ///
1020 /// or:
1021 ///
1022 /// ```text
1023 /// [def-intro]: (or (not n) e)
1024 /// ```
1025 ///
1026 /// when e only occurs positively.
1027 ///
1028 /// When e is of the form `(ite cond th el)`:
1029 ///
1030 /// ```text
1031 /// [def-intro]: (and (or (not cond) (= n th)) (or cond (= n el)))
1032 /// ```
1033 ///
1034 /// Otherwise:
1035 ///
1036 /// ```text
1037 /// [def-intro]: (= n e)
1038 /// ```
1039 PR_DEF_INTRO = generated::Z3_decl_kind::Z3_OP_PR_DEF_INTRO as u32,
1040 /// ```text
1041 /// [apply-def T1]: F ~ n
1042 /// ```
1043 ///
1044 /// `F` is 'equivalent' to `n`, given that `T1` is a proof that
1045 /// `n` is a name for `F`.
1046 PR_APPLY_DEF = generated::Z3_decl_kind::Z3_OP_PR_APPLY_DEF as u32,
1047 /// ```text
1048 /// T1: (iff p q)
1049 /// [iff~ T1]: (~ p q)
1050 /// ```
1051 PR_IFF_OEQ = generated::Z3_decl_kind::Z3_OP_PR_IFF_OEQ as u32,
1052 /// Proof for a (positive) NNF step. Example:
1053 ///
1054 /// ```text
1055 /// T1: (not s_1) ~ r_1
1056 /// T2: (not s_2) ~ r_2
1057 /// T3: s_1 ~ r_1'
1058 /// T4: s_2 ~ r_2'
1059 /// [nnf-pos T1 T2 T3 T4]: (~ (iff s_1 s_2)
1060 /// (and (or r_1 r_2') (or r_1' r_2)))
1061 /// ```
1062 ///
1063 /// The negation normal form steps `NNF_POS` and `NNF_NEG` are used in the
1064 /// following cases:
1065 ///
1066 /// - When creating the NNF of a positive force quantifier.
1067 /// The quantifier is retained (unless the bound variables are eliminated).
1068 /// Example:
1069 /// ```text
1070 /// T1: q ~ q_new
1071 /// [nnf-pos T1]: (~ (forall (x T) q) (forall (x T) q_new))
1072 /// ```
1073 /// - When recursively creating NNF over Boolean formulas, where the top-level
1074 /// connective is changed during NNF conversion. The relevant Boolean connectives
1075 /// for `NNF_POS` are `implies`, `iff`, `xor`, `ite`.
1076 /// `NNF_NEG` furthermore handles the case where negation is pushed
1077 /// over Boolean connectives `and` and `or`.
1078 PR_NNF_POS = generated::Z3_decl_kind::Z3_OP_PR_NNF_POS as u32,
1079 /// Proof for a (negative) NNF step. Examples:
1080 ///
1081 /// ```text
1082 /// T1: (not s_1) ~ r_1
1083 /// ...
1084 /// Tn: (not s_n) ~ r_n
1085 /// [nnf-neg T1 ... Tn]: (not (and s_1 ... s_n)) ~ (or r_1 ... r_n)
1086 /// ```
1087 ///
1088 /// and
1089 ///
1090 /// ```text
1091 /// T1: (not s_1) ~ r_1
1092 /// ...
1093 /// Tn: (not s_n) ~ r_n
1094 /// [nnf-neg T1 ... Tn]: (not (or s_1 ... s_n)) ~ (and r_1 ... r_n)
1095 /// ```
1096 ///
1097 /// and
1098 ///
1099 /// ```text
1100 /// T1: (not s_1) ~ r_1
1101 /// T2: (not s_2) ~ r_2
1102 /// T3: s_1 ~ r_1'
1103 /// T4: s_2 ~ r_2'
1104 /// [nnf-neg T1 T2 T3 T4]: (~ (not (iff s_1 s_2))
1105 /// (and (or r_1 r_2) (or r_1' r_2')))
1106 /// ```
1107 PR_NNF_NEG = generated::Z3_decl_kind::Z3_OP_PR_NNF_NEG as u32,
1108 /// Proof for:
1109 ///
1110 /// ```text
1111 /// [sk]: (~ (not (forall x (p x y))) (not (p (sk y) y)))
1112 /// [sk]: (~ (exists x (p x y)) (p (sk y) y))
1113 /// ```
1114 ///
1115 /// This proof object has no antecedents.
1116 PR_SKOLEMIZE = generated::Z3_decl_kind::Z3_OP_PR_SKOLEMIZE as u32,
1117 /// Modus ponens style rule for equi-satisfiability.
1118 ///
1119 /// ```text
1120 /// T1: p
1121 /// T2: (~ p q)
1122 /// [mp~ T1 T2]: q
1123 /// ```
1124 PR_MODUS_PONENS_OEQ = generated::Z3_decl_kind::Z3_OP_PR_MODUS_PONENS_OEQ as u32,
1125 /// Generic proof for theory lemmas.
1126 ///
1127 /// The theory lemma function comes with one or more parameters.
1128 ///
1129 /// The first parameter indicates the name of the theory.
1130 ///
1131 /// For the theory of arithmetic, additional parameters provide hints for
1132 /// checking the theory lemma.
1133 ///
1134 /// The hints for arithmetic are:
1135 ///
1136 /// - `farkas` - followed by rational coefficients. Multiply the coefficients to the
1137 /// inequalities in the lemma, add the (negated) inequalities and obtain a contradiction.
1138 /// - `triangle-eq` - Indicates a lemma related to the equivalence:
1139 /// ```text
1140 /// (iff (= t1 t2) (and (<= t1 t2) (<= t2 t1)))
1141 /// ```
1142 /// - `gcd-test` - Indicates an integer linear arithmetic lemma that uses a gcd test.
1143 PR_TH_LEMMA = generated::Z3_decl_kind::Z3_OP_PR_TH_LEMMA as u32,
1144 /// Hyper-resolution rule.
1145 ///
1146 /// The premises of the rules is a sequence of clauses.
1147 /// The first clause argument is the main clause of the rule.
1148 /// with a literal from the first (main) clause.
1149 ///
1150 /// Premises of the rules are of the form
1151 ///
1152 /// ```text
1153 /// (or l0 l1 l2 .. ln)
1154 /// ```
1155 ///
1156 /// or
1157 ///
1158 /// ```text
1159 /// (=> (and l1 l2 .. ln) l0)
1160 /// ```
1161 ///
1162 /// or in the most general (ground) form:
1163 ///
1164 /// ```text
1165 /// (=> (and ln+1 ln+2 .. ln+m) (or l0 l1 .. ln))
1166 /// ```
1167 ///
1168 /// In other words we use the following (Prolog style) convention for Horn
1169 /// implications:
1170 ///
1171 /// - the head of a Horn implication is position 0,
1172 /// - the first conjunct in the body of an implication is position 1
1173 /// - the second conjunct in the body of an implication is position 2
1174 ///
1175 /// For general implications where the head is a disjunction, the
1176 /// first n positions correspond to the n disjuncts in the head.
1177 /// The next m positions correspond to the m conjuncts in the body.
1178 ///
1179 /// The premises can be universally quantified so that the most
1180 /// general non-ground form is:
1181 ///
1182 /// ```text
1183 /// (forall (vars) (=> (and ln+1 ln+2 .. ln+m) (or l0 l1 .. ln)))
1184 /// ```
1185 ///
1186 /// The hyper-resolution rule takes a sequence of parameters.
1187 /// The parameters are substitutions of bound variables separated by pairs
1188 /// of literal positions from the main clause and side clause.
1189 PR_HYPER_RESOLVE = generated::Z3_decl_kind::Z3_OP_PR_HYPER_RESOLVE as u32,
1190 /// Insert a record into a relation.
1191 ///
1192 /// The function takes `n`+1 arguments, where the first argument
1193 /// is the relation and the remaining `n` elements
1194 /// correspond to the `n` columns of the relation.
1195 RA_STORE = generated::Z3_decl_kind::Z3_OP_RA_STORE as u32,
1196 /// Creates the empty relation.
1197 RA_EMPTY = generated::Z3_decl_kind::Z3_OP_RA_EMPTY as u32,
1198 /// Tests if the relation is empty.
1199 RA_IS_EMPTY = generated::Z3_decl_kind::Z3_OP_RA_IS_EMPTY as u32,
1200 /// Create the relational join.
1201 RA_JOIN = generated::Z3_decl_kind::Z3_OP_RA_JOIN as u32,
1202 /// Create the union or convex hull of two relations.
1203 ///
1204 /// The function takes two arguments.
1205 RA_UNION = generated::Z3_decl_kind::Z3_OP_RA_UNION as u32,
1206 /// Widen two relations.
1207 ///
1208 /// The function takes two arguments.
1209 RA_WIDEN = generated::Z3_decl_kind::Z3_OP_RA_WIDEN as u32,
1210 /// Project the columns (provided as numbers in the parameters).
1211 ///
1212 /// The function takes one argument.
1213 RA_PROJECT = generated::Z3_decl_kind::Z3_OP_RA_PROJECT as u32,
1214 /// Filter (restrict) a relation with respect to a predicate.
1215 ///
1216 /// The first argument is a relation.
1217 ///
1218 /// The second argument is a predicate with free de-Bruijn indices
1219 /// corresponding to the columns of the relation.
1220 ///
1221 /// So the first column in the relation has index 0.
1222 RA_FILTER = generated::Z3_decl_kind::Z3_OP_RA_FILTER as u32,
1223 /// Intersect the first relation with respect to negation
1224 /// of the second relation (the function takes two arguments).
1225 ///
1226 /// Logically, the specification can be described by a function
1227 ///
1228 /// ```text
1229 /// target = filter_by_negation(pos, neg, columns)
1230 /// ```
1231 ///
1232 /// where columns are pairs `c1`, `d1`, .., `cN`, `dN` of columns
1233 /// from `pos` and `neg`, such that target are elements in `x` in `pos`,
1234 /// such that there is no `y` in `neg` that agrees with
1235 /// `x` on the columns `c1`, `d1`, .., `cN`, `dN`.
1236 RA_NEGATION_FILTER = generated::Z3_decl_kind::Z3_OP_RA_NEGATION_FILTER as u32,
1237 /// Rename columns in the relation.
1238 ///
1239 /// The function takes one argument.
1240 ///
1241 /// The parameters contain the renaming as a cycle.
1242 RA_RENAME = generated::Z3_decl_kind::Z3_OP_RA_RENAME as u32,
1243 /// Complement the relation.
1244 RA_COMPLEMENT = generated::Z3_decl_kind::Z3_OP_RA_COMPLEMENT as u32,
1245 /// Check if a record is an element of the relation.
1246 ///
1247 /// The function takes `n`+1 arguments, where the first argument is a relation,
1248 /// and the remaining `n` arguments correspond to a record.
1249 RA_SELECT = generated::Z3_decl_kind::Z3_OP_RA_SELECT as u32,
1250 /// Create a fresh copy (clone) of a relation.
1251 ///
1252 /// The function is logically the identity, but
1253 /// in the context of a register machine allows
1254 /// for [`DeclKind::RA_UNION`]
1255 /// to perform destructive updates to the first argument.
1256 RA_CLONE = generated::Z3_decl_kind::Z3_OP_RA_CLONE as u32,
1257 FD_CONSTANT = generated::Z3_decl_kind::Z3_OP_FD_CONSTANT as u32,
1258 /// A less than predicate over the finite domain `SortKind::FiniteDomain`.
1259 FD_LT = generated::Z3_decl_kind::Z3_OP_FD_LT as u32,
1260 SEQ_UNIT = generated::Z3_decl_kind::Z3_OP_SEQ_UNIT as u32,
1261 SEQ_EMPTY = generated::Z3_decl_kind::Z3_OP_SEQ_EMPTY as u32,
1262 SEQ_CONCAT = generated::Z3_decl_kind::Z3_OP_SEQ_CONCAT as u32,
1263 SEQ_PREFIX = generated::Z3_decl_kind::Z3_OP_SEQ_PREFIX as u32,
1264 SEQ_SUFFIX = generated::Z3_decl_kind::Z3_OP_SEQ_SUFFIX as u32,
1265 SEQ_CONTAINS = generated::Z3_decl_kind::Z3_OP_SEQ_CONTAINS as u32,
1266 SEQ_EXTRACT = generated::Z3_decl_kind::Z3_OP_SEQ_EXTRACT as u32,
1267 SEQ_REPLACE = generated::Z3_decl_kind::Z3_OP_SEQ_REPLACE as u32,
1268 SEQ_AT = generated::Z3_decl_kind::Z3_OP_SEQ_AT as u32,
1269 SEQ_LENGTH = generated::Z3_decl_kind::Z3_OP_SEQ_LENGTH as u32,
1270 SEQ_INDEX = generated::Z3_decl_kind::Z3_OP_SEQ_INDEX as u32,
1271 SEQ_TO_RE = generated::Z3_decl_kind::Z3_OP_SEQ_TO_RE as u32,
1272 SEQ_IN_RE = generated::Z3_decl_kind::Z3_OP_SEQ_IN_RE as u32,
1273 STR_TO_INT = generated::Z3_decl_kind::Z3_OP_STR_TO_INT as u32,
1274 INT_TO_STR = generated::Z3_decl_kind::Z3_OP_INT_TO_STR as u32,
1275 RE_PLUS = generated::Z3_decl_kind::Z3_OP_RE_PLUS as u32,
1276 RE_STAR = generated::Z3_decl_kind::Z3_OP_RE_STAR as u32,
1277 RE_OPTION = generated::Z3_decl_kind::Z3_OP_RE_OPTION as u32,
1278 RE_CONCAT = generated::Z3_decl_kind::Z3_OP_RE_CONCAT as u32,
1279 RE_UNION = generated::Z3_decl_kind::Z3_OP_RE_UNION as u32,
1280 RE_RANGE = generated::Z3_decl_kind::Z3_OP_RE_RANGE as u32,
1281 RE_LOOP = generated::Z3_decl_kind::Z3_OP_RE_LOOP as u32,
1282 RE_INTERSECT = generated::Z3_decl_kind::Z3_OP_RE_INTERSECT as u32,
1283 RE_EMPTY_SET = generated::Z3_decl_kind::Z3_OP_RE_EMPTY_SET as u32,
1284 RE_FULL_SET = generated::Z3_decl_kind::Z3_OP_RE_FULL_SET as u32,
1285 RE_COMPLEMENT = generated::Z3_decl_kind::Z3_OP_RE_COMPLEMENT as u32,
1286 /// A label (used by the Boogie Verification condition generator).
1287 ///
1288 /// The label has two parameters, a string and a Boolean polarity.
1289 ///
1290 /// It takes one argument, a formula.
1291 LABEL = generated::Z3_decl_kind::Z3_OP_LABEL as u32,
1292 /// A label literal (used by the Boogie Verification condition generator).
1293 ///
1294 /// A label literal has a set of string parameters. It takes no arguments.
1295 LABEL_LIT = generated::Z3_decl_kind::Z3_OP_LABEL_LIT as u32,
1296 /// Datatype constructor.
1297 DT_CONSTRUCTOR = generated::Z3_decl_kind::Z3_OP_DT_CONSTRUCTOR as u32,
1298 /// Datatype recognizer.
1299 DT_RECOGNISER = generated::Z3_decl_kind::Z3_OP_DT_RECOGNISER as u32,
1300 /// Datatype recognizer.
1301 DT_IS = generated::Z3_decl_kind::Z3_OP_DT_IS as u32,
1302 /// Datatype accessor.
1303 DT_ACCESSOR = generated::Z3_decl_kind::Z3_OP_DT_ACCESSOR as u32,
1304 /// Datatype field update.
1305 DT_UPDATE_FIELD = generated::Z3_decl_kind::Z3_OP_DT_UPDATE_FIELD as u32,
1306 /// Cardinality constraint.
1307 ///
1308 /// Example: `x + y + z <= 2`
1309 PB_AT_MOST = generated::Z3_decl_kind::Z3_OP_PB_AT_MOST as u32,
1310 /// Cardinality constraint.
1311 ///
1312 /// Example: `x + y + z >= 2`
1313 PB_AT_LEAST = generated::Z3_decl_kind::Z3_OP_PB_AT_LEAST as u32,
1314 /// Generalized Pseudo-Boolean cardinality constraint.
1315 ///
1316 /// Example: `2*x + 3*y <= 4`
1317 PB_LE = generated::Z3_decl_kind::Z3_OP_PB_LE as u32,
1318 /// Generalized Pseudo-Boolean cardinality constraint.
1319 ///
1320 /// Example: `2*x + 3*y + 2*z >= 4`
1321 PB_GE = generated::Z3_decl_kind::Z3_OP_PB_GE as u32,
1322 /// Generalized Pseudo-Boolean equality constraint.
1323 ///
1324 /// Example: `2*x + 1*y + 2*z + 1*u = 4`
1325 PB_EQ = generated::Z3_decl_kind::Z3_OP_PB_EQ as u32,
1326 /// Floating-point rounding mode RNE
1327 FPA_RM_NEAREST_TIES_TO_EVEN = generated::Z3_decl_kind::Z3_OP_FPA_RM_NEAREST_TIES_TO_EVEN as u32,
1328 /// Floating-point rounding mode RNA
1329 FPA_RM_NEAREST_TIES_TO_AWAY = generated::Z3_decl_kind::Z3_OP_FPA_RM_NEAREST_TIES_TO_AWAY as u32,
1330 /// Floating-point rounding mode RTP
1331 FPA_RM_TOWARD_POSITIVE = generated::Z3_decl_kind::Z3_OP_FPA_RM_TOWARD_POSITIVE as u32,
1332 /// Floating-point rounding mode RTN
1333 FPA_RM_TOWARD_NEGATIVE = generated::Z3_decl_kind::Z3_OP_FPA_RM_TOWARD_NEGATIVE as u32,
1334 /// Floating-point rounding mode RTZ
1335 FPA_RM_TOWARD_ZERO = generated::Z3_decl_kind::Z3_OP_FPA_RM_TOWARD_ZERO as u32,
1336 /// Floating-point value
1337 FPA_NUM = generated::Z3_decl_kind::Z3_OP_FPA_NUM as u32,
1338 /// Floating-point +oo
1339 FPA_PLUS_INF = generated::Z3_decl_kind::Z3_OP_FPA_PLUS_INF as u32,
1340 /// Floating-point -oo
1341 FPA_MINUS_INF = generated::Z3_decl_kind::Z3_OP_FPA_MINUS_INF as u32,
1342 /// Floating-point NaN
1343 FPA_NAN = generated::Z3_decl_kind::Z3_OP_FPA_NAN as u32,
1344 /// Floating-point +zero
1345 FPA_PLUS_ZERO = generated::Z3_decl_kind::Z3_OP_FPA_PLUS_ZERO as u32,
1346 /// Floating-point -zero
1347 FPA_MINUS_ZERO = generated::Z3_decl_kind::Z3_OP_FPA_MINUS_ZERO as u32,
1348 /// Floating-point addition
1349 FPA_ADD = generated::Z3_decl_kind::Z3_OP_FPA_ADD as u32,
1350 /// Floating-point subtraction
1351 FPA_SUB = generated::Z3_decl_kind::Z3_OP_FPA_SUB as u32,
1352 /// Floating-point negation
1353 FPA_NEG = generated::Z3_decl_kind::Z3_OP_FPA_NEG as u32,
1354 /// Floating-point multiplication
1355 FPA_MUL = generated::Z3_decl_kind::Z3_OP_FPA_MUL as u32,
1356 /// Floating-point division
1357 FPA_DIV = generated::Z3_decl_kind::Z3_OP_FPA_DIV as u32,
1358 /// Floating-point remainder
1359 FPA_REM = generated::Z3_decl_kind::Z3_OP_FPA_REM as u32,
1360 /// Floating-point absolute value
1361 FPA_ABS = generated::Z3_decl_kind::Z3_OP_FPA_ABS as u32,
1362 /// Floating-point minimum
1363 FPA_MIN = generated::Z3_decl_kind::Z3_OP_FPA_MIN as u32,
1364 /// Floating-point maximum
1365 FPA_MAX = generated::Z3_decl_kind::Z3_OP_FPA_MAX as u32,
1366 /// Floating-point fused multiply-add
1367 FPA_FMA = generated::Z3_decl_kind::Z3_OP_FPA_FMA as u32,
1368 /// Floating-point square root
1369 FPA_SQRT = generated::Z3_decl_kind::Z3_OP_FPA_SQRT as u32,
1370 /// Floating-point round to integral
1371 FPA_ROUND_TO_INTEGRAL = generated::Z3_decl_kind::Z3_OP_FPA_ROUND_TO_INTEGRAL as u32,
1372 /// Floating-point equality
1373 FPA_EQ = generated::Z3_decl_kind::Z3_OP_FPA_EQ as u32,
1374 /// Floating-point less than
1375 FPA_LT = generated::Z3_decl_kind::Z3_OP_FPA_LT as u32,
1376 /// Floating-point greater than
1377 FPA_GT = generated::Z3_decl_kind::Z3_OP_FPA_GT as u32,
1378 /// Floating-point less than or equal
1379 FPA_LE = generated::Z3_decl_kind::Z3_OP_FPA_LE as u32,
1380 /// Floating-point greater than or equal
1381 FPA_GE = generated::Z3_decl_kind::Z3_OP_FPA_GE as u32,
1382 /// Floating-point isNaN
1383 FPA_IS_NAN = generated::Z3_decl_kind::Z3_OP_FPA_IS_NAN as u32,
1384 /// Floating-point isInfinite
1385 FPA_IS_INF = generated::Z3_decl_kind::Z3_OP_FPA_IS_INF as u32,
1386 /// Floating-point isZero
1387 FPA_IS_ZERO = generated::Z3_decl_kind::Z3_OP_FPA_IS_ZERO as u32,
1388 /// Floating-point isNormal
1389 FPA_IS_NORMAL = generated::Z3_decl_kind::Z3_OP_FPA_IS_NORMAL as u32,
1390 /// Floating-point isSubnormal
1391 FPA_IS_SUBNORMAL = generated::Z3_decl_kind::Z3_OP_FPA_IS_SUBNORMAL as u32,
1392 /// Floating-point isNegative
1393 FPA_IS_NEGATIVE = generated::Z3_decl_kind::Z3_OP_FPA_IS_NEGATIVE as u32,
1394 /// Floating-point isPositive
1395 FPA_IS_POSITIVE = generated::Z3_decl_kind::Z3_OP_FPA_IS_POSITIVE as u32,
1396 /// Floating-point constructor from 3 bit-vectors
1397 FPA_FP = generated::Z3_decl_kind::Z3_OP_FPA_FP as u32,
1398 /// Floating-point conversion (various)
1399 FPA_TO_FP = generated::Z3_decl_kind::Z3_OP_FPA_TO_FP as u32,
1400 /// Floating-point conversion from unsigned bit-vector
1401 FPA_TO_FP_UNSIGNED = generated::Z3_decl_kind::Z3_OP_FPA_TO_FP_UNSIGNED as u32,
1402 /// Floating-point conversion to unsigned bit-vector
1403 FPA_TO_UBV = generated::Z3_decl_kind::Z3_OP_FPA_TO_UBV as u32,
1404 /// Floating-point conversion to signed bit-vector
1405 FPA_TO_SBV = generated::Z3_decl_kind::Z3_OP_FPA_TO_SBV as u32,
1406 /// Floating-point conversion to real number
1407 FPA_TO_REAL = generated::Z3_decl_kind::Z3_OP_FPA_TO_REAL as u32,
1408 /// Floating-point conversion to IEEE-754 bit-vector
1409 FPA_TO_IEEE_BV = generated::Z3_decl_kind::Z3_OP_FPA_TO_IEEE_BV as u32,
1410 /// Implicitly) represents the internal bitvector-representation
1411 /// of a floating-point term (used for the lazy encoding
1412 /// of non-relevant terms in `theory_fpa`)
1413 FPA_BVWRAP = generated::Z3_decl_kind::Z3_OP_FPA_BVWRAP as u32,
1414 /// Conversion of a 3-bit bit-vector term to a
1415 /// floating-point rounding-mode term.
1416 ///
1417 /// The conversion uses the following values:
1418 ///
1419 /// 0 = 000 = `DeclKind::FPA_RM_NEAREST_TIES_TO_EVEN`,
1420 /// 1 = 001 = `DeclKind::FPA_RM_NEAREST_TIES_TO_AWAY`,
1421 /// 2 = 010 = `DeclKind::FPA_RM_TOWARD_POSITIVE`,
1422 /// 3 = 011 = `DeclKind::FPA_RM_TOWARD_NEGATIVE`,
1423 /// 4 = 100 = `DeclKind::FPA_RM_TOWARD_ZERO`.
1424 FPA_BV2RM = generated::Z3_decl_kind::Z3_OP_FPA_BV2RM as u32,
1425 /// Internal (often interpreted) symbol, but no additional
1426 /// information is exposed. Tools may use the string
1427 /// representation of the function declaration to obtain
1428 /// more information.
1429 INTERNAL = generated::Z3_decl_kind::Z3_OP_INTERNAL as u32,
1430 /// Kind used for uninterpreted symbols.
1431 UNINTERPRETED = generated::Z3_decl_kind::Z3_OP_UNINTERPRETED as u32,
1432}
1433
1434/// The different kinds of parameters that can be associated with parameter sets.
1435/// (see [`Z3_mk_params`]).
1436///
1437/// This corresponds to `Z3_param_kind` in the C API.
1438#[repr(u32)]
1439#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1440pub enum ParamKind {
1441 /// integer parameters.
1442 ///
1443 /// This corresponds to `Z3_PK_UINT` in the C API.
1444 UInt = generated::Z3_param_kind::Z3_PK_UINT as u32,
1445 /// boolean parameters.
1446 ///
1447 /// This corresponds to `Z3_PK_BOOL` in the C API.
1448 Bool = generated::Z3_param_kind::Z3_PK_BOOL as u32,
1449 /// double parameters.
1450 ///
1451 /// This corresponds to `Z3_PK_DOUBLE` in the C API.
1452 Double = generated::Z3_param_kind::Z3_PK_DOUBLE as u32,
1453 /// symbol parameters.
1454 ///
1455 /// This corresponds to `Z3_PK_SYMBOL` in the C API.
1456 Symbol = generated::Z3_param_kind::Z3_PK_SYMBOL as u32,
1457 /// string parameters.
1458 ///
1459 /// This corresponds to `Z3_PK_STRING` in the C API.
1460 String = generated::Z3_param_kind::Z3_PK_STRING as u32,
1461 /// all internal parameter kinds which are not exposed in the API.
1462 ///
1463 /// This corresponds to `Z3_PK_OTHER` in the C API.
1464 Other = generated::Z3_param_kind::Z3_PK_OTHER as u32,
1465 /// invalid parameter.
1466 ///
1467 /// This corresponds to `Z3_PK_INVALID` in the C API.
1468 Invalid = generated::Z3_param_kind::Z3_PK_INVALID as u32,
1469}
1470
1471/// Z3 pretty printing modes (See [`Z3_set_ast_print_mode`]).
1472///
1473/// This corresponds to `Z3_ast_print_mode` in the C API.
1474#[repr(u32)]
1475#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1476pub enum AstPrintMode {
1477 /// Print AST nodes in SMTLIB verbose format.
1478 ///
1479 /// This corresponds to `Z3_PRINT_SMTLIB_FULL` in the C API.
1480 SmtLibFull = generated::Z3_ast_print_mode::Z3_PRINT_SMTLIB_FULL as u32,
1481 /// Print AST nodes using a low-level format.
1482 ///
1483 /// This corresponds to `Z3_PRINT_LOW_LEVEL` in the C API.
1484 LowLevel = generated::Z3_ast_print_mode::Z3_PRINT_LOW_LEVEL as u32,
1485 /// Print AST nodes in SMTLIB 2.x compliant format.
1486 ///
1487 /// This corresponds to `Z3_PRINT_SMTLIB2_COMPLIANT` in the C API.
1488 SmtLib2Compliant = generated::Z3_ast_print_mode::Z3_PRINT_SMTLIB2_COMPLIANT as u32,
1489}
1490
1491/// Z3 error codes (See [`Z3_get_error_code`]).
1492///
1493/// This corresponds to `Z3_error_code` in the C API.
1494#[repr(u32)]
1495#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1496pub enum ErrorCode {
1497 /// No error.
1498 ///
1499 /// This corresponds to `Z3_OK` in the C API.
1500 OK = generated::Z3_error_code::Z3_OK as u32,
1501 /// User tried to build an invalid (type incorrect) AST.
1502 ///
1503 /// This corresponds to `Z3_SORT_ERROR` in the C API.
1504 SortError = generated::Z3_error_code::Z3_SORT_ERROR as u32,
1505 /// Index out of bounds.
1506 ///
1507 /// This corresponds to `Z3_IOB` in the C API.
1508 IOB = generated::Z3_error_code::Z3_IOB as u32,
1509 /// Invalid argument was provided.
1510 ///
1511 /// This corresponds to `Z3_INVALID_ARG` in the C API.
1512 InvalidArg = generated::Z3_error_code::Z3_INVALID_ARG as u32,
1513 /// An error occurred when parsing a string or file.
1514 ///
1515 /// This corresponds to `Z3_PARSER_ERROR` in the C API.
1516 ParserError = generated::Z3_error_code::Z3_PARSER_ERROR as u32,
1517 /// Parser output is not available, that is, user didn't invoke
1518 /// [`Z3_parse_smtlib2_string`] or [`Z3_parse_smtlib2_file`].
1519 ///
1520 /// This corresponds to `Z3_NO_PARSER` in the C API.
1521 NoParser = generated::Z3_error_code::Z3_NO_PARSER as u32,
1522 /// Invalid pattern was used to build a quantifier.
1523 ///
1524 /// This corresponds to `Z3_INVALID_PATTERN` in the C API.
1525 InvalidPattern = generated::Z3_error_code::Z3_INVALID_PATTERN as u32,
1526 /// A memory allocation failure was encountered.
1527 ///
1528 /// This corresponds to `Z3_MEMOUT_FAIL` in the C API.
1529 MemoutFail = generated::Z3_error_code::Z3_MEMOUT_FAIL as u32,
1530 /// A file could not be accessed.
1531 ///
1532 /// This corresponds to `Z3_FILE_ACCESS_ERROR` in the C API.
1533 FileAccessError = generated::Z3_error_code::Z3_FILE_ACCESS_ERROR as u32,
1534 /// An error internal to Z3 occurred.
1535 ///
1536 /// This corresponds to `Z3_INTERNAL_FATAL` in the C API.
1537 InternalFatal = generated::Z3_error_code::Z3_INTERNAL_FATAL as u32,
1538 /// API call is invalid in the current state.
1539 ///
1540 /// This corresponds to `Z3_INVALID_USAGE` in the C API.
1541 InvalidUsage = generated::Z3_error_code::Z3_INVALID_USAGE as u32,
1542 /// Trying to decrement the reference counter of an AST that was
1543 /// deleted or the reference counter was not initialized with
1544 /// [`Z3_inc_ref`].
1545 ///
1546 /// This corresponds to `Z3_DEC_REF_ERROR` in the C API.
1547 DecRefError = generated::Z3_error_code::Z3_DEC_REF_ERROR as u32,
1548 /// Internal Z3 exception. Additional details can be retrieved
1549 /// using [`Z3_get_error_msg`].
1550 ///
1551 /// This corresponds to `Z3_EXCEPTION` in the C API.
1552 Exception = generated::Z3_error_code::Z3_EXCEPTION as u32,
1553}
1554
1555/// Z3 custom error handler (See [`Z3_set_error_handler`]).
1556pub type Z3_error_handler =
1557 ::core::option::Option<unsafe extern "C" fn(c: Z3_context, e: ErrorCode)>;
1558
1559/// Precision of a given goal. Some goals can be transformed using over/under approximations.
1560///
1561/// This corresponds to `Z3_goal_prec` in the C API.
1562#[repr(u32)]
1563#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1564pub enum GoalPrec {
1565 /// Approximations/Relaxations were not applied on the goal
1566 /// (sat and unsat answers were preserved).
1567 ///
1568 /// This corresponds to `Z3_GOAL_PRECISE` in the C API.
1569 Precise = generated::Z3_goal_prec::Z3_GOAL_PRECISE as u32,
1570 /// Goal is the product of a under-approximation (sat answers are preserved).
1571 ///
1572 /// This corresponds to `Z3_GOAL_UNDER` in the C API.
1573 Under = generated::Z3_goal_prec::Z3_GOAL_UNDER as u32,
1574 /// Goal is the product of an over-approximation (unsat answers are preserved).
1575 ///
1576 /// This corresponds to `Z3_GOAL_OVER` in the C API.
1577 Over = generated::Z3_goal_prec::Z3_GOAL_OVER as u32,
1578 /// Goal is garbage (it is the product of over- and under-approximations,
1579 /// sat and unsat answers are not preserved).
1580 ///
1581 /// This corresponds to `Z3_GOAL_UNDER_OVER` in the C API.
1582 UnderOver = generated::Z3_goal_prec::Z3_GOAL_UNDER_OVER as u32,
1583}
1584
1585unsafe extern "C" {
1586 /// Set a global (or module) parameter.
1587 /// This setting is shared by all Z3 contexts.
1588 ///
1589 /// When a Z3 module is initialized it will use the value of these parameters
1590 /// when [`Z3_params`] objects are not provided.
1591 ///
1592 /// The name of parameter can be composed of characters [a-z][A-Z], digits [0-9], '-' and '_'.
1593 /// The character '.' is a delimiter (more later).
1594 ///
1595 /// The parameter names are case-insensitive. The character '-' should be viewed as an "alias" for '_'.
1596 /// Thus, the following parameter names are considered equivalent: `"pp.decimal-precision"`
1597 /// and `"PP.DECIMAL_PRECISION"`.
1598 ///
1599 /// This function can be used to set parameters for a specific Z3 module.
1600 /// This can be done by using `<module-name>.<parameter-name>`.
1601 ///
1602 /// For example:
1603 /// `Z3_global_param_set('pp.decimal', 'true')`
1604 /// will set the parameter `"decimal"` in the module `"pp"` to true.
1605 ///
1606 /// # See also:
1607 ///
1608 /// - [`Z3_global_param_get`]
1609 /// - [`Z3_global_param_reset_all`]
1610 pub fn Z3_global_param_set(param_id: Z3_string, param_value: Z3_string);
1611
1612 /// Restore the value of all global (and module) parameters.
1613 /// This command will not affect already created objects (such as tactics and solvers).
1614 ///
1615 /// # See also:
1616 ///
1617 /// - [`Z3_global_param_get`]
1618 /// - [`Z3_global_param_set`]
1619 pub fn Z3_global_param_reset_all();
1620
1621 /// Get a global (or module) parameter.
1622 ///
1623 /// Returns `false` if the parameter value does not exist.
1624 ///
1625 /// # See also:
1626 ///
1627 /// - [`Z3_global_param_reset_all`]
1628 /// - [`Z3_global_param_set`]
1629 ///
1630 /// NOTE: This function cannot be invoked simultaneously from different threads without synchronization.
1631 /// The result string stored in `param_value` is stored in shared location.
1632 pub fn Z3_global_param_get(param_id: Z3_string, param_value: Z3_string_ptr) -> bool;
1633
1634 /// Create a configuration object for the Z3 context object.
1635 ///
1636 /// Configurations are created in order to assign parameters prior to creating
1637 /// contexts for Z3 interaction. For example, if the users wishes to use proof
1638 /// generation, then call:
1639 ///
1640 /// `Z3_set_param_value(cfg, "proof", "true")`
1641 ///
1642 /// NOTE: In previous versions of Z3, the [`Z3_config`] was used to store
1643 /// global and module configurations. Now, we should use [`Z3_global_param_set`].
1644 ///
1645 /// The following parameters can be set:
1646 ///
1647 /// - `proof` (Boolean) Enable proof generation
1648 /// - `debug_ref_count` (Boolean) Enable debug support for [`Z3_ast`] reference counting
1649 /// - `trace` (Boolean) Tracing support for VCC
1650 /// - `trace_file_name` (String) Trace out file for VCC traces
1651 /// - `timeout` (unsigned) default timeout (in milliseconds) used for solvers
1652 /// - `well_sorted_check` type checker
1653 /// - `auto_config` use heuristics to automatically select solver and configure it
1654 /// - `model` model generation for solvers, this parameter can be overwritten when creating a solver
1655 /// - `model_validate` validate models produced by solvers
1656 /// - `unsat_core` unsat-core generation for solvers, this parameter can be overwritten when creating a solver
1657 ///
1658 /// # See also:
1659 ///
1660 /// - [`Z3_set_param_value`]
1661 /// - [`Z3_del_config`]
1662 pub fn Z3_mk_config() -> Option<Z3_config>;
1663
1664 /// Delete the given configuration object.
1665 ///
1666 /// # See also:
1667 ///
1668 /// - [`Z3_mk_config`]
1669 pub fn Z3_del_config(c: Z3_config);
1670
1671 /// Set a configuration parameter.
1672 ///
1673 /// The following parameters can be set for
1674 ///
1675 /// # See also:
1676 ///
1677 /// - [`Z3_mk_config`]
1678 pub fn Z3_set_param_value(c: Z3_config, param_id: Z3_string, param_value: Z3_string);
1679
1680 /// Create a context using the given configuration.
1681 ///
1682 /// After a context is created, the configuration cannot be changed,
1683 /// although some parameters can be changed using [`Z3_update_param_value`].
1684 /// All main interaction with Z3 happens in the context of a [`Z3_context`].
1685 ///
1686 /// In contrast to [`Z3_mk_context_rc`], the life time of [`Z3_ast`]
1687 /// objects are determined by the scope level of [`Z3_solver_push`]
1688 /// and [`Z3_solver_pop`]. In other words, a [`Z3_ast`] object remains
1689 /// valid until there is a call to [`Z3_solver_pop`] that
1690 /// takes the current scope below the level where
1691 /// the object was created.
1692 ///
1693 /// Note that all other reference counted objects, including [`Z3_model`],
1694 /// [`Z3_solver`], [`Z3_func_interp`] have to be managed by the caller.
1695 /// Their reference counts are not handled by the context.
1696 ///
1697 /// Further remarks:
1698 /// - [`Z3_sort`], [`Z3_func_decl`], [`Z3_app`], [`Z3_pattern`] are [`Z3_ast`]'s.
1699 /// - Z3 uses hash-consing, i.e., when the same [`Z3_ast`] is created twice,
1700 /// Z3 will return the same pointer twice.
1701 ///
1702 /// # See also:
1703 ///
1704 /// - [`Z3_del_context`]
1705 pub fn Z3_mk_context(c: Z3_config) -> Option<Z3_context>;
1706
1707 /// Create a context using the given configuration.
1708 /// This function is similar to [`Z3_mk_context`]. However,
1709 /// in the context returned by this function, the user
1710 /// is responsible for managing [`Z3_ast`] reference counters.
1711 /// Managing reference counters is a burden and error-prone,
1712 /// but allows the user to use the memory more efficiently.
1713 /// The user must invoke [`Z3_inc_ref`] for any [`Z3_ast`] returned
1714 /// by Z3, and [`Z3_dec_ref`] whenever the [`Z3_ast`] is not needed
1715 /// anymore. This idiom is similar to the one used in
1716 /// BDD (binary decision diagrams) packages such as CUDD.
1717 ///
1718 /// Remarks:
1719 ///
1720 /// - [`Z3_sort`], [`Z3_func_decl`], [`Z3_app`], [`Z3_pattern`] are [`Z3_ast`]'s.
1721 /// - After a context is created, the configuration cannot be changed.
1722 /// - All main interaction with Z3 happens in the context of a [`Z3_context`].
1723 /// - Z3 uses hash-consing, i.e., when the same [`Z3_ast`] is created twice,
1724 /// Z3 will return the same pointer twice.
1725 pub fn Z3_mk_context_rc(c: Z3_config) -> Option<Z3_context>;
1726
1727 /// Delete the given logical context.
1728 ///
1729 /// # See also:
1730 ///
1731 /// - [`Z3_mk_context`]
1732 pub fn Z3_del_context(c: Z3_context);
1733
1734 /// Increment the reference counter of the given AST.
1735 /// The context `c` should have been created using [`Z3_mk_context_rc`].
1736 /// This function is a NOOP if `c` was created using [`Z3_mk_context`].
1737 pub fn Z3_inc_ref(c: Z3_context, a: Z3_ast);
1738
1739 /// Decrement the reference counter of the given AST.
1740 /// The context `c` should have been created using [`Z3_mk_context_rc`].
1741 /// This function is a NOOP if `c` was created using [`Z3_mk_context`].
1742 pub fn Z3_dec_ref(c: Z3_context, a: Z3_ast);
1743
1744 /// Set a value of a context parameter.
1745 ///
1746 /// # See also:
1747 ///
1748 /// - [`Z3_global_param_set`]
1749 pub fn Z3_update_param_value(c: Z3_context, param_id: Z3_string, param_value: Z3_string);
1750
1751 /// Interrupt the execution of a Z3 procedure.
1752 ///
1753 /// This procedure can be used to interrupt: solvers, simplifiers and tactics.
1754 ///
1755 /// This method can be invoked from a thread different from the one executing the
1756 /// interruptible procedure.
1757 pub fn Z3_interrupt(c: Z3_context);
1758
1759 /// Create a Z3 (empty) parameter set.
1760 /// Starting at Z3 4.0, parameter sets are used to configure many components such as:
1761 /// simplifiers, tactics, solvers, etc.
1762 ///
1763 /// NOTE: Reference counting must be used to manage parameter
1764 /// sets, even when the [`Z3_context`] was created using
1765 /// [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
1766 pub fn Z3_mk_params(c: Z3_context) -> Option<Z3_params>;
1767
1768 /// Increment the reference counter of the given parameter set.
1769 pub fn Z3_params_inc_ref(c: Z3_context, p: Z3_params);
1770
1771 /// Decrement the reference counter of the given parameter set.
1772 pub fn Z3_params_dec_ref(c: Z3_context, p: Z3_params);
1773
1774 /// Add a Boolean parameter `k` with value `v` to the parameter set `p`.
1775 pub fn Z3_params_set_bool(c: Z3_context, p: Z3_params, k: Z3_symbol, v: bool);
1776
1777 /// Add a unsigned parameter `k` with value `v` to the parameter set `p`.
1778 pub fn Z3_params_set_uint(c: Z3_context, p: Z3_params, k: Z3_symbol, v: ::core::ffi::c_uint);
1779
1780 /// Add a double parameter `k` with value `v` to the parameter set `p`.
1781 pub fn Z3_params_set_double(c: Z3_context, p: Z3_params, k: Z3_symbol, v: f64);
1782
1783 /// Add a symbol parameter `k` with value `v` to the parameter set `p`.
1784 pub fn Z3_params_set_symbol(c: Z3_context, p: Z3_params, k: Z3_symbol, v: Z3_symbol);
1785
1786 /// Convert a parameter set into a string. This function is mainly used for printing the
1787 /// contents of a parameter set.
1788 pub fn Z3_params_to_string(c: Z3_context, p: Z3_params) -> Z3_string;
1789
1790 /// Validate the parameter set `p` against the parameter description set `d`.
1791 ///
1792 /// The procedure invokes the error handler if `p` is invalid.
1793 pub fn Z3_params_validate(c: Z3_context, p: Z3_params, d: Z3_param_descrs);
1794
1795 /// Increment the reference counter of the given parameter description set.
1796 pub fn Z3_param_descrs_inc_ref(c: Z3_context, p: Z3_param_descrs);
1797
1798 /// Decrement the reference counter of the given parameter description set.
1799 pub fn Z3_param_descrs_dec_ref(c: Z3_context, p: Z3_param_descrs);
1800
1801 /// Return the kind associated with the given parameter name `n`.
1802 pub fn Z3_param_descrs_get_kind(c: Z3_context, p: Z3_param_descrs, n: Z3_symbol) -> ParamKind;
1803
1804 /// Return the number of parameters in the given parameter description set.
1805 pub fn Z3_param_descrs_size(c: Z3_context, p: Z3_param_descrs) -> ::core::ffi::c_uint;
1806
1807 /// Return the number of parameters in the given parameter description set.
1808 ///
1809 /// # Preconditions:
1810 ///
1811 /// - `i < Z3_param_descrs_size(c, p)`
1812 pub fn Z3_param_descrs_get_name(
1813 c: Z3_context,
1814 p: Z3_param_descrs,
1815 i: ::core::ffi::c_uint,
1816 ) -> Option<Z3_symbol>;
1817
1818 /// Retrieve documentation string corresponding to parameter name `s`.
1819 pub fn Z3_param_descrs_get_documentation(
1820 c: Z3_context,
1821 p: Z3_param_descrs,
1822 s: Z3_symbol,
1823 ) -> Z3_string;
1824
1825 /// Convert a parameter description set into a string. This function is mainly used for printing the
1826 /// contents of a parameter description set.
1827 pub fn Z3_param_descrs_to_string(c: Z3_context, p: Z3_param_descrs) -> Z3_string;
1828
1829 /// Create a Z3 symbol using an integer.
1830 ///
1831 /// Symbols are used to name several term and type constructors.
1832 ///
1833 /// NB. Not all integers can be passed to this function.
1834 /// The legal range of unsigned integers is 0 to 2^30-1.
1835 ///
1836 /// # See also:
1837 ///
1838 /// - [`Z3_get_symbol_int`]
1839 /// - [`Z3_mk_string_symbol`]
1840 pub fn Z3_mk_int_symbol(c: Z3_context, i: ::core::ffi::c_int) -> Option<Z3_symbol>;
1841
1842 /// Create a Z3 symbol using a C string.
1843 ///
1844 /// Symbols are used to name several term and type constructors.
1845 ///
1846 /// # See also:
1847 ///
1848 /// - [`Z3_get_symbol_string`]
1849 /// - [`Z3_mk_int_symbol`]
1850 pub fn Z3_mk_string_symbol(c: Z3_context, s: Z3_string) -> Option<Z3_symbol>;
1851
1852 /// Create a free (uninterpreted) type using the given name (symbol).
1853 ///
1854 /// Two free types are considered the same iff the have the same name.
1855 pub fn Z3_mk_uninterpreted_sort(c: Z3_context, s: Z3_symbol) -> Option<Z3_sort>;
1856
1857 /// Create the Boolean type.
1858 ///
1859 /// This type is used to create propositional variables and predicates.
1860 pub fn Z3_mk_bool_sort(c: Z3_context) -> Option<Z3_sort>;
1861
1862 /// Create the integer type.
1863 ///
1864 /// This type is not the int type found in programming languages.
1865 /// A machine integer can be represented using bit-vectors. The function
1866 /// [`Z3_mk_bv_sort`] creates a bit-vector type.
1867 ///
1868 /// # See also:
1869 ///
1870 /// - [`Z3_mk_bv_sort`]
1871 pub fn Z3_mk_int_sort(c: Z3_context) -> Option<Z3_sort>;
1872
1873 /// Create the real type.
1874 ///
1875 /// Note that this type is not a floating point number.
1876 pub fn Z3_mk_real_sort(c: Z3_context) -> Option<Z3_sort>;
1877
1878 /// Create a bit-vector type of the given size.
1879 ///
1880 /// This type can also be seen as a machine integer.
1881 ///
1882 /// NOTE: The size of the bit-vector type must be greater than zero.
1883 pub fn Z3_mk_bv_sort(c: Z3_context, sz: ::core::ffi::c_uint) -> Option<Z3_sort>;
1884
1885 /// Create a named finite domain sort.
1886 ///
1887 /// To create constants that belong to the finite domain,
1888 /// use the APIs for creating numerals and pass a numeric
1889 /// constant together with the sort returned by this call.
1890 /// The numeric constant should be between 0 and the less
1891 /// than the size of the domain.
1892 ///
1893 /// # See also:
1894 ///
1895 /// - [`Z3_get_finite_domain_sort_size`]
1896 pub fn Z3_mk_finite_domain_sort(c: Z3_context, name: Z3_symbol, size: u64) -> Option<Z3_sort>;
1897
1898 /// Create an array type.
1899 ///
1900 /// We usually represent the array type as: `[domain -> range]`.
1901 /// Arrays are usually used to model the heap/memory in software verification.
1902 ///
1903 /// # See also:
1904 ///
1905 /// - [`Z3_mk_select`]
1906 /// - [`Z3_mk_store`]
1907 pub fn Z3_mk_array_sort(c: Z3_context, domain: Z3_sort, range: Z3_sort) -> Option<Z3_sort>;
1908
1909 /// Create an array type with N arguments
1910 ///
1911 /// # See also:
1912 ///
1913 /// - [`Z3_mk_select_n`]
1914 /// - [`Z3_mk_store_n`]
1915 pub fn Z3_mk_array_sort_n(
1916 c: Z3_context,
1917 n: ::core::ffi::c_uint,
1918 domain: *const Z3_sort,
1919 range: Z3_sort,
1920 ) -> Option<Z3_sort>;
1921
1922 /// Create a tuple type.
1923 ///
1924 /// A tuple with `n` fields has a constructor and `n` projections.
1925 /// This function will also declare the constructor and projection functions.
1926 ///
1927 /// - `c`: logical context
1928 /// - `mk_tuple_name`: name of the constructor function associated with the tuple type.
1929 /// - `num_fields`: number of fields in the tuple type.
1930 /// - `field_names`: name of the projection functions.
1931 /// - `field_sorts`: type of the tuple fields.
1932 /// - `mk_tuple_decl`: output parameter that will contain the constructor declaration.
1933 /// - `proj_decl`: output parameter that will contain the projection function declarations. This field must be a buffer of size `num_fields` allocated by the user.
1934 pub fn Z3_mk_tuple_sort(
1935 c: Z3_context,
1936 mk_tuple_name: Z3_symbol,
1937 num_fields: ::core::ffi::c_uint,
1938 field_names: *const Z3_symbol,
1939 field_sorts: *const Z3_sort,
1940 mk_tuple_decl: *mut *mut _Z3_func_decl,
1941 proj_decl: *mut *mut _Z3_func_decl,
1942 ) -> Option<Z3_sort>;
1943
1944 /// Create a enumeration sort.
1945 ///
1946 /// An enumeration sort with `n` elements.
1947 /// This function will also declare the functions corresponding to the enumerations.
1948 ///
1949 /// - `c`: logical context
1950 /// - `name`: name of the enumeration sort.
1951 /// - `n`: number of elements in enumeration sort.
1952 /// - `enum_names`: names of the enumerated elements.
1953 /// - `enum_consts`: constants corresponding to the enumerated elements.
1954 /// - `enum_testers`: predicates testing if terms of the enumeration sort correspond to an enumeration.
1955 ///
1956 /// For example, if this function is called with three symbols A, B, C and the name S, then
1957 /// `s` is a sort whose name is S, and the function returns three terms corresponding to A, B, C in
1958 /// `enum_consts`. The array `enum_testers` has three predicates of type `(s -> Bool)`.
1959 /// The first predicate (corresponding to A) is true when applied to A, and false otherwise.
1960 /// Similarly for the other predicates.
1961 pub fn Z3_mk_enumeration_sort(
1962 c: Z3_context,
1963 name: Z3_symbol,
1964 n: ::core::ffi::c_uint,
1965 enum_names: *const Z3_symbol,
1966 enum_consts: *mut *mut _Z3_func_decl,
1967 enum_testers: *mut *mut _Z3_func_decl,
1968 ) -> Option<Z3_sort>;
1969
1970 /// Create a list sort
1971 ///
1972 /// A list sort over `elem_sort`
1973 /// This function declares the corresponding constructors and testers for lists.
1974 ///
1975 /// - `c`: logical context
1976 /// - `name`: name of the list sort.
1977 /// - `elem_sort`: sort of list elements.
1978 /// - `nil_decl`: declaration for the empty list.
1979 /// - `is_nil_decl`: test for the empty list.
1980 /// - `cons_decl`: declaration for a cons cell.
1981 /// - `is_cons_decl`: cons cell test.
1982 /// - `head_decl`: list head.
1983 /// - `tail_decl`: list tail.
1984 pub fn Z3_mk_list_sort(
1985 c: Z3_context,
1986 name: Z3_symbol,
1987 elem_sort: Z3_sort,
1988 nil_decl: *mut *mut _Z3_func_decl,
1989 is_nil_decl: *mut *mut _Z3_func_decl,
1990 cons_decl: *mut *mut _Z3_func_decl,
1991 is_cons_decl: *mut *mut _Z3_func_decl,
1992 head_decl: *mut *mut _Z3_func_decl,
1993 tail_decl: *mut *mut _Z3_func_decl,
1994 ) -> Option<Z3_sort>;
1995
1996 /// Create a constructor.
1997 ///
1998 /// - `c`: logical context.
1999 /// - `name`: constructor name.
2000 /// - `recognizer`: name of recognizer function.
2001 /// - `num_fields`: number of fields in constructor.
2002 /// - `field_names`: names of the constructor fields.
2003 /// - `sorts`: field sorts, 0 if the field sort refers to a recursive sort.
2004 /// - `sort_refs`: reference to datatype sort that is an argument to the constructor; if the corresponding
2005 /// sort reference is 0, then the value in `sort_refs` should be an index referring to
2006 /// one of the recursive datatypes that is declared.
2007 ///
2008 /// # See also:
2009 ///
2010 /// - [`Z3_del_constructor`]
2011 /// - [`Z3_mk_constructor_list`]
2012 /// - [`Z3_query_constructor`]
2013 pub fn Z3_mk_constructor(
2014 c: Z3_context,
2015 name: Z3_symbol,
2016 recognizer: Z3_symbol,
2017 num_fields: ::core::ffi::c_uint,
2018 field_names: *const Z3_symbol,
2019 sorts: *const Option<Z3_sort>,
2020 sort_refs: *mut ::core::ffi::c_uint,
2021 ) -> Option<Z3_constructor>;
2022
2023 /// Reclaim memory allocated to constructor.
2024 ///
2025 /// - `c`: logical context.
2026 /// - `constr`: constructor.
2027 ///
2028 /// # See also:
2029 ///
2030 /// - [`Z3_mk_constructor`]
2031 pub fn Z3_del_constructor(c: Z3_context, constr: Z3_constructor);
2032
2033 /// Create datatype, such as lists, trees, records, enumerations or unions of records.
2034 /// The datatype may be recursive. Return the datatype sort.
2035 ///
2036 /// - `c`: logical context.
2037 /// - `name`: name of datatype.
2038 /// - `num_constructors`: number of constructors passed in.
2039 /// - `constructors`: array of constructor containers.
2040 ///
2041 /// # See also:
2042 ///
2043 /// - [`Z3_mk_constructor`]
2044 /// - [`Z3_mk_constructor_list`]
2045 /// - [`Z3_mk_datatypes`]
2046 pub fn Z3_mk_datatype(
2047 c: Z3_context,
2048 name: Z3_symbol,
2049 num_constructors: ::core::ffi::c_uint,
2050 constructors: *mut Z3_constructor,
2051 ) -> Option<Z3_sort>;
2052
2053 /// Create list of constructors.
2054 ///
2055 /// - `c`: logical context.
2056 /// - `num_constructors`: number of constructors in list.
2057 /// - `constructors`: list of constructors.
2058 ///
2059 /// # See also:
2060 ///
2061 /// - [`Z3_del_constructor_list`]
2062 /// - [`Z3_mk_constructor`]
2063 pub fn Z3_mk_constructor_list(
2064 c: Z3_context,
2065 num_constructors: ::core::ffi::c_uint,
2066 constructors: *const Z3_constructor,
2067 ) -> Option<Z3_constructor_list>;
2068
2069 /// Reclaim memory allocated for constructor list.
2070 ///
2071 /// Each constructor inside the constructor list must be independently reclaimed using [`Z3_del_constructor`].
2072 ///
2073 /// - `c`: logical context.
2074 /// - `clist`: constructor list container.
2075 ///
2076 /// # See also:
2077 ///
2078 /// - [`Z3_mk_constructor_list`]
2079 pub fn Z3_del_constructor_list(c: Z3_context, clist: Z3_constructor_list);
2080
2081 /// Create mutually recursive datatypes.
2082 ///
2083 /// - `c`: logical context.
2084 /// - `num_sorts`: number of datatype sorts.
2085 /// - `sort_names`: names of datatype sorts.
2086 /// - `sorts`: array of datatype sorts.
2087 /// - `constructor_lists`: list of constructors, one list per sort.
2088 ///
2089 /// # See also:
2090 ///
2091 /// - [`Z3_mk_constructor`]
2092 /// - [`Z3_mk_constructor_list`]
2093 /// - [`Z3_mk_datatype`]
2094 pub fn Z3_mk_datatypes(
2095 c: Z3_context,
2096 num_sorts: ::core::ffi::c_uint,
2097 sort_names: *const Z3_symbol,
2098 sorts: *mut Z3_sort,
2099 constructor_lists: *mut Z3_constructor_list,
2100 );
2101
2102 /// Query constructor for declared functions.
2103 ///
2104 /// - `c`: logical context.
2105 /// - `constr`: constructor container. The container must have been passed in to a [`Z3_mk_datatype`] call.
2106 /// - `num_fields`: number of accessor fields in the constructor.
2107 /// - `constructor`: constructor function declaration, allocated by user.
2108 /// - `tester`: constructor test function declaration, allocated by user.
2109 /// - `accessors`: array of accessor function declarations allocated by user. The array must contain `num_fields` elements.
2110 ///
2111 /// # See also:
2112 ///
2113 /// - [`Z3_mk_constructor`]
2114 pub fn Z3_query_constructor(
2115 c: Z3_context,
2116 constr: Z3_constructor,
2117 num_fields: ::core::ffi::c_uint,
2118 constructor: *mut *mut _Z3_func_decl,
2119 tester: *mut *mut _Z3_func_decl,
2120 accessors: *mut *mut _Z3_func_decl,
2121 );
2122
2123 /// Declare a constant or function.
2124 ///
2125 /// - `c`: logical context.
2126 /// - `s`: name of the constant or function.
2127 /// - `domain_size`: number of arguments. It is 0 when declaring a constant.
2128 /// - `domain`: array containing the sort of each argument. The array must contain `domain_size` elements. It is 0 when declaring a constant.
2129 /// - `range`: sort of the constant or the return sort of the function.
2130 ///
2131 /// After declaring a constant or function, the function
2132 /// [`Z3_mk_app`] can be used to create a constant or function
2133 /// application.
2134 ///
2135 /// # See also:
2136 ///
2137 /// - [`Z3_mk_app`]
2138 /// - [`Z3_mk_fresh_func_decl`]
2139 /// - [`Z3_mk_rec_func_decl`]
2140 pub fn Z3_mk_func_decl(
2141 c: Z3_context,
2142 s: Z3_symbol,
2143 domain_size: ::core::ffi::c_uint,
2144 domain: *const Z3_sort,
2145 range: Z3_sort,
2146 ) -> Option<Z3_func_decl>;
2147
2148 /// Create a constant or function application.
2149 ///
2150 /// # See also:
2151 ///
2152 /// - [`Z3_mk_fresh_func_decl`]
2153 /// - [`Z3_mk_func_decl`]
2154 /// - [`Z3_mk_rec_func_decl`]
2155 pub fn Z3_mk_app(
2156 c: Z3_context,
2157 d: Z3_func_decl,
2158 num_args: ::core::ffi::c_uint,
2159 args: *const Z3_ast,
2160 ) -> Option<Z3_ast>;
2161
2162 /// Declare and create a constant.
2163 ///
2164 /// This function is a shorthand for:
2165 ///
2166 /// ```c
2167 /// Z3_func_decl d = Z3_mk_func_decl(c, s, 0, 0, ty);
2168 /// Z3_ast n = Z3_mk_app(c, d, 0, 0);
2169 /// ```
2170 ///
2171 /// # See also:
2172 ///
2173 /// - [`Z3_mk_app`]
2174 /// - [`Z3_mk_fresh_const`]
2175 /// - [`Z3_mk_func_decl`]
2176 pub fn Z3_mk_const(c: Z3_context, s: Z3_symbol, ty: Z3_sort) -> Option<Z3_ast>;
2177
2178 /// Declare a fresh constant or function.
2179 ///
2180 /// Z3 will generate an unique name for this function declaration.
2181 /// If prefix is different from `NULL`, then the name generate by Z3 will start with `prefix`.
2182 ///
2183 /// NOTE: If `prefix` is `NULL`, then it is assumed to be the empty string.
2184 ///
2185 /// # See also:
2186 ///
2187 /// - [`Z3_mk_func_decl`]
2188 pub fn Z3_mk_fresh_func_decl(
2189 c: Z3_context,
2190 prefix: Z3_string,
2191 domain_size: ::core::ffi::c_uint,
2192 domain: *const Z3_sort,
2193 range: Z3_sort,
2194 ) -> Option<Z3_func_decl>;
2195
2196 /// Declare and create a fresh constant.
2197 ///
2198 /// This function is a shorthand for:
2199 /// ```c
2200 /// Z3_func_decl d = Z3_mk_fresh_func_decl(c, prefix, 0, 0, ty);
2201 /// Z3_ast n = Z3_mk_app(c, d, 0, 0);
2202 /// ```
2203 ///
2204 /// NOTE: If `prefix` is `NULL`, then it is assumed to be the empty string.
2205 ///
2206 /// # See also:
2207 ///
2208 /// - [`Z3_mk_app`]
2209 /// - [`Z3_mk_const`]
2210 /// - [`Z3_mk_fresh_func_decl`]
2211 /// - [`Z3_mk_func_decl`]
2212 pub fn Z3_mk_fresh_const(c: Z3_context, prefix: Z3_string, ty: Z3_sort) -> Option<Z3_ast>;
2213
2214 /// Declare a recursive function
2215 ///
2216 /// * `c`: logical context.
2217 /// * `s`: name of the function.
2218 /// * `domain_size`: number of arguments. It should be greater than 0.
2219 /// * `domain`: array containing the sort of each argument. The array must contain `domain_size` elements.
2220 /// * `range`: sort of the constant or the return sort of the function.
2221 ///
2222 /// After declaring recursive function, it should be associated with a
2223 /// recursive definition with [`Z3_add_rec_def`]. The function
2224 /// [`Z3_mk_app`] can be used to create a constant or function
2225 /// application.
2226 ///
2227 /// # See also:
2228 ///
2229 /// * [`Z3_add_rec_def`]
2230 /// * [`Z3_mk_app`]
2231 /// * [`Z3_mk_func_decl`]
2232 pub fn Z3_mk_rec_func_decl(
2233 c: Z3_context,
2234 s: Z3_symbol,
2235 domain_size: ::core::ffi::c_uint,
2236 domain: *const Z3_sort,
2237 range: Z3_sort,
2238 ) -> Option<Z3_func_decl>;
2239
2240 /// Define the body of a recursive function.
2241 ///
2242 /// * `c`: logical context.
2243 /// * `f`: function declaration.
2244 /// * `n`: number of arguments to the function
2245 /// * `args`: constants that are used as arguments to the recursive function in the definition.
2246 /// * `body`: body of the recursive function
2247 ///
2248 /// After declaring a recursive function or a collection of mutually recursive functions, use
2249 /// this function to provide the definition for the recursive function.
2250 ///
2251 /// # See also:
2252 ///
2253 /// * [`Z3_mk_rec_func_decl`]
2254 pub fn Z3_add_rec_def(
2255 c: Z3_context,
2256 f: Z3_func_decl,
2257 n: ::core::ffi::c_uint,
2258 args: *mut Z3_ast,
2259 body: Z3_ast,
2260 );
2261
2262 /// Create a `FuncDecl` representing a partial order
2263 pub fn Z3_mk_partial_order(c: Z3_context, a: Z3_sort, id: usize) -> Option<Z3_func_decl>;
2264
2265 /// Create a `FuncDecl` representing a piecewise linear order
2266 pub fn Z3_mk_piecewise_linear_order(
2267 c: Z3_context,
2268 a: Z3_sort,
2269 id: usize,
2270 ) -> Option<Z3_func_decl>;
2271
2272 /// Create a `FuncDecl` representing a linear order
2273 pub fn Z3_mk_linear_order(c: Z3_context, a: Z3_sort, id: usize) -> Option<Z3_func_decl>;
2274
2275 /// Create a `FuncDecl` representing a tree order
2276 pub fn Z3_mk_tree_order(c: Z3_context, a: Z3_sort, id: usize) -> Option<Z3_func_decl>;
2277
2278 /// Create a `FuncDecl` representing a transitive closure
2279 pub fn Z3_mk_transitive_closure(c: Z3_context, f: Z3_func_decl) -> Option<Z3_func_decl>;
2280
2281 /// Create an AST node representing `true`.
2282 pub fn Z3_mk_true(c: Z3_context) -> Option<Z3_ast>;
2283
2284 /// Create an AST node representing `false`.
2285 pub fn Z3_mk_false(c: Z3_context) -> Option<Z3_ast>;
2286
2287 /// Create an AST node representing `l = r`.
2288 ///
2289 /// The nodes `l` and `r` must have the same type.
2290 pub fn Z3_mk_eq(c: Z3_context, l: Z3_ast, r: Z3_ast) -> Option<Z3_ast>;
2291
2292 /// Create an AST node representing `distinct(args[0], ..., args[num_args-1])`.
2293 ///
2294 /// The `distinct` construct is used for declaring the arguments pairwise distinct.
2295 /// That is, `Forall 0 <= i < j < num_args. not args[i] = args[j]`.
2296 ///
2297 /// All arguments must have the same sort.
2298 ///
2299 /// NOTE: The number of arguments of a distinct construct must be greater than one.
2300 pub fn Z3_mk_distinct(
2301 c: Z3_context,
2302 num_args: ::core::ffi::c_uint,
2303 args: *const Z3_ast,
2304 ) -> Option<Z3_ast>;
2305
2306 /// Create an AST node representing `not(a)`.
2307 ///
2308 /// The node `a` must have Boolean sort.
2309 pub fn Z3_mk_not(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
2310
2311 /// Create an AST node representing an if-then-else: `ite(t1, t2, t3)`.
2312 ///
2313 /// The node `t1` must have Boolean sort, `t2` and `t3` must have the same sort.
2314 /// The sort of the new node is equal to the sort of `t2` and `t3`.
2315 pub fn Z3_mk_ite(c: Z3_context, t1: Z3_ast, t2: Z3_ast, t3: Z3_ast) -> Option<Z3_ast>;
2316
2317 /// Create an AST node representing `t1 iff t2`.
2318 ///
2319 /// The nodes `t1` and `t2` must have Boolean sort.
2320 pub fn Z3_mk_iff(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2321
2322 /// Create an AST node representing `t1 implies t2`.
2323 ///
2324 /// The nodes `t1` and `t2` must have Boolean sort.
2325 pub fn Z3_mk_implies(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2326
2327 /// Create an AST node representing `t1 xor t2`.
2328 ///
2329 /// The nodes `t1` and `t2` must have Boolean sort.
2330 pub fn Z3_mk_xor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2331
2332 /// Create an AST node representing `args[0] and ... and args[num_args-1]`.
2333 ///
2334 /// The array `args` must have `num_args` elements.
2335 /// All arguments must have Boolean sort.
2336 ///
2337 /// NOTE: The number of arguments must be greater than zero.
2338 pub fn Z3_mk_and(
2339 c: Z3_context,
2340 num_args: ::core::ffi::c_uint,
2341 args: *const Z3_ast,
2342 ) -> Option<Z3_ast>;
2343
2344 /// Create an AST node representing `args[0] or ... or args[num_args-1]`.
2345 ///
2346 /// The array `args` must have `num_args` elements.
2347 /// All arguments must have Boolean sort.
2348 ///
2349 /// NOTE: The number of arguments must be greater than zero.
2350 pub fn Z3_mk_or(
2351 c: Z3_context,
2352 num_args: ::core::ffi::c_uint,
2353 args: *const Z3_ast,
2354 ) -> Option<Z3_ast>;
2355
2356 /// Create an AST node representing `args[0] + ... + args[num_args-1]`.
2357 ///
2358 /// The array `args` must have `num_args` elements.
2359 /// All arguments must have int or real sort.
2360 ///
2361 /// NOTE: The number of arguments must be greater than zero.
2362 pub fn Z3_mk_add(
2363 c: Z3_context,
2364 num_args: ::core::ffi::c_uint,
2365 args: *const Z3_ast,
2366 ) -> Option<Z3_ast>;
2367
2368 /// Create an AST node representing `args[0] * ... * args[num_args-1]`.
2369 ///
2370 /// The array `args` must have `num_args` elements.
2371 /// All arguments must have int or real sort.
2372 ///
2373 /// NOTE: Z3 has limited support for non-linear arithmetic.
2374 /// NOTE: The number of arguments must be greater than zero.
2375 pub fn Z3_mk_mul(
2376 c: Z3_context,
2377 num_args: ::core::ffi::c_uint,
2378 args: *const Z3_ast,
2379 ) -> Option<Z3_ast>;
2380
2381 /// Create an AST node representing `args[0] - ... - args[num_args - 1]`.
2382 ///
2383 /// The array `args` must have `num_args` elements.
2384 /// All arguments must have int or real sort.
2385 ///
2386 /// NOTE: The number of arguments must be greater than zero.
2387 pub fn Z3_mk_sub(
2388 c: Z3_context,
2389 num_args: ::core::ffi::c_uint,
2390 args: *const Z3_ast,
2391 ) -> Option<Z3_ast>;
2392
2393 /// Create an AST node representing `- arg`.
2394 ///
2395 /// The arguments must have int or real type.
2396 pub fn Z3_mk_unary_minus(c: Z3_context, arg: Z3_ast) -> Option<Z3_ast>;
2397
2398 /// Create an AST node representing `arg1 div arg2`.
2399 ///
2400 /// The arguments must either both have int type or both have real type.
2401 /// If the arguments have int type, then the result type is an int type, otherwise the
2402 /// the result type is real.
2403 pub fn Z3_mk_div(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2404
2405 /// Create an AST node representing `arg1 mod arg2`.
2406 ///
2407 /// The arguments must have int type.
2408 pub fn Z3_mk_mod(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2409
2410 /// Create an AST node representing `arg1 rem arg2`.
2411 ///
2412 /// The arguments must have int type.
2413 pub fn Z3_mk_rem(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2414
2415 /// Create an AST node representing `arg1 ^ arg2`.
2416 ///
2417 /// The arguments must have int or real type.
2418 pub fn Z3_mk_power(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2419
2420 /// Create less than.
2421 ///
2422 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
2423 pub fn Z3_mk_lt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2424
2425 /// Create less than or equal to.
2426 ///
2427 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
2428 pub fn Z3_mk_le(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2429
2430 /// Create greater than.
2431 ///
2432 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
2433 pub fn Z3_mk_gt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2434
2435 /// Create greater than or equal to.
2436 ///
2437 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
2438 pub fn Z3_mk_ge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2439
2440 /// Coerce an integer to a real.
2441 ///
2442 /// There is also a converse operation exposed.
2443 /// It follows the semantics prescribed by the SMT-LIB standard.
2444 ///
2445 /// You can take the floor of a real by
2446 /// creating an auxiliary integer constant `k` and
2447 /// and asserting `mk_int2real(k) <= t1 < mk_int2real(k)+1`.
2448 ///
2449 /// The node `t1` must have sort integer.
2450 ///
2451 /// # See also:
2452 ///
2453 /// - [`Z3_mk_real2int`]
2454 /// - [`Z3_mk_is_int`]
2455 pub fn Z3_mk_int2real(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2456
2457 /// Coerce a real to an integer.
2458 ///
2459 /// The semantics of this function follows the SMT-LIB standard
2460 /// for the function `to_int`
2461 ///
2462 /// # See also:
2463 ///
2464 /// - [`Z3_mk_int2real`]
2465 /// - [`Z3_mk_is_int`]
2466 pub fn Z3_mk_real2int(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2467
2468 /// Check if a real number is an integer.
2469 ///
2470 /// # See also:
2471 ///
2472 /// - [`Z3_mk_int2real`]
2473 /// - [`Z3_mk_real2int`]
2474 pub fn Z3_mk_is_int(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2475
2476 /// Bitwise negation.
2477 ///
2478 /// The node `t1` must have a bit-vector sort.
2479 pub fn Z3_mk_bvnot(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2480
2481 /// Take conjunction of bits in vector, return vector of length 1.
2482 ///
2483 /// The node `t1` must have a bit-vector sort.
2484 pub fn Z3_mk_bvredand(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2485
2486 /// Take disjunction of bits in vector, return vector of length 1.
2487 ///
2488 /// The node `t1` must have a bit-vector sort.
2489 pub fn Z3_mk_bvredor(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2490
2491 /// Bitwise and.
2492 ///
2493 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2494 pub fn Z3_mk_bvand(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2495
2496 /// Bitwise or.
2497 ///
2498 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2499 pub fn Z3_mk_bvor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2500
2501 /// Bitwise exclusive-or.
2502 ///
2503 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2504 pub fn Z3_mk_bvxor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2505
2506 /// Bitwise nand.
2507 ///
2508 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2509 pub fn Z3_mk_bvnand(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2510
2511 /// Bitwise nor.
2512 ///
2513 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2514 pub fn Z3_mk_bvnor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2515
2516 /// Bitwise xnor.
2517 ///
2518 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2519 pub fn Z3_mk_bvxnor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2520
2521 /// Standard two's complement unary minus.
2522 ///
2523 /// The node `t1` must have bit-vector sort.
2524 pub fn Z3_mk_bvneg(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2525
2526 /// Standard two's complement addition.
2527 ///
2528 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2529 pub fn Z3_mk_bvadd(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2530
2531 /// Standard two's complement subtraction.
2532 ///
2533 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2534 pub fn Z3_mk_bvsub(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2535
2536 /// Standard two's complement multiplication.
2537 ///
2538 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2539 pub fn Z3_mk_bvmul(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2540
2541 /// Unsigned division.
2542 ///
2543 /// It is defined as the `floor` of `t1/t2` if `t2` is
2544 /// different from zero. If `t2` is zero, then the result
2545 /// is undefined.
2546 ///
2547 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2548 pub fn Z3_mk_bvudiv(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2549
2550 /// Two's complement signed division.
2551 ///
2552 /// It is defined in the following way:
2553 ///
2554 /// - The `floor` of `t1/t2` if `t2` is different from zero, and `t1*t2 >= 0`.
2555 ///
2556 /// - The `ceiling` of `t1/t2` if `t2` is different from zero, and `t1*t2 < 0`.
2557 ///
2558 /// If `t2` is zero, then the result is undefined.
2559 ///
2560 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2561 pub fn Z3_mk_bvsdiv(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2562
2563 /// Unsigned remainder.
2564 ///
2565 /// It is defined as `t1 - (t1 /u t2) * t2`, where `/u` represents unsigned division.
2566 ///
2567 /// If `t2` is zero, then the result is undefined.
2568 ///
2569 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2570 pub fn Z3_mk_bvurem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2571
2572 /// Two's complement signed remainder (sign follows dividend).
2573 ///
2574 /// It is defined as `t1 - (t1 /s t2) * t2`, where `/s` represents signed division.
2575 /// The most significant bit (sign) of the result is equal to the most significant bit of `t1`.
2576 ///
2577 /// If `t2` is zero, then the result is undefined.
2578 ///
2579 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2580 ///
2581 /// # See also:
2582 ///
2583 /// - [`Z3_mk_bvsmod`]
2584 pub fn Z3_mk_bvsrem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2585
2586 /// Two's complement signed remainder (sign follows divisor).
2587 ///
2588 /// If `t2` is zero, then the result is undefined.
2589 ///
2590 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2591 ///
2592 /// # See also:
2593 ///
2594 /// - [`Z3_mk_bvsrem`]
2595 pub fn Z3_mk_bvsmod(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2596
2597 /// Unsigned less than.
2598 ///
2599 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2600 pub fn Z3_mk_bvult(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2601
2602 /// Two's complement signed less than.
2603 ///
2604 /// It abbreviates:
2605 /// ```text
2606 /// (or (and (= (extract[|m-1|:|m-1|] t1) bit1)
2607 /// (= (extract[|m-1|:|m-1|] t2) bit0))
2608 /// (and (= (extract[|m-1|:|m-1|] t1) (extract[|m-1|:|m-1|] t2))
2609 /// (bvult t1 t2)))
2610 /// ```
2611 ///
2612 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2613 pub fn Z3_mk_bvslt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2614
2615 /// Unsigned less than or equal to.
2616 ///
2617 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2618 pub fn Z3_mk_bvule(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2619
2620 /// Two's complement signed less than or equal to.
2621 ///
2622 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2623 pub fn Z3_mk_bvsle(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2624
2625 /// Unsigned greater than or equal to.
2626 ///
2627 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2628 pub fn Z3_mk_bvuge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2629
2630 /// Two's complement signed greater than or equal to.
2631 ///
2632 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2633 pub fn Z3_mk_bvsge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2634
2635 /// Unsigned greater than.
2636 ///
2637 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2638 pub fn Z3_mk_bvugt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2639
2640 /// Two's complement signed greater than.
2641 ///
2642 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2643 pub fn Z3_mk_bvsgt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2644
2645 /// Concatenate the given bit-vectors.
2646 ///
2647 /// The nodes `t1` and `t2` must have (possibly different) bit-vector sorts
2648 ///
2649 /// The result is a bit-vector of size `n1+n2`, where `n1` (`n2`) is the size
2650 /// of `t1` (`t2`).
2651 pub fn Z3_mk_concat(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2652
2653 /// Extract the bits `high` down to `low` from a bit-vector of
2654 /// size `m` to yield a new bit-vector of size `n`, where `n = high - low + 1`.
2655 ///
2656 /// The node `t1` must have a bit-vector sort.
2657 pub fn Z3_mk_extract(
2658 c: Z3_context,
2659 high: ::core::ffi::c_uint,
2660 low: ::core::ffi::c_uint,
2661 t1: Z3_ast,
2662 ) -> Option<Z3_ast>;
2663
2664 /// Sign-extend of the given bit-vector to the (signed) equivalent bit-vector of
2665 /// size `m+i`, where `m` is the size of the given
2666 /// bit-vector.
2667 ///
2668 /// The node `t1` must have a bit-vector sort.
2669 pub fn Z3_mk_sign_ext(c: Z3_context, i: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2670
2671 /// Extend the given bit-vector with zeros to the (unsigned) equivalent
2672 /// bit-vector of size `m+i`, where `m` is the size of the
2673 /// given bit-vector.
2674 ///
2675 /// The node `t1` must have a bit-vector sort.
2676 pub fn Z3_mk_zero_ext(c: Z3_context, i: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2677
2678 /// Repeat the given bit-vector up length `i`.
2679 ///
2680 /// The node `t1` must have a bit-vector sort.
2681 pub fn Z3_mk_repeat(c: Z3_context, i: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2682
2683 /// Shift left.
2684 ///
2685 /// It is equivalent to multiplication by `2^x` where `x` is the value of the
2686 /// third argument.
2687 ///
2688 /// NB. The semantics of shift operations varies between environments. This
2689 /// definition does not necessarily capture directly the semantics of the
2690 /// programming language or assembly architecture you are modeling.
2691 ///
2692 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2693 pub fn Z3_mk_bvshl(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2694
2695 /// Logical shift right.
2696 ///
2697 /// It is equivalent to unsigned division by `2^x` where `x` is the
2698 /// value of the third argument.
2699 ///
2700 /// NB. The semantics of shift operations varies between environments. This
2701 /// definition does not necessarily capture directly the semantics of the
2702 /// programming language or assembly architecture you are modeling.
2703 ///
2704 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2705 pub fn Z3_mk_bvlshr(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2706
2707 /// Arithmetic shift right.
2708 ///
2709 /// It is like logical shift right except that the most significant
2710 /// bits of the result always copy the most significant bit of the
2711 /// second argument.
2712 ///
2713 /// The semantics of shift operations varies between environments. This
2714 /// definition does not necessarily capture directly the semantics of the
2715 /// programming language or assembly architecture you are modeling.
2716 ///
2717 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2718 pub fn Z3_mk_bvashr(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2719
2720 /// Rotate bits of `t1` to the left `i` times.
2721 ///
2722 /// The node `t1` must have a bit-vector sort.
2723 pub fn Z3_mk_rotate_left(c: Z3_context, i: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2724
2725 /// Rotate bits of `t1` to the right `i` times.
2726 ///
2727 /// The node `t1` must have a bit-vector sort.
2728 pub fn Z3_mk_rotate_right(c: Z3_context, i: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2729
2730 /// Rotate bits of `t1` to the left `t2` times.
2731 ///
2732 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2733 pub fn Z3_mk_ext_rotate_left(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2734
2735 /// Rotate bits of `t1` to the right `t2` times.
2736 ///
2737 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2738 pub fn Z3_mk_ext_rotate_right(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2739
2740 /// Create an `n` bit bit-vector from the integer argument `t1`.
2741 ///
2742 /// The resulting bit-vector has `n` bits, where the i'th bit (counting
2743 /// from `0` to `n-1`) is `1` if `(t1 div 2^i) mod 2` is `1`.
2744 ///
2745 /// The node `t1` must have integer sort.
2746 pub fn Z3_mk_int2bv(c: Z3_context, n: ::core::ffi::c_uint, t1: Z3_ast) -> Option<Z3_ast>;
2747
2748 /// Create an integer from the bit-vector argument `t1`.
2749 /// If `is_signed` is false, then the bit-vector `t1` is treated as unsigned.
2750 /// So the result is non-negative
2751 /// and in the range `[0..2^N-1]`, where N are the number of bits in `t1`.
2752 /// If `is_signed` is true, `t1` is treated as a signed bit-vector.
2753 ///
2754 /// The node `t1` must have a bit-vector sort.
2755 pub fn Z3_mk_bv2int(c: Z3_context, t1: Z3_ast, is_signed: bool) -> Option<Z3_ast>;
2756
2757 /// Create a predicate that checks that the bit-wise addition
2758 /// of `t1` and `t2` does not overflow.
2759 ///
2760 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2761 pub fn Z3_mk_bvadd_no_overflow(
2762 c: Z3_context,
2763 t1: Z3_ast,
2764 t2: Z3_ast,
2765 is_signed: bool,
2766 ) -> Option<Z3_ast>;
2767
2768 /// Create a predicate that checks that the bit-wise signed addition
2769 /// of `t1` and `t2` does not underflow.
2770 ///
2771 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2772 pub fn Z3_mk_bvadd_no_underflow(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2773
2774 /// Create a predicate that checks that the bit-wise signed subtraction
2775 /// of `t1` and `t2` does not overflow.
2776 ///
2777 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2778 pub fn Z3_mk_bvsub_no_overflow(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2779
2780 /// Create a predicate that checks that the bit-wise subtraction
2781 /// of `t1` and `t2` does not underflow.
2782 ///
2783 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2784 pub fn Z3_mk_bvsub_no_underflow(
2785 c: Z3_context,
2786 t1: Z3_ast,
2787 t2: Z3_ast,
2788 is_signed: bool,
2789 ) -> Option<Z3_ast>;
2790
2791 /// Create a predicate that checks that the bit-wise signed division
2792 /// of `t1` and `t2` does not overflow.
2793 ///
2794 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2795 pub fn Z3_mk_bvsdiv_no_overflow(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2796
2797 /// Check that bit-wise negation does not overflow when
2798 /// `t1` is interpreted as a signed bit-vector.
2799 ///
2800 /// The node `t1` must have bit-vector sort.
2801 pub fn Z3_mk_bvneg_no_overflow(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
2802
2803 /// Create a predicate that checks that the bit-wise multiplication
2804 /// of `t1` and `t2` does not overflow.
2805 ///
2806 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2807 pub fn Z3_mk_bvmul_no_overflow(
2808 c: Z3_context,
2809 t1: Z3_ast,
2810 t2: Z3_ast,
2811 is_signed: bool,
2812 ) -> Option<Z3_ast>;
2813
2814 /// Create a predicate that checks that the bit-wise signed multiplication
2815 /// of `t1` and `t2` does not underflow.
2816 ///
2817 /// The nodes `t1` and `t2` must have the same bit-vector sort.
2818 pub fn Z3_mk_bvmul_no_underflow(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
2819
2820 /// Array read.
2821 /// The argument `a` is the array and `i` is the index of the array that gets read.
2822 ///
2823 /// The node `a` must have an array sort `[domain -> range]`,
2824 /// and `i` must have the sort `domain`.
2825 /// The sort of the result is `range`.
2826 ///
2827 /// # See also:
2828 ///
2829 /// - [`Z3_mk_array_sort`]
2830 /// - [`Z3_mk_store`]
2831 pub fn Z3_mk_select(c: Z3_context, a: Z3_ast, i: Z3_ast) -> Option<Z3_ast>;
2832
2833 /// n-ary Array read.
2834 /// The argument `a` is the array and `idxs` are the indices of the array that gets read.
2835 pub fn Z3_mk_select_n(
2836 c: Z3_context,
2837 a: Z3_ast,
2838 n: ::core::ffi::c_uint,
2839 idxs: *const Z3_ast,
2840 ) -> Option<Z3_ast>;
2841
2842 /// Array update.
2843 ///
2844 /// The node `a` must have an array sort `[domain -> range]`, `i` must have sort `domain`,
2845 /// `v` must have sort range. The sort of the result is `[domain -> range]`.
2846 /// The semantics of this function is given by the theory of arrays described in the SMT-LIB
2847 /// standard. See <http://smtlib.org/> for more details.
2848 /// The result of this function is an array that is equal to `a` (with respect to `select`)
2849 /// on all indices except for `i`, where it maps to `v` (and the `select` of `a` with
2850 /// respect to `i` may be a different value).
2851 ///
2852 /// # See also:
2853 ///
2854 /// - [`Z3_mk_array_sort`]
2855 /// - [`Z3_mk_select`]
2856 pub fn Z3_mk_store(c: Z3_context, a: Z3_ast, i: Z3_ast, v: Z3_ast) -> Option<Z3_ast>;
2857
2858 /// n-ary Array update.
2859 pub fn Z3_mk_store_n(
2860 c: Z3_context,
2861 a: Z3_ast,
2862 n: ::core::ffi::c_uint,
2863 idxs: *const Z3_ast,
2864 v: Z3_ast,
2865 ) -> Option<Z3_ast>;
2866
2867 /// Create the constant array.
2868 ///
2869 /// The resulting term is an array, such that a `select` on an arbitrary index
2870 /// produces the value `v`.
2871 ///
2872 /// - `c`: logical context.
2873 /// - `domain`: domain sort for the array.
2874 /// - `v`: value that the array maps to.
2875 pub fn Z3_mk_const_array(c: Z3_context, domain: Z3_sort, v: Z3_ast) -> Option<Z3_ast>;
2876
2877 /// Map f on the argument arrays.
2878 ///
2879 /// The `n` nodes `args` must be of array sorts `[domain_i -> range_i]`.
2880 /// The function declaration `f` must have type `range_1 .. range_n -> range`.
2881 /// `v` must have sort range. The sort of the result is `[domain_i -> range]`.
2882 ///
2883 /// # See also:
2884 ///
2885 /// - [`Z3_mk_array_sort`]
2886 /// - [`Z3_mk_store`]
2887 /// - [`Z3_mk_select`]
2888 pub fn Z3_mk_map(
2889 c: Z3_context,
2890 f: Z3_func_decl,
2891 n: ::core::ffi::c_uint,
2892 args: *const Z3_ast,
2893 ) -> Option<Z3_ast>;
2894
2895 /// Access the array default value.
2896 /// Produces the default range value, for arrays that can be represented as
2897 /// finite maps with a default range value.
2898 ///
2899 /// - `c`: logical context.
2900 /// - `array`: array value whose default range value is accessed.
2901 pub fn Z3_mk_array_default(c: Z3_context, array: Z3_ast) -> Option<Z3_ast>;
2902
2903 /// Create array with the same interpretation as a function.
2904 /// The array satisfies the property (f x) = (select (_ as-array f) x)
2905 /// for every argument x.
2906 pub fn Z3_mk_as_array(c: Z3_context, f: Z3_func_decl) -> Option<Z3_ast>;
2907
2908 /// Create Set type.
2909 pub fn Z3_mk_set_sort(c: Z3_context, ty: Z3_sort) -> Option<Z3_sort>;
2910
2911 /// Create the empty set.
2912 pub fn Z3_mk_empty_set(c: Z3_context, domain: Z3_sort) -> Option<Z3_ast>;
2913
2914 /// Create the full set.
2915 pub fn Z3_mk_full_set(c: Z3_context, domain: Z3_sort) -> Option<Z3_ast>;
2916
2917 /// Add an element to a set.
2918 ///
2919 /// The first argument must be a set, the second an element.
2920 pub fn Z3_mk_set_add(c: Z3_context, set: Z3_ast, elem: Z3_ast) -> Option<Z3_ast>;
2921
2922 /// Remove an element to a set.
2923 ///
2924 /// The first argument must be a set, the second an element.
2925 pub fn Z3_mk_set_del(c: Z3_context, set: Z3_ast, elem: Z3_ast) -> Option<Z3_ast>;
2926
2927 /// Take the union of a list of sets.
2928 pub fn Z3_mk_set_union(
2929 c: Z3_context,
2930 num_args: ::core::ffi::c_uint,
2931 args: *const Z3_ast,
2932 ) -> Option<Z3_ast>;
2933
2934 /// Take the intersection of a list of sets.
2935 pub fn Z3_mk_set_intersect(
2936 c: Z3_context,
2937 num_args: ::core::ffi::c_uint,
2938 args: *const Z3_ast,
2939 ) -> Option<Z3_ast>;
2940
2941 /// Take the set difference between two sets.
2942 pub fn Z3_mk_set_difference(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2943
2944 /// Take the complement of a set.
2945 pub fn Z3_mk_set_complement(c: Z3_context, arg: Z3_ast) -> Option<Z3_ast>;
2946
2947 /// Check for set membership.
2948 ///
2949 /// The first argument should be an element type of the set.
2950 pub fn Z3_mk_set_member(c: Z3_context, elem: Z3_ast, set: Z3_ast) -> Option<Z3_ast>;
2951
2952 /// Check for subsetness of sets.
2953 pub fn Z3_mk_set_subset(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2954
2955 /// Create array extensionality index given two arrays with the same sort.
2956 /// The meaning is given by the axiom:
2957 /// (=> (= (select A (array-ext A B)) (select B (array-ext A B))) (= A B))
2958 pub fn Z3_mk_array_ext(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
2959
2960 /// Create a numeral of a given sort.
2961 ///
2962 /// - `c`: logical context.
2963 /// - `numeral`: A string representing the numeral value in decimal notation. The string may be of the form `[num]*[.[num]*][E[+|-][num]+]`.
2964 /// If the given sort is a real, then the numeral can be a rational, that is, a string of the form `[num]* / [num]*` .
2965 /// - `ty`: The sort of the numeral. In the current implementation, the given sort can be an int, real, finite-domain, or bit-vectors of arbitrary size.
2966 ///
2967 /// # See also:
2968 ///
2969 /// - [`Z3_mk_int`]
2970 /// - [`Z3_mk_unsigned_int`]
2971 pub fn Z3_mk_numeral(c: Z3_context, numeral: Z3_string, ty: Z3_sort) -> Option<Z3_ast>;
2972
2973 /// Create a real from a fraction.
2974 ///
2975 /// - `c`: logical context.
2976 /// - `num`: numerator of rational.
2977 /// - `den`: denominator of rational.
2978 ///
2979 /// # Preconditions:
2980 ///
2981 /// - `den != 0`
2982 ///
2983 /// # See also:
2984 ///
2985 /// - [`Z3_mk_numeral`]
2986 /// - [`Z3_mk_int`]
2987 /// - [`Z3_mk_unsigned_int`]
2988 pub fn Z3_mk_real(
2989 c: Z3_context,
2990 num: ::core::ffi::c_int,
2991 den: ::core::ffi::c_int,
2992 ) -> Option<Z3_ast>;
2993
2994 /// Create a numeral of an int, bit-vector, or finite-domain sort.
2995 ///
2996 /// This function can be use to create numerals that fit in a machine integer.
2997 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
2998 ///
2999 /// # See also:
3000 ///
3001 /// - [`Z3_mk_numeral`]
3002 pub fn Z3_mk_int(c: Z3_context, v: ::core::ffi::c_int, ty: Z3_sort) -> Option<Z3_ast>;
3003
3004 /// Create a numeral of a int, bit-vector, or finite-domain sort.
3005 ///
3006 /// This function can be use to create numerals that fit in a machine unsigned integer.
3007 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
3008 ///
3009 /// # See also:
3010 ///
3011 /// - [`Z3_mk_numeral`]
3012 pub fn Z3_mk_unsigned_int(c: Z3_context, v: ::core::ffi::c_uint, ty: Z3_sort)
3013 -> Option<Z3_ast>;
3014
3015 /// Create a numeral of a int, bit-vector, or finite-domain sort.
3016 ///
3017 /// This function can be use to create numerals that fit in a machine `int64_t` integer.
3018 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
3019 ///
3020 /// # See also:
3021 ///
3022 /// - [`Z3_mk_numeral`]
3023 pub fn Z3_mk_int64(c: Z3_context, v: i64, ty: Z3_sort) -> Option<Z3_ast>;
3024
3025 /// Create a numeral of a int, bit-vector, or finite-domain sort.
3026 ///
3027 /// This function can be use to create numerals that fit in a machine `uint64_t` integer.
3028 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
3029 ///
3030 /// # See also:
3031 ///
3032 /// - [`Z3_mk_numeral`]
3033 pub fn Z3_mk_unsigned_int64(c: Z3_context, v: u64, ty: Z3_sort) -> Option<Z3_ast>;
3034
3035 /// create a bit-vector numeral from a vector of Booleans.
3036 ///
3037 /// # See also:
3038 ///
3039 /// - [`Z3_mk_numeral`]
3040 pub fn Z3_mk_bv_numeral(
3041 c: Z3_context,
3042 sz: ::core::ffi::c_uint,
3043 bits: *const bool,
3044 ) -> Option<Z3_ast>;
3045
3046 /// Create a sequence sort out of the sort for the elements.
3047 pub fn Z3_mk_seq_sort(c: Z3_context, s: Z3_sort) -> Option<Z3_sort>;
3048
3049 /// Check if `s` is a sequence sort.
3050 pub fn Z3_is_seq_sort(c: Z3_context, s: Z3_sort) -> bool;
3051
3052 /// Create a regular expression sort out of a sequence sort.
3053 pub fn Z3_mk_re_sort(c: Z3_context, seq: Z3_sort) -> Option<Z3_sort>;
3054
3055 /// Check if `s` is a regular expression sort.
3056 pub fn Z3_is_re_sort(c: Z3_context, s: Z3_sort) -> bool;
3057
3058 /// Create a sort for 8 bit strings.
3059 ///
3060 /// This function creates a sort for ASCII strings.
3061 /// Each character is 8 bits.
3062 pub fn Z3_mk_string_sort(c: Z3_context) -> Option<Z3_sort>;
3063
3064 /// Check if `s` is a string sort.
3065 pub fn Z3_is_string_sort(c: Z3_context, s: Z3_sort) -> bool;
3066
3067 /// Create a string constant out of the string that is passed in
3068 pub fn Z3_mk_string(c: Z3_context, s: Z3_string) -> Option<Z3_ast>;
3069
3070 /// Determine if `s` is a string constant.
3071 pub fn Z3_is_string(c: Z3_context, s: Z3_ast) -> bool;
3072
3073 /// Retrieve the string constant stored in `s`.
3074 ///
3075 /// # Preconditions:
3076 ///
3077 /// - `Z3_is_string(c, s)`
3078 pub fn Z3_get_string(c: Z3_context, s: Z3_ast) -> Z3_string;
3079
3080 /// Create an empty sequence of the sequence sort `seq`.
3081 ///
3082 /// # Preconditions:
3083 ///
3084 /// - `s` is a sequence sort.
3085 pub fn Z3_mk_seq_empty(c: Z3_context, seq: Z3_sort) -> Option<Z3_ast>;
3086
3087 /// Create a unit sequence of `a`.
3088 pub fn Z3_mk_seq_unit(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
3089
3090 /// Concatenate sequences.
3091 ///
3092 /// # Preconditions:
3093 ///
3094 /// - `n > 0`
3095 pub fn Z3_mk_seq_concat(
3096 c: Z3_context,
3097 n: ::core::ffi::c_uint,
3098 args: *const Z3_ast,
3099 ) -> Option<Z3_ast>;
3100
3101 /// Check if `prefix` is a prefix of `s`.
3102 ///
3103 /// # Preconditions:
3104 ///
3105 /// - `prefix` and `s` are the same sequence sorts.
3106 pub fn Z3_mk_seq_prefix(c: Z3_context, prefix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
3107
3108 /// Check if `suffix` is a suffix of `s`.
3109 ///
3110 /// # Preconditions:
3111 ///
3112 /// - `suffix` and `s` are the same sequence sorts.
3113 pub fn Z3_mk_seq_suffix(c: Z3_context, suffix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
3114
3115 /// Check if `container` contains `containee`.
3116 ///
3117 /// # Preconditions:
3118 ///
3119 /// - `container` and `containee` are the same sequence sorts.
3120 pub fn Z3_mk_seq_contains(
3121 c: Z3_context,
3122 container: Z3_ast,
3123 containee: Z3_ast,
3124 ) -> Option<Z3_ast>;
3125
3126 /// Extract subsequence starting at `offset` of `length`.
3127 pub fn Z3_mk_seq_extract(
3128 c: Z3_context,
3129 s: Z3_ast,
3130 offset: Z3_ast,
3131 length: Z3_ast,
3132 ) -> Option<Z3_ast>;
3133
3134 /// Replace the first occurrence of `src` with `dst` in `s`.
3135 pub fn Z3_mk_seq_replace(c: Z3_context, s: Z3_ast, src: Z3_ast, dst: Z3_ast) -> Option<Z3_ast>;
3136
3137 /// Retrieve from `s` the unit sequence positioned at position `index`.
3138 pub fn Z3_mk_seq_at(c: Z3_context, s: Z3_ast, index: Z3_ast) -> Option<Z3_ast>;
3139
3140 /// Retrieve from `s` the element positioned at position `index`.
3141 /// The function is under-specified if the index is out of bounds.
3142 pub fn Z3_mk_seq_nth(c: Z3_context, s: Z3_ast, index: Z3_ast) -> Option<Z3_ast>;
3143
3144 /// Return the length of the sequence `s`.
3145 pub fn Z3_mk_seq_length(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
3146
3147 /// Return index of first occurrence of `substr` in `s` starting from offset `offset`.
3148 /// If `s` does not contain `substr`, then the value is -1, if `offset` is the length of `s`, then the value is -1 as well.
3149 /// The function is under-specified if `offset` is negative or larger than the length of `s`.
3150 pub fn Z3_mk_seq_index(
3151 c: Z3_context,
3152 s: Z3_ast,
3153 substr: Z3_ast,
3154 offset: Z3_ast,
3155 ) -> Option<Z3_ast>;
3156
3157 /// Convert string to integer.
3158 pub fn Z3_mk_str_to_int(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
3159
3160 /// Integer to string conversion.
3161 pub fn Z3_mk_int_to_str(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
3162
3163 /// Create a regular expression that accepts the sequence `seq`.
3164 pub fn Z3_mk_seq_to_re(c: Z3_context, seq: Z3_ast) -> Option<Z3_ast>;
3165
3166 /// Check if `seq` is in the language generated by the regular expression `re`.
3167 pub fn Z3_mk_seq_in_re(c: Z3_context, seq: Z3_ast, re: Z3_ast) -> Option<Z3_ast>;
3168
3169 /// Create the regular language `re+`.
3170 pub fn Z3_mk_re_plus(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
3171
3172 /// Create the regular language `re*`.
3173 pub fn Z3_mk_re_star(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
3174
3175 /// Create the regular language `re?`.
3176 pub fn Z3_mk_re_option(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
3177
3178 /// Create the union of the regular languages.
3179 ///
3180 /// # Preconditions:
3181 ///
3182 /// - `n > 0`
3183 pub fn Z3_mk_re_union(
3184 c: Z3_context,
3185 n: ::core::ffi::c_uint,
3186 args: *const Z3_ast,
3187 ) -> Option<Z3_ast>;
3188
3189 /// Create the concatenation of the regular languages.
3190 ///
3191 /// # Preconditions:
3192 ///
3193 /// - `n > 0`
3194 pub fn Z3_mk_re_concat(
3195 c: Z3_context,
3196 n: ::core::ffi::c_uint,
3197 args: *const Z3_ast,
3198 ) -> Option<Z3_ast>;
3199
3200 /// Create the range regular expression over two sequences of length 1.
3201 pub fn Z3_mk_re_range(c: Z3_context, lo: Z3_ast, hi: Z3_ast) -> Option<Z3_ast>;
3202
3203 /// Create a regular expression that accepts all singleton sequences of the regular expression sort.
3204 ///
3205 /// Requires Z3 4.8.13 or later.
3206 pub fn Z3_mk_re_allchar(c: Z3_context, regex_sort: Z3_sort) -> Option<Z3_ast>;
3207
3208 /// Create a regular expression loop. The supplied regular expression `r` is repeated
3209 /// between `lo` and `hi` times. The `lo` should be below `hi` with one execution: when
3210 /// supplying the value `hi` as 0, the meaning is to repeat the argument `r` at least
3211 /// `lo` number of times, and with an unbounded upper bound.
3212 pub fn Z3_mk_re_loop(
3213 c: Z3_context,
3214 r: Z3_ast,
3215 lo: ::core::ffi::c_uint,
3216 hi: ::core::ffi::c_uint,
3217 ) -> Option<Z3_ast>;
3218
3219 /// Create a power regular expression.
3220 ///
3221 /// Requires Z3 4.8.15 or later.
3222 pub fn Z3_mk_re_power(c: Z3_context, re: Z3_ast, n: ::core::ffi::c_uint) -> Option<Z3_ast>;
3223
3224 /// Create the intersection of the regular languages.
3225 ///
3226 /// # Preconditions:
3227 ///
3228 /// - `n > 0`
3229 pub fn Z3_mk_re_intersect(
3230 c: Z3_context,
3231 n: ::core::ffi::c_uint,
3232 args: *const Z3_ast,
3233 ) -> Option<Z3_ast>;
3234
3235 /// Create the complement of the regular language `re`.
3236 pub fn Z3_mk_re_complement(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
3237
3238 /// Create the difference of regular expressions.
3239 ///
3240 /// Requires Z3 4.8.14 or later.
3241 pub fn Z3_mk_re_diff(c: Z3_context, re1: Z3_ast, re2: Z3_ast) -> Option<Z3_ast>;
3242
3243 /// Create an empty regular expression of sort `re`.
3244 ///
3245 /// # Preconditions:
3246 ///
3247 /// - `re` is a regular expression sort.
3248 pub fn Z3_mk_re_empty(c: Z3_context, re: Z3_sort) -> Option<Z3_ast>;
3249
3250 /// Create an universal regular expression of sort `re`.
3251 ///
3252 /// # Preconditions:
3253 ///
3254 /// - `re` is a regular expression sort.
3255 pub fn Z3_mk_re_full(c: Z3_context, re: Z3_sort) -> Option<Z3_ast>;
3256
3257 /// Create a pattern for quantifier instantiation.
3258 ///
3259 /// Z3 uses pattern matching to instantiate quantifiers. If a
3260 /// pattern is not provided for a quantifier, then Z3 will
3261 /// automatically compute a set of patterns for it. However, for
3262 /// optimal performance, the user should provide the patterns.
3263 ///
3264 /// Patterns comprise a list of terms. The list should be
3265 /// non-empty. If the list comprises of more than one term, it is
3266 /// a called a multi-pattern.
3267 ///
3268 /// In general, one can pass in a list of (multi-)patterns in the
3269 /// quantifier constructor.
3270 ///
3271 /// # See also:
3272 ///
3273 /// - [`Z3_mk_forall`]
3274 /// - [`Z3_mk_exists`]
3275 pub fn Z3_mk_pattern(
3276 c: Z3_context,
3277 num_patterns: ::core::ffi::c_uint,
3278 terms: *const Z3_ast,
3279 ) -> Option<Z3_pattern>;
3280
3281 /// Create a bound variable.
3282 ///
3283 /// Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain
3284 /// the meaning of de-Bruijn indices by indicating the compilation process from
3285 /// non-de-Bruijn formulas to de-Bruijn format.
3286 ///
3287 /// ```text
3288 /// abs(forall (x1) phi) = forall (x1) abs1(phi, x1, 0)
3289 /// abs(forall (x1, x2) phi) = abs(forall (x1) abs(forall (x2) phi))
3290 /// abs1(x, x, n) = b_n
3291 /// abs1(y, x, n) = y
3292 /// abs1(f(t1,...,tn), x, n) = f(abs1(t1,x,n), ..., abs1(tn,x,n))
3293 /// abs1(forall (x1) phi, x, n) = forall (x1) (abs1(phi, x, n+1))
3294 /// ```
3295 ///
3296 /// The last line is significant: the index of a bound variable is different depending
3297 /// on the scope in which it appears. The deeper x appears, the higher is its
3298 /// index.
3299 ///
3300 /// - `c`: logical context
3301 /// - `index`: de-Bruijn index
3302 /// - `ty`: sort of the bound variable
3303 ///
3304 /// # See also:
3305 ///
3306 /// - [`Z3_mk_forall`]
3307 /// - [`Z3_mk_exists`]
3308 pub fn Z3_mk_bound(c: Z3_context, index: ::core::ffi::c_uint, ty: Z3_sort) -> Option<Z3_ast>;
3309
3310 /// Create a forall formula. It takes an expression `body` that contains bound variables
3311 /// of the same sorts as the sorts listed in the array `sorts`. The bound variables are de-Bruijn indices created
3312 /// using [`Z3_mk_bound`]. The array `decl_names` contains the names that the quantified formula uses for the
3313 /// bound variables. Z3 applies the convention that the last element in the `decl_names` and `sorts` array
3314 /// refers to the variable with index 0, the second to last element of `decl_names` and `sorts` refers
3315 /// to the variable with index 1, etc.
3316 ///
3317 /// - `c`: logical context.
3318 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
3319 /// - `num_patterns`: number of patterns.
3320 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
3321 /// - `num_decls`: number of variables to be bound.
3322 /// - `sorts`: the sorts of the bound variables.
3323 /// - `decl_names`: names of the bound variables
3324 /// - `body`: the body of the quantifier.
3325 ///
3326 /// # See also:
3327 ///
3328 /// - [`Z3_mk_pattern`]
3329 /// - [`Z3_mk_bound`]
3330 /// - [`Z3_mk_exists`]
3331 pub fn Z3_mk_forall(
3332 c: Z3_context,
3333 weight: ::core::ffi::c_uint,
3334 num_patterns: ::core::ffi::c_uint,
3335 patterns: *const Z3_pattern,
3336 num_decls: ::core::ffi::c_uint,
3337 sorts: *const Z3_sort,
3338 decl_names: *const Z3_symbol,
3339 body: Z3_ast,
3340 ) -> Option<Z3_ast>;
3341
3342 /// Create an exists formula. Similar to [`Z3_mk_forall`].
3343 ///
3344 /// # See also:
3345 ///
3346 /// - [`Z3_mk_pattern`]
3347 /// - [`Z3_mk_bound`]
3348 /// - [`Z3_mk_forall`]
3349 /// - [`Z3_mk_quantifier`]
3350 pub fn Z3_mk_exists(
3351 c: Z3_context,
3352 weight: ::core::ffi::c_uint,
3353 num_patterns: ::core::ffi::c_uint,
3354 patterns: *const Z3_pattern,
3355 num_decls: ::core::ffi::c_uint,
3356 sorts: *const Z3_sort,
3357 decl_names: *const Z3_symbol,
3358 body: Z3_ast,
3359 ) -> Option<Z3_ast>;
3360
3361 /// Create a quantifier - universal or existential, with pattern hints.
3362 /// See the documentation for [`Z3_mk_forall`] for an explanation of the parameters.
3363 ///
3364 /// - `c`: logical context.
3365 /// - `is_forall`: flag to indicate if this is a universal or existential quantifier.
3366 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
3367 /// - `num_patterns`: number of patterns.
3368 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`]
3369 /// - `num_decls`: number of variables to be bound.
3370 /// - `sorts`: array of sorts of the bound variables.
3371 /// - `decl_names`: names of the bound variables.
3372 /// - `body`: the body of the quantifier.
3373 ///
3374 /// # See also:
3375 ///
3376 /// - [`Z3_mk_pattern`]
3377 /// - [`Z3_mk_bound`]
3378 /// - [`Z3_mk_forall`]
3379 /// - [`Z3_mk_exists`]
3380 pub fn Z3_mk_quantifier(
3381 c: Z3_context,
3382 is_forall: bool,
3383 weight: ::core::ffi::c_uint,
3384 num_patterns: ::core::ffi::c_uint,
3385 patterns: *const Z3_pattern,
3386 num_decls: ::core::ffi::c_uint,
3387 sorts: *const Z3_sort,
3388 decl_names: *const Z3_symbol,
3389 body: Z3_ast,
3390 ) -> Option<Z3_ast>;
3391
3392 /// Create a quantifier - universal or existential, with pattern hints, no patterns, and attributes
3393 ///
3394 /// - `c`: logical context.
3395 /// - `is_forall`: flag to indicate if this is a universal or existential quantifier.
3396 /// - `quantifier_id`: identifier to identify quantifier
3397 /// - `skolem_id`: identifier to identify skolem constants introduced by quantifier.
3398 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
3399 /// - `num_patterns`: number of patterns.
3400 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
3401 /// - `num_no_patterns`: number of `no_patterns`.
3402 /// - `no_patterns`: array containing subexpressions to be excluded from inferred patterns.
3403 /// - `num_decls`: number of variables to be bound.
3404 /// - `sorts`: array of sorts of the bound variables.
3405 /// - `decl_names`: names of the bound variables.
3406 /// - `body`: the body of the quantifier.
3407 ///
3408 /// # See also:
3409 ///
3410 /// - [`Z3_mk_pattern`]
3411 /// - [`Z3_mk_bound`]
3412 /// - [`Z3_mk_forall`]
3413 /// - [`Z3_mk_exists`]
3414 pub fn Z3_mk_quantifier_ex(
3415 c: Z3_context,
3416 is_forall: bool,
3417 weight: ::core::ffi::c_uint,
3418 quantifier_id: Z3_symbol,
3419 skolem_id: Z3_symbol,
3420 num_patterns: ::core::ffi::c_uint,
3421 patterns: *const Z3_pattern,
3422 num_no_patterns: ::core::ffi::c_uint,
3423 no_patterns: *const Z3_ast,
3424 num_decls: ::core::ffi::c_uint,
3425 sorts: *const Z3_sort,
3426 decl_names: *const Z3_symbol,
3427 body: Z3_ast,
3428 ) -> Option<Z3_ast>;
3429
3430 /// Create a universal quantifier using a list of constants that
3431 /// will form the set of bound variables.
3432 ///
3433 /// - `c`: logical context.
3434 /// - `weight`: quantifiers are associated with weights indicating the importance of using
3435 /// the quantifier during instantiation. By default, pass the weight 0.
3436 /// - `num_bound`: number of constants to be abstracted into bound variables.
3437 /// - `bound`: array of constants to be abstracted into bound variables.
3438 /// - `num_patterns`: number of patterns.
3439 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`]
3440 /// - `body`: the body of the quantifier.
3441 ///
3442 /// # See also:
3443 ///
3444 /// - [`Z3_mk_pattern`]
3445 /// - [`Z3_mk_exists_const`]
3446 pub fn Z3_mk_forall_const(
3447 c: Z3_context,
3448 weight: ::core::ffi::c_uint,
3449 num_bound: ::core::ffi::c_uint,
3450 bound: *const Z3_app,
3451 num_patterns: ::core::ffi::c_uint,
3452 patterns: *const Z3_pattern,
3453 body: Z3_ast,
3454 ) -> Option<Z3_ast>;
3455
3456 /// Similar to [`Z3_mk_forall_const`].
3457 ///
3458 /// Create an existential quantifier using a list of constants that
3459 /// will form the set of bound variables.
3460 ///
3461 /// - `c`: logical context.
3462 /// - `weight`: quantifiers are associated with weights indicating the importance of using
3463 /// the quantifier during instantiation. By default, pass the weight 0.
3464 /// - `num_bound`: number of constants to be abstracted into bound variables.
3465 /// - `bound`: array of constants to be abstracted into bound variables.
3466 /// - `num_patterns`: number of patterns.
3467 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
3468 /// - `body`: the body of the quantifier.
3469 ///
3470 /// # See also:
3471 ///
3472 /// - [`Z3_mk_pattern`]
3473 /// - [`Z3_mk_forall_const`]
3474 pub fn Z3_mk_exists_const(
3475 c: Z3_context,
3476 weight: ::core::ffi::c_uint,
3477 num_bound: ::core::ffi::c_uint,
3478 bound: *const Z3_app,
3479 num_patterns: ::core::ffi::c_uint,
3480 patterns: *const Z3_pattern,
3481 body: Z3_ast,
3482 ) -> Option<Z3_ast>;
3483
3484 /// Create a universal or existential quantifier using a list of
3485 /// constants that will form the set of bound variables.
3486 pub fn Z3_mk_quantifier_const(
3487 c: Z3_context,
3488 is_forall: bool,
3489 weight: ::core::ffi::c_uint,
3490 num_bound: ::core::ffi::c_uint,
3491 bound: *const Z3_app,
3492 num_patterns: ::core::ffi::c_uint,
3493 patterns: *const Z3_pattern,
3494 body: Z3_ast,
3495 ) -> Option<Z3_ast>;
3496
3497 /// Create a universal or existential quantifier using a list of
3498 /// constants that will form the set of bound variables.
3499 pub fn Z3_mk_quantifier_const_ex(
3500 c: Z3_context,
3501 is_forall: bool,
3502 weight: ::core::ffi::c_uint,
3503 quantifier_id: Z3_symbol,
3504 skolem_id: Z3_symbol,
3505 num_bound: ::core::ffi::c_uint,
3506 bound: *const Z3_app,
3507 num_patterns: ::core::ffi::c_uint,
3508 patterns: *const Z3_pattern,
3509 num_no_patterns: ::core::ffi::c_uint,
3510 no_patterns: *const Z3_ast,
3511 body: Z3_ast,
3512 ) -> Option<Z3_ast>;
3513
3514 /// Create a lambda expression.
3515 ///
3516 /// It takes an expression `body` that contains bound variables of
3517 /// the same sorts as the sorts listed in the array `sorts`. The
3518 /// bound variables are de-Bruijn indices created using [`Z3_mk_bound`].
3519 /// The array `decl_names` contains the names that the quantified
3520 /// formula uses for the bound variables. Z3 applies the convention
3521 /// that the last element in the `decl_names` and `sorts` array
3522 /// refers to the variable with index `0`, the second to last element
3523 /// of `decl_names` and `sorts` refers to the variable with index `1`, etc.
3524 ///
3525 /// The sort of the resulting expression is `(Array sorts range)` where
3526 /// `range` is the sort of `body`. For example, if the lambda binds two
3527 /// variables of sort `Int` and `Bool`, and the `body` has sort `Real`,
3528 /// the sort of the expression is `(Array Int Bool Real)`.
3529 ///
3530 /// - `c`: logical context
3531 /// - `num_decls`: number of variables to be bound.
3532 /// - `sorts`: the sorts of the bound variables.
3533 /// - `decl_names`: names of the bound variables
3534 /// - `body`: the body of the lambda expression.
3535 ///
3536 /// # See also:
3537 ///
3538 /// - [`Z3_mk_bound`]
3539 /// - [`Z3_mk_forall`]
3540 /// - [`Z3_mk_lambda_const`]
3541 pub fn Z3_mk_lambda(
3542 c: Z3_context,
3543 num_decls: ::core::ffi::c_uint,
3544 sorts: *const Z3_sort,
3545 decl_names: *const Z3_symbol,
3546 body: Z3_ast,
3547 ) -> Option<Z3_ast>;
3548
3549 /// Create a lambda expression using a list of constants that form the set
3550 /// of bound variables
3551 ///
3552 /// - `c`: logical context.
3553 /// - `num_bound`: number of constants to be abstracted into bound variables.
3554 /// - `bound`: array of constants to be abstracted into bound variables.
3555 /// - `body`: the body of the lambda expression.
3556 ///
3557 /// # See also:
3558 ///
3559 /// - [`Z3_mk_bound`]
3560 /// - [`Z3_mk_forall`]
3561 /// - [`Z3_mk_lambda`]
3562 pub fn Z3_mk_lambda_const(
3563 c: Z3_context,
3564 num_bound: ::core::ffi::c_uint,
3565 bound: *const Z3_app,
3566 body: Z3_ast,
3567 ) -> Option<Z3_ast>;
3568
3569 /// Return `SymbolKind::Int` if the symbol was constructed
3570 /// using [`Z3_mk_int_symbol`],
3571 /// and `SymbolKind::String` if the symbol
3572 /// was constructed using [`Z3_mk_string_symbol`].
3573 pub fn Z3_get_symbol_kind(c: Z3_context, s: Z3_symbol) -> SymbolKind;
3574
3575 /// Return the symbol int value.
3576 ///
3577 /// # Preconditions:
3578 ///
3579 /// - `Z3_get_symbol_kind(s) == SymbolKind::Int`
3580 ///
3581 /// # See also:
3582 ///
3583 /// - [`Z3_mk_int_symbol`]
3584 pub fn Z3_get_symbol_int(c: Z3_context, s: Z3_symbol) -> ::core::ffi::c_int;
3585
3586 /// Return the symbol name.
3587 ///
3588 /// Warning: The returned buffer is statically allocated by Z3. It will
3589 /// be automatically deallocated when [`Z3_del_context`] is invoked.
3590 /// So, the buffer is invalidated in the next call to `Z3_get_symbol_string`.
3591 ///
3592 /// # Preconditions:
3593 ///
3594 /// - `Z3_get_symbol_kind(s) == SymbolKind::String`
3595 ///
3596 /// # See also:
3597 ///
3598 /// - [`Z3_mk_string_symbol`]
3599 pub fn Z3_get_symbol_string(c: Z3_context, s: Z3_symbol) -> Z3_string;
3600
3601 /// Return the sort name as a symbol.
3602 pub fn Z3_get_sort_name(c: Z3_context, d: Z3_sort) -> Option<Z3_symbol>;
3603
3604 /// Return a unique identifier for `s`.
3605 pub fn Z3_get_sort_id(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
3606
3607 /// Convert a [`Z3_sort`] into [`Z3_ast`]. This is just type casting.
3608 ///
3609 /// # See also:
3610 ///
3611 /// - [`Z3_app_to_ast`]
3612 /// - [`Z3_func_decl_to_ast`]
3613 /// - [`Z3_pattern_to_ast`]
3614 pub fn Z3_sort_to_ast(c: Z3_context, s: Z3_sort) -> Option<Z3_ast>;
3615
3616 /// compare sorts.
3617 pub fn Z3_is_eq_sort(c: Z3_context, s1: Z3_sort, s2: Z3_sort) -> bool;
3618
3619 /// Return the sort kind (e.g., array, tuple, int, bool, etc).
3620 ///
3621 /// # See also:
3622 ///
3623 /// - [`SortKind`]
3624 pub fn Z3_get_sort_kind(c: Z3_context, t: Z3_sort) -> SortKind;
3625
3626 /// Return the size of the given bit-vector sort.
3627 ///
3628 /// # Preconditions:
3629 ///
3630 /// - `Z3_get_sort_kind(c, t) == SortKind::BV`
3631 ///
3632 /// # See also:
3633 ///
3634 /// - [`Z3_mk_bv_sort`]
3635 /// - [`Z3_get_sort_kind`]
3636 pub fn Z3_get_bv_sort_size(c: Z3_context, t: Z3_sort) -> ::core::ffi::c_uint;
3637
3638 /// Store the size of the sort in `r`. Return `false` if the call failed.
3639 /// That is, `Z3_get_sort_kind(s) == SortKind::FiniteDomain`
3640 pub fn Z3_get_finite_domain_sort_size(c: Z3_context, s: Z3_sort, r: *mut u64) -> bool;
3641
3642 /// Return the domain of the given array sort.
3643 ///
3644 /// In the case of a multi-dimensional array, this function
3645 /// returns the sort of the first dimension.
3646 ///
3647 /// # Preconditions:
3648 ///
3649 /// - `Z3_get_sort_kind(c, t) == SortKind::Array`
3650 ///
3651 /// # See also:
3652 ///
3653 /// - [`Z3_mk_array_sort`]
3654 /// - [`Z3_get_sort_kind`]
3655 pub fn Z3_get_array_sort_domain(c: Z3_context, t: Z3_sort) -> Option<Z3_sort>;
3656
3657 /// Return the range of the given array sort.
3658 ///
3659 /// # Preconditions:
3660 ///
3661 /// - `Z3_get_sort_kind(c, t) == SortKind::Array`
3662 ///
3663 /// # See also:
3664 ///
3665 /// - [`Z3_mk_array_sort`]
3666 /// - [`Z3_get_sort_kind`]
3667 pub fn Z3_get_array_sort_range(c: Z3_context, t: Z3_sort) -> Option<Z3_sort>;
3668
3669 /// Return the constructor declaration of the given tuple
3670 /// sort.
3671 ///
3672 /// # Preconditions:
3673 ///
3674 /// - `Z3_get_sort_kind(c, t) == SortKind::Datatype`
3675 ///
3676 /// # See also:
3677 ///
3678 /// - [`Z3_mk_tuple_sort`]
3679 /// - [`Z3_get_sort_kind`]
3680 pub fn Z3_get_tuple_sort_mk_decl(c: Z3_context, t: Z3_sort) -> Option<Z3_func_decl>;
3681
3682 /// Return the number of fields of the given tuple sort.
3683 ///
3684 /// # Preconditions:
3685 ///
3686 /// - `Z3_get_sort_kind(c, t) == SortKind::Datatype`
3687 ///
3688 /// # See also:
3689 ///
3690 /// - [`Z3_mk_tuple_sort`]
3691 /// - [`Z3_get_sort_kind`]
3692 pub fn Z3_get_tuple_sort_num_fields(c: Z3_context, t: Z3_sort) -> ::core::ffi::c_uint;
3693
3694 /// Return the i-th field declaration (i.e., projection function declaration)
3695 /// of the given tuple sort.
3696 ///
3697 /// # Preconditions:
3698 ///
3699 /// - `Z3_get_sort_kind(t) == SortKind::Datatype`
3700 /// - `i < Z3_get_tuple_sort_num_fields(c, t)`
3701 ///
3702 /// # See also:
3703 ///
3704 /// - [`Z3_mk_tuple_sort`]
3705 /// - [`Z3_get_sort_kind`]
3706 pub fn Z3_get_tuple_sort_field_decl(
3707 c: Z3_context,
3708 t: Z3_sort,
3709 i: ::core::ffi::c_uint,
3710 ) -> Option<Z3_func_decl>;
3711
3712 /// Return number of constructors for datatype.
3713 ///
3714 /// # Preconditions:
3715 ///
3716 /// - `Z3_get_sort_kind(t) == SortKind::Datatype`
3717 ///
3718 /// # See also:
3719 ///
3720 /// - [`Z3_get_datatype_sort_constructor`]
3721 /// - [`Z3_get_datatype_sort_recognizer`]
3722 /// - [`Z3_get_datatype_sort_constructor_accessor`]
3723 pub fn Z3_get_datatype_sort_num_constructors(c: Z3_context, t: Z3_sort) -> ::core::ffi::c_uint;
3724
3725 /// Return idx'th constructor.
3726 ///
3727 /// # Preconditions:
3728 ///
3729 /// - `Z3_get_sort_kind(t) == SortKind::Datatype`
3730 /// - `idx < Z3_get_datatype_sort_num_constructors(c, t)`
3731 ///
3732 /// # See also:
3733 ///
3734 /// - [`Z3_get_datatype_sort_num_constructors`]
3735 /// - [`Z3_get_datatype_sort_recognizer`]
3736 /// - [`Z3_get_datatype_sort_constructor_accessor`]
3737 pub fn Z3_get_datatype_sort_constructor(
3738 c: Z3_context,
3739 t: Z3_sort,
3740 idx: ::core::ffi::c_uint,
3741 ) -> Option<Z3_func_decl>;
3742
3743 /// Return idx'th recognizer.
3744 ///
3745 /// # Preconditions:
3746 ///
3747 /// - `Z3_get_sort_kind(t) == SortKind::Datatype`
3748 /// - `idx < Z3_get_datatype_sort_num_constructors(c, t)`
3749 ///
3750 /// # See also:
3751 ///
3752 /// - [`Z3_get_datatype_sort_num_constructors`]
3753 /// - [`Z3_get_datatype_sort_constructor`]
3754 /// - [`Z3_get_datatype_sort_constructor_accessor`]
3755 pub fn Z3_get_datatype_sort_recognizer(
3756 c: Z3_context,
3757 t: Z3_sort,
3758 idx: ::core::ffi::c_uint,
3759 ) -> Option<Z3_func_decl>;
3760
3761 /// Return `idx_a`'th accessor for the `idx_c`'th constructor.
3762 ///
3763 /// # Preconditions:
3764 ///
3765 /// - `Z3_get_sort_kind(t) == SortKind::Datatype`
3766 /// - `idx_c < Z3_get_datatype_sort_num_constructors(c, t)`
3767 /// - `idx_a < Z3_get_domain_size(c, Z3_get_datatype_sort_constructor(c, idx_c))`
3768 ///
3769 /// # See also:
3770 ///
3771 /// - [`Z3_get_datatype_sort_num_constructors`]
3772 /// - [`Z3_get_datatype_sort_constructor`]
3773 /// - [`Z3_get_datatype_sort_recognizer`]
3774 pub fn Z3_get_datatype_sort_constructor_accessor(
3775 c: Z3_context,
3776 t: Z3_sort,
3777 idx_c: ::core::ffi::c_uint,
3778 idx_a: ::core::ffi::c_uint,
3779 ) -> Option<Z3_func_decl>;
3780
3781 /// Update record field with a value.
3782 ///
3783 /// This corresponds to the 'with' construct in OCaml.
3784 /// It has the effect of updating a record field with a given value.
3785 /// The remaining fields are left unchanged. It is the record
3786 /// equivalent of an array store (see [`Z3_mk_store`]).
3787 /// If the datatype has more than one constructor, then the update function
3788 /// behaves as identity if there is a miss-match between the accessor and
3789 /// constructor. For example ((_ update-field car) nil 1) is nil,
3790 /// while `((_ update-field car)` (cons 2 nil) 1) is (cons 1 nil).
3791 ///
3792 ///
3793 /// # Preconditions:
3794 ///
3795 /// - `Z3_get_sort_kind(Z3_get_sort(c, t)) == Z3_get_domain(c, field_access, 1) == SortKind::Datatype`
3796 /// - `Z3_get_sort(c, value) == Z3_get_range(c, field_access)`
3797 pub fn Z3_datatype_update_field(
3798 c: Z3_context,
3799 field_access: Z3_func_decl,
3800 t: Z3_ast,
3801 value: Z3_ast,
3802 ) -> Option<Z3_ast>;
3803
3804 /// Return arity of relation.
3805 ///
3806 /// # Preconditions:
3807 ///
3808 /// - `Z3_get_sort_kind(s) == SortKind::Relation`
3809 ///
3810 /// # See also:
3811 ///
3812 /// - [`Z3_get_relation_column`]
3813 pub fn Z3_get_relation_arity(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
3814
3815 /// Return sort at i'th column of relation sort.
3816 ///
3817 /// # Preconditions:
3818 ///
3819 /// - `Z3_get_sort_kind(c, s) == SortKind::Relation`
3820 /// - `col < Z3_get_relation_arity(c, s)`
3821 ///
3822 /// # See also:
3823 ///
3824 /// - [`Z3_get_relation_arity`]
3825 pub fn Z3_get_relation_column(
3826 c: Z3_context,
3827 s: Z3_sort,
3828 col: ::core::ffi::c_uint,
3829 ) -> Option<Z3_sort>;
3830
3831 /// Pseudo-Boolean relations.
3832 ///
3833 /// Encode `p1 + p2 + ... + pn <= k`
3834 pub fn Z3_mk_atmost(
3835 c: Z3_context,
3836 num_args: ::core::ffi::c_uint,
3837 args: *const Z3_ast,
3838 k: ::core::ffi::c_uint,
3839 ) -> Option<Z3_ast>;
3840
3841 /// Pseudo-Boolean relations.
3842 ///
3843 /// Encode `p1 + p2 + ... + pn >= k`
3844 pub fn Z3_mk_atleast(
3845 c: Z3_context,
3846 num_args: ::core::ffi::c_uint,
3847 args: *const Z3_ast,
3848 k: ::core::ffi::c_uint,
3849 ) -> Option<Z3_ast>;
3850
3851 /// Pseudo-Boolean relations.
3852 ///
3853 /// Encode `k1*p1 + k2*p2 + ... + kn*pn <= k`
3854 pub fn Z3_mk_pble(
3855 c: Z3_context,
3856 num_args: ::core::ffi::c_uint,
3857 args: *const Z3_ast,
3858 coeffs: *const ::core::ffi::c_int,
3859 k: ::core::ffi::c_int,
3860 ) -> Option<Z3_ast>;
3861
3862 /// Pseudo-Boolean relations.
3863 ///
3864 /// Encode `k1*p1 + k2*p2 + ... + kn*pn >= k`
3865 pub fn Z3_mk_pbge(
3866 c: Z3_context,
3867 num_args: ::core::ffi::c_uint,
3868 args: *const Z3_ast,
3869 coeffs: *const ::core::ffi::c_int,
3870 k: ::core::ffi::c_int,
3871 ) -> Option<Z3_ast>;
3872
3873 /// Pseudo-Boolean relations.
3874 ///
3875 /// Encode `k1*p1 + k2*p2 + ... + kn*pn = k`
3876 pub fn Z3_mk_pbeq(
3877 c: Z3_context,
3878 num_args: ::core::ffi::c_uint,
3879 args: *const Z3_ast,
3880 coeffs: *const ::core::ffi::c_int,
3881 k: ::core::ffi::c_int,
3882 ) -> Option<Z3_ast>;
3883
3884 /// Convert a [`Z3_func_decl`] into [`Z3_ast`]. This is just type casting.
3885 ///
3886 /// # See also:
3887 ///
3888 /// - [`Z3_app_to_ast`]
3889 /// - [`Z3_pattern_to_ast`]
3890 /// - [`Z3_sort_to_ast`]
3891 /// - [`Z3_to_func_decl`]
3892 pub fn Z3_func_decl_to_ast(c: Z3_context, f: Z3_func_decl) -> Option<Z3_ast>;
3893
3894 /// Compare terms.
3895 pub fn Z3_is_eq_func_decl(c: Z3_context, f1: Z3_func_decl, f2: Z3_func_decl) -> bool;
3896
3897 /// Return a unique identifier for `f`.
3898 pub fn Z3_get_func_decl_id(c: Z3_context, f: Z3_func_decl) -> ::core::ffi::c_uint;
3899
3900 /// Return the constant declaration name as a symbol.
3901 pub fn Z3_get_decl_name(c: Z3_context, d: Z3_func_decl) -> Option<Z3_symbol>;
3902
3903 /// Return declaration kind corresponding to declaration.
3904 pub fn Z3_get_decl_kind(c: Z3_context, d: Z3_func_decl) -> DeclKind;
3905
3906 /// Return the number of parameters of the given declaration.
3907 ///
3908 /// # See also:
3909 ///
3910 /// - [`Z3_get_arity`]
3911 pub fn Z3_get_domain_size(c: Z3_context, d: Z3_func_decl) -> ::core::ffi::c_uint;
3912
3913 /// Alias for `Z3_get_domain_size`.
3914 ///
3915 /// # See also:
3916 ///
3917 /// - [`Z3_get_domain_size`]
3918 pub fn Z3_get_arity(c: Z3_context, d: Z3_func_decl) -> ::core::ffi::c_uint;
3919
3920 /// Return the sort of the i-th parameter of the given function declaration.
3921 ///
3922 /// # Preconditions:
3923 ///
3924 /// - `i < Z3_get_domain_size(d)`
3925 ///
3926 /// # See also:
3927 ///
3928 /// - [`Z3_get_domain_size`]
3929 pub fn Z3_get_domain(c: Z3_context, d: Z3_func_decl, i: ::core::ffi::c_uint)
3930 -> Option<Z3_sort>;
3931
3932 /// Return the range of the given declaration.
3933 ///
3934 /// If `d` is a constant (i.e., has zero arguments), then this
3935 /// function returns the sort of the constant.
3936 pub fn Z3_get_range(c: Z3_context, d: Z3_func_decl) -> Option<Z3_sort>;
3937
3938 /// Return the number of parameters associated with a declaration.
3939 pub fn Z3_get_decl_num_parameters(c: Z3_context, d: Z3_func_decl) -> ::core::ffi::c_uint;
3940
3941 /// Return the parameter type associated with a declaration.
3942 ///
3943 /// - `c`: the context
3944 /// - `d`: the function declaration
3945 /// - `idx`: is the index of the named parameter it should be between 0 and
3946 /// the number of parameters.
3947 pub fn Z3_get_decl_parameter_kind(
3948 c: Z3_context,
3949 d: Z3_func_decl,
3950 idx: ::core::ffi::c_uint,
3951 ) -> ParameterKind;
3952
3953 /// Return the integer value associated with an integer parameter.
3954 ///
3955 /// # Preconditions:
3956 ///
3957 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::Int`
3958 pub fn Z3_get_decl_int_parameter(
3959 c: Z3_context,
3960 d: Z3_func_decl,
3961 idx: ::core::ffi::c_uint,
3962 ) -> ::core::ffi::c_int;
3963
3964 /// Return the double value associated with an double parameter.
3965 ///
3966 /// # Preconditions:
3967 ///
3968 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::Double`
3969 pub fn Z3_get_decl_double_parameter(
3970 c: Z3_context,
3971 d: Z3_func_decl,
3972 idx: ::core::ffi::c_uint,
3973 ) -> f64;
3974
3975 /// Return the double value associated with an double parameter.
3976 ///
3977 /// # Preconditions:
3978 ///
3979 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::Symbol`
3980 pub fn Z3_get_decl_symbol_parameter(
3981 c: Z3_context,
3982 d: Z3_func_decl,
3983 idx: ::core::ffi::c_uint,
3984 ) -> Option<Z3_symbol>;
3985
3986 /// Return the sort value associated with a sort parameter.
3987 ///
3988 /// # Preconditions:
3989 ///
3990 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::Sort`
3991 pub fn Z3_get_decl_sort_parameter(
3992 c: Z3_context,
3993 d: Z3_func_decl,
3994 idx: ::core::ffi::c_uint,
3995 ) -> Option<Z3_sort>;
3996
3997 /// Return the expression value associated with an expression parameter.
3998 ///
3999 /// # Preconditions:
4000 ///
4001 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::AST`
4002 pub fn Z3_get_decl_ast_parameter(
4003 c: Z3_context,
4004 d: Z3_func_decl,
4005 idx: ::core::ffi::c_uint,
4006 ) -> Option<Z3_ast>;
4007
4008 /// Return the expression value associated with an expression parameter.
4009 ///
4010 /// # Preconditions:
4011 ///
4012 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::FuncDecl`
4013 pub fn Z3_get_decl_func_decl_parameter(
4014 c: Z3_context,
4015 d: Z3_func_decl,
4016 idx: ::core::ffi::c_uint,
4017 ) -> Option<Z3_func_decl>;
4018
4019 /// Return the rational value, as a string, associated with a rational parameter.
4020 ///
4021 /// # Preconditions:
4022 ///
4023 /// - `Z3_get_decl_parameter_kind(c, d, idx) == ParameterKind::Rational`
4024 pub fn Z3_get_decl_rational_parameter(
4025 c: Z3_context,
4026 d: Z3_func_decl,
4027 idx: ::core::ffi::c_uint,
4028 ) -> Z3_string;
4029
4030 /// Convert a [`Z3_app`] into [`Z3_ast`]. This is just type casting.
4031 ///
4032 /// # See also:
4033 ///
4034 /// - [`Z3_to_app`]
4035 /// - [`Z3_func_decl_to_ast`]
4036 /// - [`Z3_pattern_to_ast`]
4037 /// - [`Z3_sort_to_ast`]
4038 pub fn Z3_app_to_ast(c: Z3_context, a: Z3_app) -> Option<Z3_ast>;
4039
4040 /// Return the declaration of a constant or function application.
4041 pub fn Z3_get_app_decl(c: Z3_context, a: Z3_app) -> Option<Z3_func_decl>;
4042
4043 /// Return the number of argument of an application. If `t`
4044 /// is an constant, then the number of arguments is 0.
4045 ///
4046 /// # See also:
4047 ///
4048 /// - [`Z3_get_app_arg`]
4049 pub fn Z3_get_app_num_args(c: Z3_context, a: Z3_app) -> ::core::ffi::c_uint;
4050
4051 /// Return the i-th argument of the given application.
4052 ///
4053 /// # Preconditions:
4054 ///
4055 /// - `i < Z3_get_app_num_args(c, a)`
4056 ///
4057 /// # See also:
4058 ///
4059 /// - [`Z3_get_app_num_args`]
4060 pub fn Z3_get_app_arg(c: Z3_context, a: Z3_app, i: ::core::ffi::c_uint) -> Option<Z3_ast>;
4061
4062 /// Compare terms.
4063 pub fn Z3_is_eq_ast(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> bool;
4064
4065 /// Return a unique identifier for `t`.
4066 ///
4067 /// The identifier is unique up to structural equality. Thus, two ast nodes
4068 /// created by the same context and having the same children and same function symbols
4069 /// have the same identifiers. Ast nodes created in the same context, but having
4070 /// different children or different functions have different identifiers.
4071 /// Variables and quantifiers are also assigned different identifiers according to
4072 /// their structure.
4073 pub fn Z3_get_ast_id(c: Z3_context, t: Z3_ast) -> ::core::ffi::c_uint;
4074
4075 /// Return a hash code for the given AST.
4076 ///
4077 /// The hash code is structural. You can use [`Z3_get_ast_id`]
4078 /// interchangeably with this function.
4079 pub fn Z3_get_ast_hash(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4080
4081 /// Return the sort of an AST node.
4082 ///
4083 /// The AST node must be a constant, application, numeral, bound variable, or quantifier.
4084 pub fn Z3_get_sort(c: Z3_context, a: Z3_ast) -> Option<Z3_sort>;
4085
4086 /// Return true if the given expression `t` is well sorted.
4087 pub fn Z3_is_well_sorted(c: Z3_context, t: Z3_ast) -> bool;
4088
4089 /// Return `Z3_L_TRUE` if `a` is true, `Z3_L_FALSE` if it is false,
4090 /// and `Z3_L_UNDEF` otherwise.
4091 pub fn Z3_get_bool_value(c: Z3_context, a: Z3_ast) -> Z3_lbool;
4092
4093 /// Return the kind of the given AST.
4094 pub fn Z3_get_ast_kind(c: Z3_context, a: Z3_ast) -> AstKind;
4095
4096 pub fn Z3_is_app(c: Z3_context, a: Z3_ast) -> bool;
4097
4098 pub fn Z3_is_numeral_ast(c: Z3_context, a: Z3_ast) -> bool;
4099
4100 /// Return true if the given AST is a real algebraic number.
4101 pub fn Z3_is_algebraic_number(c: Z3_context, a: Z3_ast) -> bool;
4102
4103 /// Convert an `ast` into an [`Z3_app`]. This is just type casting.
4104 ///
4105 /// # Preconditions:
4106 ///
4107 /// - `Z3_get_ast_kind(c, a) == AstKind::App`
4108 ///
4109 /// # See also:
4110 ///
4111 /// - [`Z3_app_to_ast`]
4112 /// - [`Z3_get_ast_kind`]
4113 /// - [`AstKind::App`]
4114 pub fn Z3_to_app(c: Z3_context, a: Z3_ast) -> Option<Z3_app>;
4115
4116 /// Convert an AST into a [`Z3_func_decl`]. This is just type casting.
4117 ///
4118 /// # Preconditions:
4119 ///
4120 /// - `Z3_get_ast_kind(c, a) == AstKind::FuncDecl`
4121 ///
4122 /// # See also:
4123 ///
4124 /// - [`Z3_func_decl_to_ast`]
4125 /// - [`Z3_get_ast_kind`]
4126 /// - [`AstKind::FuncDecl`]
4127 pub fn Z3_to_func_decl(c: Z3_context, a: Z3_ast) -> Option<Z3_func_decl>;
4128
4129 /// Return numeral value, as a string of a numeric constant term
4130 ///
4131 /// # Preconditions:
4132 ///
4133 /// - `Z3_get_ast_kind(c, a) == AstKind::Numeral`
4134 ///
4135 /// # See also:
4136 ///
4137 /// - [`Z3_get_ast_kind`]
4138 /// - [`AstKind::Numeral`]
4139 pub fn Z3_get_numeral_string(c: Z3_context, a: Z3_ast) -> Z3_string;
4140
4141 /// Return numeral as a string in decimal notation.
4142 /// The result has at most `precision` decimal places.
4143 ///
4144 /// # Preconditions:
4145 ///
4146 /// - `Z3_get_ast_kind(c, a) == AstKind::Numeral || Z3_is_algebraic_number(c, a)`
4147 ///
4148 /// # See also:
4149 ///
4150 /// - [`Z3_get_ast_kind`]
4151 /// - [`Z3_is_algebraic_number`]
4152 /// - [`AstKind::Numeral`]
4153 pub fn Z3_get_numeral_decimal_string(
4154 c: Z3_context,
4155 a: Z3_ast,
4156 precision: ::core::ffi::c_uint,
4157 ) -> Z3_string;
4158
4159 /// Return numeral as a double.
4160 /// # Preconditions:
4161 ///
4162 /// - `Z3_get_ast_kind(c, a) == AstKind::Numeral || Z3_is_algebraic_number(c, a)`
4163 ///
4164 /// # See also:
4165 ///
4166 /// - [`Z3_get_ast_kind`]
4167 /// - [`AstKind::Numeral`]
4168 pub fn Z3_get_numeral_double(c: Z3_context, a: Z3_ast) -> f64;
4169
4170 /// Return the numerator (as a numeral AST) of a numeral AST of sort Real.
4171 ///
4172 /// # Preconditions:
4173 ///
4174 /// - `Z3_get_ast_kind(c, a) == AstKind::Numeral`
4175 ///
4176 /// # See also:
4177 ///
4178 /// - [`Z3_get_ast_kind`]
4179 /// - [`AstKind::Numeral`]
4180 pub fn Z3_get_numerator(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
4181
4182 /// Return the denominator (as a numeral AST) of a numeral AST of sort Real.
4183 ///
4184 /// # Preconditions:
4185 ///
4186 /// - `Z3_get_ast_kind(c, a) == AstKind::Numeral`
4187 ///
4188 /// # See also:
4189 ///
4190 /// - [`Z3_get_ast_kind`]
4191 /// - [`AstKind::Numeral`]
4192 pub fn Z3_get_denominator(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
4193
4194 /// Return numeral value, as a pair of 64 bit numbers if the representation fits.
4195 ///
4196 /// - `c`: logical context.
4197 /// - `a`: term.
4198 /// - `num`: numerator.
4199 /// - `den`: denominator.
4200 ///
4201 /// Return `true` if the numeral value fits in 64 bit numerals, `false` otherwise.
4202 ///
4203 /// # Preconditions:
4204 ///
4205 /// - `Z3_get_ast_kind(a) == AstKind::Numeral`
4206 ///
4207 /// # See also:
4208 ///
4209 /// - [`Z3_get_ast_kind`]
4210 /// - [`AstKind::Numeral`]
4211 pub fn Z3_get_numeral_small(c: Z3_context, a: Z3_ast, num: *mut i64, den: *mut i64) -> bool;
4212
4213 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
4214 /// the value can fit in a machine int. Return `true` if the call succeeded.
4215 ///
4216 /// # Preconditions:
4217 ///
4218 /// - `Z3_get_ast_kind(c, v) == AstKind::Numeral`
4219 ///
4220 /// # See also:
4221 ///
4222 /// - [`Z3_get_numeral_string`]
4223 /// - [`Z3_get_ast_kind`]
4224 /// - [`AstKind::Numeral`]
4225 pub fn Z3_get_numeral_int(c: Z3_context, v: Z3_ast, i: *mut ::core::ffi::c_int) -> bool;
4226
4227 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
4228 /// the value can fit in a machine unsigned int.
4229 /// Return `true` if the call succeeded.
4230 ///
4231 /// # Preconditions:
4232 ///
4233 /// - `Z3_get_ast_kind(c, v) == AstKind::Numeral`
4234 ///
4235 /// # See also:
4236 ///
4237 /// - [`Z3_get_numeral_string`]
4238 /// - [`Z3_get_ast_kind`]
4239 /// - [`AstKind::Numeral`]
4240 pub fn Z3_get_numeral_uint(c: Z3_context, v: Z3_ast, u: *mut ::core::ffi::c_uint) -> bool;
4241
4242 /// Similar to [`Z3_get_numeral_string`] but only succeeds if the
4243 /// value can fit in a machine `uint64_t` int.
4244 /// Return `true` if the call succeeded.
4245 ///
4246 /// # Preconditions:
4247 ///
4248 /// - `Z3_get_ast_kind(c, v) == AstKind::Numeral`
4249 ///
4250 /// # See also:
4251 ///
4252 /// - [`Z3_get_numeral_string`]
4253 /// - [`Z3_get_ast_kind`]
4254 /// - [`AstKind::Numeral`]
4255 pub fn Z3_get_numeral_uint64(c: Z3_context, v: Z3_ast, u: *mut u64) -> bool;
4256
4257 /// Similar to [`Z3_get_numeral_string`], but only succeeds if the
4258 /// value can fit in a machine `int64_t` int.
4259 /// Return `true` if the call succeeded.
4260 ///
4261 /// # Preconditions:
4262 ///
4263 /// - `Z3_get_ast_kind(c, v) == AstKind::Numeral`
4264 ///
4265 /// # See also:
4266 ///
4267 /// - [`Z3_get_numeral_string`]
4268 /// - [`Z3_get_ast_kind`]
4269 /// - [`AstKind::Numeral`]
4270 pub fn Z3_get_numeral_int64(c: Z3_context, v: Z3_ast, i: *mut i64) -> bool;
4271
4272 /// Similar to [`Z3_get_numeral_string`], but only succeeds if the
4273 /// value can fit as a rational number as
4274 /// machine `int64_t` int. Return `true` if the call succeeded.
4275 ///
4276 /// # Preconditions:
4277 ///
4278 /// - `Z3_get_ast_kind(c, v) == AstKind::Numeral`
4279 ///
4280 /// # See also:
4281 ///
4282 /// - [`Z3_get_numeral_string`]
4283 /// - [`Z3_get_ast_kind`]
4284 /// - [`AstKind::Numeral`]
4285 pub fn Z3_get_numeral_rational_int64(
4286 c: Z3_context,
4287 v: Z3_ast,
4288 num: *mut i64,
4289 den: *mut i64,
4290 ) -> bool;
4291
4292 /// Return a lower bound for the given real algebraic number.
4293 ///
4294 /// The interval isolating the number is smaller than 1/10^precision.
4295 /// The result is a numeral AST of sort Real.
4296 ///
4297 /// # Preconditions:
4298 ///
4299 /// - `Z3_is_algebraic_number(c, a)`
4300 ///
4301 /// # See also:
4302 ///
4303 /// - [`Z3_is_algebraic_number`]
4304 pub fn Z3_get_algebraic_number_lower(
4305 c: Z3_context,
4306 a: Z3_ast,
4307 precision: ::core::ffi::c_uint,
4308 ) -> Option<Z3_ast>;
4309
4310 /// Return an upper bound for the given real algebraic number.
4311 ///
4312 /// The interval isolating the number is smaller than 1/10^precision.
4313 /// The result is a numeral AST of sort Real.
4314 ///
4315 /// # Preconditions:
4316 ///
4317 /// - `Z3_is_algebraic_number(c, a)`
4318 ///
4319 /// # See also:
4320 ///
4321 /// - [`Z3_is_algebraic_number`]
4322 pub fn Z3_get_algebraic_number_upper(
4323 c: Z3_context,
4324 a: Z3_ast,
4325 precision: ::core::ffi::c_uint,
4326 ) -> Option<Z3_ast>;
4327
4328 /// Convert a [`Z3_pattern`] into [`Z3_ast`]. This is just type casting.
4329 ///
4330 /// # See also:
4331 ///
4332 /// - [`Z3_app_to_ast`]
4333 /// - [`Z3_func_decl_to_ast`]
4334 /// - [`Z3_sort_to_ast`]
4335 pub fn Z3_pattern_to_ast(c: Z3_context, p: Z3_pattern) -> Option<Z3_ast>;
4336
4337 /// Return number of terms in pattern.
4338 pub fn Z3_get_pattern_num_terms(c: Z3_context, p: Z3_pattern) -> ::core::ffi::c_uint;
4339
4340 /// Return i'th ast in pattern.
4341 pub fn Z3_get_pattern(c: Z3_context, p: Z3_pattern, idx: ::core::ffi::c_uint)
4342 -> Option<Z3_ast>;
4343
4344 /// Return index of de-Bruijn bound variable.
4345 ///
4346 /// # Preconditions:
4347 ///
4348 /// - `Z3_get_ast_kind(a) == AstKind::Var`
4349 pub fn Z3_get_index_value(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4350
4351 /// Determine if quantifier is universal.
4352 ///
4353 /// # Preconditions:
4354 ///
4355 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4356 pub fn Z3_is_quantifier_forall(c: Z3_context, a: Z3_ast) -> bool;
4357
4358 /// Determine if ast is an existential quantifier.
4359 pub fn Z3_is_quantifier_exists(c: Z3_context, a: Z3_ast) -> bool;
4360
4361 /// Determine if ast is a lambda expression.
4362 ///
4363 /// # Preconditions:
4364 ///
4365 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4366 pub fn Z3_is_lambda(c: Z3_context, a: Z3_ast) -> bool;
4367
4368 /// Obtain weight of quantifier.
4369 ///
4370 /// # Preconditions:
4371 ///
4372 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4373 pub fn Z3_get_quantifier_weight(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4374
4375 /// Return number of patterns used in quantifier.
4376 ///
4377 /// # Preconditions:
4378 ///
4379 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4380 pub fn Z3_get_quantifier_num_patterns(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4381
4382 /// Return i'th pattern.
4383 ///
4384 /// # Preconditions:
4385 ///
4386 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4387 pub fn Z3_get_quantifier_pattern_ast(
4388 c: Z3_context,
4389 a: Z3_ast,
4390 i: ::core::ffi::c_uint,
4391 ) -> Option<Z3_pattern>;
4392
4393 /// Return number of `no_patterns` used in quantifier.
4394 ///
4395 /// # Preconditions:
4396 ///
4397 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4398 pub fn Z3_get_quantifier_num_no_patterns(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4399
4400 /// Return i'th `no_pattern`.
4401 ///
4402 /// # Preconditions:
4403 ///
4404 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4405 pub fn Z3_get_quantifier_no_pattern_ast(
4406 c: Z3_context,
4407 a: Z3_ast,
4408 i: ::core::ffi::c_uint,
4409 ) -> Option<Z3_ast>;
4410
4411 /// Return number of bound variables of quantifier.
4412 ///
4413 /// # Preconditions:
4414 ///
4415 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4416 pub fn Z3_get_quantifier_num_bound(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4417
4418 /// Return symbol of the i'th bound variable.
4419 ///
4420 /// # Preconditions:
4421 ///
4422 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4423 pub fn Z3_get_quantifier_bound_name(
4424 c: Z3_context,
4425 a: Z3_ast,
4426 i: ::core::ffi::c_uint,
4427 ) -> Option<Z3_symbol>;
4428
4429 /// Return sort of the i'th bound variable.
4430 ///
4431 /// # Preconditions:
4432 ///
4433 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4434 pub fn Z3_get_quantifier_bound_sort(
4435 c: Z3_context,
4436 a: Z3_ast,
4437 i: ::core::ffi::c_uint,
4438 ) -> Option<Z3_sort>;
4439
4440 /// Return body of quantifier.
4441 ///
4442 /// # Preconditions:
4443 ///
4444 /// - `Z3_get_ast_kind(a) == AstKind::Quantifier`
4445 pub fn Z3_get_quantifier_body(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
4446
4447 /// Interface to simplifier.
4448 ///
4449 /// Provides an interface to the AST simplifier used by Z3.
4450 /// It returns an AST object which is equal to the argument.
4451 /// The returned AST is simplified using algebraic simplification rules,
4452 /// such as constant propagation (propagating true/false over logical connectives).
4453 ///
4454 /// # See also:
4455 ///
4456 /// - [`Z3_simplify_ex`]
4457 pub fn Z3_simplify(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
4458
4459 /// Interface to simplifier.
4460 ///
4461 /// Provides an interface to the AST simplifier used by Z3.
4462 /// This procedure is similar to [`Z3_simplify`],
4463 /// but the behavior of the simplifier can be configured using the
4464 /// given parameter set.
4465 ///
4466 /// # See also:
4467 ///
4468 /// - [`Z3_simplify`]
4469 /// - [`Z3_simplify_get_help`]
4470 /// - [`Z3_simplify_get_param_descrs`]
4471 pub fn Z3_simplify_ex(c: Z3_context, a: Z3_ast, p: Z3_params) -> Option<Z3_ast>;
4472
4473 /// Return a string describing all available parameters.
4474 ///
4475 /// # See also:
4476 ///
4477 /// - [`Z3_simplify_ex`]
4478 /// - [`Z3_simplify_get_param_descrs`]
4479 pub fn Z3_simplify_get_help(c: Z3_context) -> Z3_string;
4480
4481 /// Return the parameter description set for the simplify procedure.
4482 ///
4483 /// # See also:
4484 ///
4485 /// - [`Z3_simplify_ex`]
4486 /// - [`Z3_simplify_get_help`]
4487 pub fn Z3_simplify_get_param_descrs(c: Z3_context) -> Option<Z3_param_descrs>;
4488
4489 /// Update the arguments of term `a` using the arguments `args`.
4490 ///
4491 /// The number of arguments `num_args` should coincide
4492 /// with the number of arguments to `a`.
4493 ///
4494 /// If `a` is a quantifier, then `num_args` has to be 1.
4495 pub fn Z3_update_term(
4496 c: Z3_context,
4497 a: Z3_ast,
4498 num_args: ::core::ffi::c_uint,
4499 args: *const Z3_ast,
4500 ) -> Option<Z3_ast>;
4501
4502 /// Substitute every occurrence of `from[i]` in `a` with `to[i]`, for `i`
4503 /// smaller than `num_exprs`.
4504 ///
4505 /// The result is the new AST. The arrays `from` and `to` must have
4506 /// size `num_exprs`.
4507 ///
4508 /// For every `i` smaller than `num_exprs`, we must have that sort of
4509 /// `from[i]` must be equal to sort of `to[i]`.
4510 pub fn Z3_substitute(
4511 c: Z3_context,
4512 a: Z3_ast,
4513 num_exprs: ::core::ffi::c_uint,
4514 from: *const Z3_ast,
4515 to: *const Z3_ast,
4516 ) -> Option<Z3_ast>;
4517
4518 /// Substitute the free variables in `a` with the expressions in `to`.
4519 ///
4520 /// For every `i` smaller than `num_exprs`, the variable with de-Bruijn
4521 /// index `i` is replaced with term `to[i]`.
4522 pub fn Z3_substitute_vars(
4523 c: Z3_context,
4524 a: Z3_ast,
4525 num_exprs: ::core::ffi::c_uint,
4526 to: *const Z3_ast,
4527 ) -> Option<Z3_ast>;
4528
4529 /// Translate/Copy the AST `a` from context `source` to context `target`.
4530 ///
4531 /// AST `a` must have been created using context `source`.
4532 ///
4533 /// # Preconditions:
4534 ///
4535 /// - `source != target`
4536 pub fn Z3_translate(source: Z3_context, a: Z3_ast, target: Z3_context) -> Option<Z3_ast>;
4537
4538 /// Create a fresh model object. It has reference count 0.
4539 pub fn Z3_mk_model(c: Z3_context) -> Option<Z3_model>;
4540
4541 /// Increment the reference counter of the given model.
4542 pub fn Z3_model_inc_ref(c: Z3_context, m: Z3_model);
4543
4544 /// Decrement the reference counter of the given model.
4545 pub fn Z3_model_dec_ref(c: Z3_context, m: Z3_model);
4546
4547 /// Evaluate the AST node `t` in the given model.
4548 /// Return `true` if succeeded, and store the result in `v`.
4549 ///
4550 /// If `model_completion` is `true`, then Z3 will assign an
4551 /// interpretation for any constant or function that does
4552 /// not have an interpretation in `m`. These constants and
4553 /// functions were essentially don't cares.
4554 ///
4555 /// If `model_completion` is `false`, then Z3 will not assign
4556 /// interpretations to constants for functions that do not have
4557 /// interpretations in `m`. Evaluation behaves as the identify
4558 /// function in this case.
4559 ///
4560 /// The evaluation may fail for the following reasons:
4561 ///
4562 /// - `t` contains a quantifier.
4563 /// - the model `m` is partial, that is, it doesn't have a complete
4564 /// interpretation for uninterpreted functions. That is, the option
4565 /// `MODEL_PARTIAL=true` was used.
4566 /// - `t` is type incorrect.
4567 /// - [`Z3_interrupt`] was invoked during evaluation.
4568 pub fn Z3_model_eval(
4569 c: Z3_context,
4570 m: Z3_model,
4571 t: Z3_ast,
4572 model_completion: bool,
4573 v: *mut Z3_ast,
4574 ) -> bool;
4575
4576 /// Return the interpretation (i.e., assignment) of constant `a` in the model `m`.
4577 ///
4578 /// Return `NULL`, if the model does not assign an interpretation for `a`.
4579 /// That should be interpreted as: the value of `a` does not matter.
4580 ///
4581 /// # Preconditions:
4582 ///
4583 /// - `Z3_get_arity(c, a) == 0`
4584 pub fn Z3_model_get_const_interp(c: Z3_context, m: Z3_model, a: Z3_func_decl)
4585 -> Option<Z3_ast>;
4586
4587 /// Test if there exists an interpretation (i.e., assignment) for `a` in the model `m`.
4588 pub fn Z3_model_has_interp(c: Z3_context, m: Z3_model, a: Z3_func_decl) -> bool;
4589
4590 /// Return the interpretation of the function `f` in the model `m`.
4591 ///
4592 /// Return `NULL`, if the model does not assign an interpretation for `f`.
4593 /// That should be interpreted as: the `f` does not matter.
4594 ///
4595 /// # Preconditions:
4596 ///
4597 /// - `Z3_get_arity(c, f) > 0`
4598 ///
4599 /// NOTE: Reference counting must be used to manage [`Z3_func_interp`]
4600 /// objects, even when the `Z3_context` was created using
4601 /// [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4602 pub fn Z3_model_get_func_interp(
4603 c: Z3_context,
4604 m: Z3_model,
4605 f: Z3_func_decl,
4606 ) -> Option<Z3_func_interp>;
4607
4608 /// Return the number of constants assigned by the given model.
4609 ///
4610 /// # See also:
4611 ///
4612 /// - [`Z3_model_get_const_decl`]
4613 pub fn Z3_model_get_num_consts(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
4614
4615 /// Return the i-th constant in the given model.
4616 ///
4617 /// # Preconditions:
4618 ///
4619 /// - `i < Z3_model_get_num_consts(c, m)`
4620 ///
4621 /// # See also:
4622 ///
4623 /// - [`Z3_model_eval`]
4624 /// - [`Z3_model_get_num_consts`]
4625 pub fn Z3_model_get_const_decl(
4626 c: Z3_context,
4627 m: Z3_model,
4628 i: ::core::ffi::c_uint,
4629 ) -> Option<Z3_func_decl>;
4630
4631 /// Return the number of function interpretations in the given model.
4632 ///
4633 /// A function interpretation is represented as a finite map and an 'else' value.
4634 /// Each entry in the finite map represents the value of a function given a set of arguments.
4635 ///
4636 /// # See also:
4637 ///
4638 /// - [`Z3_model_get_func_decl`]
4639 pub fn Z3_model_get_num_funcs(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
4640
4641 /// Return the declaration of the i-th function in the given model.
4642 ///
4643 /// # Preconditions:
4644 ///
4645 /// - `i < Z3_model_get_num_funcs(c, m)`
4646 ///
4647 /// # See also:
4648 ///
4649 /// - [`Z3_model_get_num_funcs`]
4650 pub fn Z3_model_get_func_decl(
4651 c: Z3_context,
4652 m: Z3_model,
4653 i: ::core::ffi::c_uint,
4654 ) -> Option<Z3_func_decl>;
4655
4656 /// Return the number of uninterpreted sorts that `m` assigns an
4657 /// interpretation to.
4658 ///
4659 /// Z3 also provides an interpretation for uninterpreted sorts used in
4660 /// a formula. The interpretation for a sort `s` is a finite set of
4661 /// distinct values. We say this finite set is the "universe" of `s`.
4662 ///
4663 /// # See also:
4664 ///
4665 /// - [`Z3_model_get_sort`]
4666 /// - [`Z3_model_get_sort_universe`]
4667 pub fn Z3_model_get_num_sorts(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
4668
4669 /// Return an uninterpreted sort that `m` assigns an interpretation.
4670 ///
4671 /// # Preconditions:
4672 ///
4673 /// - `i < Z3_model_get_num_sorts(c, m)`
4674 ///
4675 /// # See also:
4676 ///
4677 /// - [`Z3_model_get_num_sorts`]
4678 /// - [`Z3_model_get_sort_universe`]
4679 pub fn Z3_model_get_sort(c: Z3_context, m: Z3_model, i: ::core::ffi::c_uint)
4680 -> Option<Z3_sort>;
4681
4682 /// Return the finite set of distinct values that represent the interpretation for sort `s`.
4683 ///
4684 /// # See also:
4685 ///
4686 /// - [`Z3_model_get_num_sorts`]
4687 /// - [`Z3_model_get_sort`]
4688 pub fn Z3_model_get_sort_universe(
4689 c: Z3_context,
4690 m: Z3_model,
4691 s: Z3_sort,
4692 ) -> Option<Z3_ast_vector>;
4693
4694 /// Translate model from context `c` to context `dst`.
4695 pub fn Z3_model_translate(c: Z3_context, m: Z3_model, dst: Z3_context) -> Option<Z3_model>;
4696
4697 /// The `(_ as-array f)` AST node is a construct for assigning interpretations
4698 /// for arrays in Z3.
4699 ///
4700 /// It is the array such that forall indices `i` we have that
4701 /// `(select (_ as-array f) i)` is equal to `(f i)`. This procedure
4702 /// returns `true` if the `a` is an `as`-array AST node.
4703 ///
4704 /// Z3 current solvers have minimal support for `as_array` nodes.
4705 ///
4706 /// # See also:
4707 ///
4708 /// - [`Z3_get_as_array_func_decl`]
4709 pub fn Z3_is_as_array(c: Z3_context, a: Z3_ast) -> bool;
4710
4711 /// Return the function declaration `f` associated with a `(_ as_array f)` node.
4712 ///
4713 /// # See also:
4714 ///
4715 /// - [`Z3_is_as_array`]
4716 pub fn Z3_get_as_array_func_decl(c: Z3_context, a: Z3_ast) -> Option<Z3_func_decl>;
4717
4718 /// Create a fresh `func_interp` object, add it to a model for a specified function.
4719 /// It has reference count 0.
4720 ///
4721 /// - `c`: context
4722 /// - `m`: model
4723 /// - `f`: function declaration
4724 /// - `default_value`: default value for function interpretation
4725 pub fn Z3_add_func_interp(
4726 c: Z3_context,
4727 m: Z3_model,
4728 f: Z3_func_decl,
4729 default_value: Z3_ast,
4730 ) -> Option<Z3_func_interp>;
4731
4732 /// Add a constant interpretation.
4733 pub fn Z3_add_const_interp(c: Z3_context, m: Z3_model, f: Z3_func_decl, a: Z3_ast);
4734
4735 /// Increment the reference counter of the given `Z3_func_interp` object.
4736 pub fn Z3_func_interp_inc_ref(c: Z3_context, f: Z3_func_interp);
4737
4738 /// Decrement the reference counter of the given `Z3_func_interp` object.
4739 pub fn Z3_func_interp_dec_ref(c: Z3_context, f: Z3_func_interp);
4740
4741 /// Return the number of entries in the given function interpretation.
4742 ///
4743 /// A function interpretation is represented as a finite map and
4744 /// an 'else' value. Each entry in the finite map represents the
4745 /// value of a function given a set of arguments. This procedure
4746 /// return the number of element in the finite map of `f`.
4747 ///
4748 /// # See also:
4749 ///
4750 /// - [`Z3_func_interp_get_entry`]
4751 pub fn Z3_func_interp_get_num_entries(c: Z3_context, f: Z3_func_interp) -> ::core::ffi::c_uint;
4752
4753 /// Return a "point" of the given function interpretation. It represents
4754 /// the value of `f` in a particular point.
4755 ///
4756 /// # Preconditions:
4757 ///
4758 /// - `i < Z3_func_interp_get_num_entries(c, f)`
4759 ///
4760 /// # See also:
4761 ///
4762 /// - [`Z3_func_interp_get_num_entries`]
4763 pub fn Z3_func_interp_get_entry(
4764 c: Z3_context,
4765 f: Z3_func_interp,
4766 i: ::core::ffi::c_uint,
4767 ) -> Option<Z3_func_entry>;
4768
4769 /// Return the 'else' value of the given function interpretation.
4770 ///
4771 /// A function interpretation is represented as a finite map and an 'else' value.
4772 /// This procedure returns the 'else' value.
4773 pub fn Z3_func_interp_get_else(c: Z3_context, f: Z3_func_interp) -> Option<Z3_ast>;
4774
4775 /// Set the 'else' value of the given function interpretation.
4776 ///
4777 /// A function interpretation is represented as a finite map and an 'else' value.
4778 /// This procedure can be used to update the 'else' value.
4779 pub fn Z3_func_interp_set_else(c: Z3_context, f: Z3_func_interp, else_value: Z3_ast);
4780
4781 /// Return the arity (number of arguments) of the given function interpretation.
4782 pub fn Z3_func_interp_get_arity(c: Z3_context, f: Z3_func_interp) -> ::core::ffi::c_uint;
4783
4784 /// add a function entry to a function interpretation.
4785 ///
4786 /// - `c`: logical context
4787 /// - `fi`: a function interpretation to be updated.
4788 /// - `args`: list of arguments. They should be constant values
4789 /// (such as integers) and be of the same types as the domain
4790 /// of the function.
4791 /// - `value`: value of the function when the parameters match args.
4792 ///
4793 /// It is assumed that entries added to a function cover disjoint
4794 /// arguments. If an two entries are added with the same arguments,
4795 /// only the second insertion survives and the first inserted entry
4796 /// is removed.
4797 pub fn Z3_func_interp_add_entry(
4798 c: Z3_context,
4799 fi: Z3_func_interp,
4800 args: Z3_ast_vector,
4801 value: Z3_ast,
4802 );
4803
4804 /// Increment the reference counter of the given `Z3_func_entry` object.
4805 pub fn Z3_func_entry_inc_ref(c: Z3_context, e: Z3_func_entry);
4806
4807 /// Decrement the reference counter of the given `Z3_func_entry` object.
4808 pub fn Z3_func_entry_dec_ref(c: Z3_context, e: Z3_func_entry);
4809
4810 /// Return the value of this point.
4811 ///
4812 /// A `Z3_func_entry` object represents an element in the finite map used
4813 /// to encode a function interpretation.
4814 ///
4815 /// # See also:
4816 ///
4817 /// - [`Z3_func_interp_get_entry`]
4818 pub fn Z3_func_entry_get_value(c: Z3_context, e: Z3_func_entry) -> Option<Z3_ast>;
4819
4820 /// Return the number of arguments in a `Z3_func_entry` object.
4821 ///
4822 /// # See also:
4823 ///
4824 /// - [`Z3_func_entry_get_arg`]
4825 /// - [`Z3_func_interp_get_entry`]
4826 pub fn Z3_func_entry_get_num_args(c: Z3_context, e: Z3_func_entry) -> ::core::ffi::c_uint;
4827
4828 /// Return an argument of a `Z3_func_entry` object.
4829 ///
4830 /// # Preconditions:
4831 ///
4832 /// - `i < Z3_func_entry_get_num_args(c, e)`
4833 ///
4834 /// # See also:
4835 ///
4836 /// - [`Z3_func_entry_get_num_args`]
4837 /// - [`Z3_func_interp_get_entry`]
4838 pub fn Z3_func_entry_get_arg(
4839 c: Z3_context,
4840 e: Z3_func_entry,
4841 i: ::core::ffi::c_uint,
4842 ) -> Option<Z3_ast>;
4843
4844 /// Log interaction to a file.
4845 ///
4846 /// # See also:
4847 ///
4848 /// - [`Z3_append_log`]
4849 /// - [`Z3_close_log`]
4850 pub fn Z3_open_log(filename: Z3_string) -> bool;
4851
4852 /// Append user-defined string to interaction log.
4853 ///
4854 /// The interaction log is opened using [`Z3_open_log`].
4855 /// It contains the formulas that are checked using Z3.
4856 /// You can use this command to append comments, for instance.
4857 ///
4858 /// # See also:
4859 ///
4860 /// - [`Z3_open_log`]
4861 /// - [`Z3_close_log`]
4862 pub fn Z3_append_log(string: Z3_string);
4863
4864 /// Close interaction log.
4865 ///
4866 /// # See also:
4867 ///
4868 /// - [`Z3_append_log`]
4869 /// - [`Z3_open_log`]
4870 pub fn Z3_close_log();
4871
4872 /// Enable/disable printing warning messages to the console.
4873 ///
4874 /// Warnings are printed after passing `true`, warning messages are
4875 /// suppressed after calling this method with `false`.
4876 pub fn Z3_toggle_warning_messages(enabled: bool);
4877
4878 /// Select mode for the format used for pretty-printing AST nodes.
4879 ///
4880 /// The default mode for pretty printing AST nodes is to produce
4881 /// SMT-LIB style output where common subexpressions are printed
4882 /// at each occurrence. The mode is called `AstPrintMode::SmtLibFull`.
4883 ///
4884 /// To print shared common subexpressions only once,
4885 /// use the `AstPrintMode::LowLevel` mode.
4886 ///
4887 /// To print in way that conforms to SMT-LIB standards and uses let
4888 /// expressions to share common sub-expressions use
4889 /// `AstPrintMode::SmtLib2Compliant`.
4890 ///
4891 /// # See also:
4892 ///
4893 /// - [`Z3_ast_to_string`]
4894 /// - [`Z3_pattern_to_string`]
4895 /// - [`Z3_func_decl_to_string`]
4896 pub fn Z3_set_ast_print_mode(c: Z3_context, mode: AstPrintMode);
4897
4898 /// Convert the given AST node into a string.
4899 ///
4900 /// Warning: The result buffer is statically allocated by Z3.
4901 /// It will be automatically deallocated when
4902 /// [`Z3_del_context`] is invoked.
4903 /// So, the buffer is invalidated in the next call to
4904 /// `Z3_ast_to_string`.
4905 ///
4906 /// # See also:
4907 ///
4908 /// - [`Z3_func_decl_to_string`]
4909 /// - [`Z3_pattern_to_string`]
4910 /// - [`Z3_sort_to_string`]
4911 pub fn Z3_ast_to_string(c: Z3_context, a: Z3_ast) -> Z3_string;
4912
4913 /// Convert the given pattern AST node into a string.
4914 ///
4915 /// This is a wrapper around [`Z3_ast_to_string`].
4916 ///
4917 /// Warning: The result buffer is statically allocated by Z3.
4918 /// It will be automatically deallocated when
4919 /// [`Z3_del_context`] is invoked.
4920 /// So, the buffer is invalidated in the next call to
4921 /// [`Z3_ast_to_string`].
4922 ///
4923 /// # See also:
4924 ///
4925 /// - [`Z3_ast_to_string`]
4926 /// - [`Z3_func_decl_to_string`]
4927 /// - [`Z3_sort_to_string`]
4928 pub fn Z3_pattern_to_string(c: Z3_context, p: Z3_pattern) -> Z3_string;
4929
4930 /// Convert the given sort AST node into a string.
4931 ///
4932 /// This is a wrapper around [`Z3_ast_to_string`].
4933 ///
4934 /// Warning: The result buffer is statically allocated by Z3.
4935 /// It will be automatically deallocated when
4936 /// [`Z3_del_context`] is invoked.
4937 /// So, the buffer is invalidated in the next call to
4938 /// [`Z3_ast_to_string`].
4939 ///
4940 /// # See also:
4941 ///
4942 /// - [`Z3_ast_to_string`]
4943 /// - [`Z3_func_decl_to_string`]
4944 /// - [`Z3_pattern_to_string`]
4945 pub fn Z3_sort_to_string(c: Z3_context, s: Z3_sort) -> Z3_string;
4946
4947 /// Convert the given func decl AST node into a string.
4948 ///
4949 /// This is a wrapper around [`Z3_ast_to_string`].
4950 ///
4951 /// Warning: The result buffer is statically allocated by Z3.
4952 /// It will be automatically deallocated when
4953 /// [`Z3_del_context`] is invoked.
4954 /// So, the buffer is invalidated in the next call to
4955 /// [`Z3_ast_to_string`].
4956 ///
4957 /// # See also:
4958 ///
4959 /// - [`Z3_ast_to_string`]
4960 /// - [`Z3_pattern_to_string`]
4961 /// - [`Z3_sort_to_string`]
4962 pub fn Z3_func_decl_to_string(c: Z3_context, d: Z3_func_decl) -> Z3_string;
4963
4964 /// Convert the given model into a string.
4965 ///
4966 /// Warning: The result buffer is statically allocated by Z3.
4967 /// It will be automatically deallocated when
4968 /// [`Z3_del_context`] is invoked.
4969 /// So, the buffer is invalidated in the next call to `Z3_model_to_string`.
4970 pub fn Z3_model_to_string(c: Z3_context, m: Z3_model) -> Z3_string;
4971
4972 /// Convert the given benchmark into SMT-LIB formatted string.
4973 ///
4974 /// Warning: The result buffer is statically allocated by Z3.
4975 /// It will be automatically deallocated when
4976 /// [`Z3_del_context`] is invoked.
4977 /// So, the buffer is invalidated in the next call to
4978 /// `Z3_benchmark_to_smtlib_string`.
4979 ///
4980 /// - `c`: - context.
4981 /// - `name`: - name of benchmark. The argument is optional.
4982 /// - `logic`: - the benchmark logic.
4983 /// - `status`: - the status string (sat, unsat, or unknown)
4984 /// - `attributes`: - other attributes, such as source, difficulty or category.
4985 /// - `num_assumptions`: - number of assumptions.
4986 /// - `assumptions`: - auxiliary assumptions.
4987 /// - `formula`: - formula to be checked for consistency in conjunction with assumptions.
4988 pub fn Z3_benchmark_to_smtlib_string(
4989 c: Z3_context,
4990 name: Z3_string,
4991 logic: Z3_string,
4992 status: Z3_string,
4993 attributes: Z3_string,
4994 num_assumptions: ::core::ffi::c_uint,
4995 assumptions: *const Z3_ast,
4996 formula: Z3_ast,
4997 ) -> Z3_string;
4998
4999 /// Parse the given string using the SMT-LIB2 parser.
5000 ///
5001 /// It returns a formula comprising of the conjunction of assertions
5002 /// in the scope (up to push/pop) at the end of the string.
5003 pub fn Z3_parse_smtlib2_string(
5004 c: Z3_context,
5005 str: Z3_string,
5006 num_sorts: ::core::ffi::c_uint,
5007 sort_names: *const Z3_symbol,
5008 sorts: *const Z3_sort,
5009 num_decls: ::core::ffi::c_uint,
5010 decl_names: *const Z3_symbol,
5011 decls: *const Z3_func_decl,
5012 ) -> Option<Z3_ast_vector>;
5013
5014 /// Similar to [`Z3_parse_smtlib2_string`], but reads the benchmark from a file.
5015 pub fn Z3_parse_smtlib2_file(
5016 c: Z3_context,
5017 file_name: Z3_string,
5018 num_sorts: ::core::ffi::c_uint,
5019 sort_names: *const Z3_symbol,
5020 sorts: *const Z3_sort,
5021 num_decls: ::core::ffi::c_uint,
5022 decl_names: *const Z3_symbol,
5023 decls: *const Z3_func_decl,
5024 ) -> Option<Z3_ast_vector>;
5025
5026 /// Parse and evaluate and SMT-LIB2 command sequence. The state from a previous
5027 /// call is saved so the next evaluation builds on top of the previous call.
5028 ///
5029 /// Returns output generated from processing commands.
5030 pub fn Z3_eval_smtlib2_string(arg1: Z3_context, str: Z3_string) -> Z3_string;
5031
5032 /// Return the error code for the last API call.
5033 ///
5034 /// A call to a Z3 function may return a non `ErrorCode::OK` error code,
5035 /// when it is not used correctly.
5036 ///
5037 /// # See also:
5038 ///
5039 /// - [`Z3_set_error_handler`]
5040 pub fn Z3_get_error_code(c: Z3_context) -> ErrorCode;
5041
5042 /// Register a Z3 error handler.
5043 ///
5044 /// A call to a Z3 function may return a non `ErrorCode::OK` error code, when
5045 /// it is not used correctly. An error handler can be registered
5046 /// and will be called in this case. To disable the use of the
5047 /// error handler, simply register with `h`=NULL.
5048 ///
5049 /// Warning: Log files, created using [`Z3_open_log`],
5050 /// may be potentially incomplete/incorrect if error handlers are used.
5051 ///
5052 /// # See also:
5053 ///
5054 /// - [`Z3_get_error_code`]
5055 pub fn Z3_set_error_handler(c: Z3_context, h: Z3_error_handler);
5056
5057 /// Set an error.
5058 pub fn Z3_set_error(c: Z3_context, e: ErrorCode);
5059
5060 /// Return a string describing the given error code.
5061 pub fn Z3_get_error_msg(c: Z3_context, err: ErrorCode) -> Z3_string;
5062
5063 /// Return Z3 version number information.
5064 ///
5065 /// # See also:
5066 ///
5067 /// - [`Z3_get_full_version`]
5068 pub fn Z3_get_version(
5069 major: *mut ::core::ffi::c_uint,
5070 minor: *mut ::core::ffi::c_uint,
5071 build_number: *mut ::core::ffi::c_uint,
5072 revision_number: *mut ::core::ffi::c_uint,
5073 );
5074
5075 /// Return a string that fully describes the version of Z3 in use.
5076 ///
5077 /// # See also:
5078 ///
5079 /// - [`Z3_get_version`]
5080 pub fn Z3_get_full_version() -> Z3_string;
5081
5082 /// Enable tracing messages tagged as `tag` when Z3 is compiled in debug mode.
5083 /// It is a NOOP otherwise
5084 ///
5085 /// # See also:
5086 ///
5087 /// - [`Z3_disable_trace`]
5088 pub fn Z3_enable_trace(tag: Z3_string);
5089
5090 /// Disable tracing messages tagged as `tag` when Z3 is compiled in debug mode.
5091 /// It is a NOOP otherwise
5092 ///
5093 /// # See also:
5094 ///
5095 /// - [`Z3_enable_trace`]
5096 pub fn Z3_disable_trace(tag: Z3_string);
5097
5098 /// Reset all allocated resources.
5099 ///
5100 /// Use this facility on out-of memory errors.
5101 /// It allows discharging the previous state and resuming afresh.
5102 /// Any pointers previously returned by the API
5103 /// become invalid.
5104 pub fn Z3_reset_memory();
5105
5106 /// Destroy all allocated resources.
5107 ///
5108 /// Any pointers previously returned by the API become invalid.
5109 /// Can be used for memory leak detection.
5110 pub fn Z3_finalize_memory();
5111
5112 /// Create a goal (aka problem). A goal is essentially a set
5113 /// of formulas, that can be solved and/or transformed using
5114 /// tactics and solvers.
5115 ///
5116 /// If `models == true`, then model generation is enabled for the
5117 /// new goal.
5118 ///
5119 /// If `unsat_cores == true`, then unsat core generation is enabled
5120 /// for the new goal.
5121 ///
5122 /// If `proofs == true`, then proof generation is enabled for the
5123 /// new goal.
5124 ///
5125 /// NOTE: The Z3 context `c` must have been created with proof
5126 /// generation support.
5127 ///
5128 /// NOTE: Reference counting must be used to manage goals, even
5129 /// when the [`Z3_context`] was created using
5130 /// [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5131 pub fn Z3_mk_goal(
5132 c: Z3_context,
5133 models: bool,
5134 unsat_cores: bool,
5135 proofs: bool,
5136 ) -> Option<Z3_goal>;
5137
5138 /// Increment the reference counter of the given goal.
5139 pub fn Z3_goal_inc_ref(c: Z3_context, g: Z3_goal);
5140
5141 /// Decrement the reference counter of the given goal.
5142 pub fn Z3_goal_dec_ref(c: Z3_context, g: Z3_goal);
5143
5144 /// Return the "precision" of the given goal. Goals can be transformed using over and under approximations.
5145 /// A under approximation is applied when the objective is to find a model for a given goal.
5146 /// An over approximation is applied when the objective is to find a proof for a given goal.
5147 pub fn Z3_goal_precision(c: Z3_context, g: Z3_goal) -> GoalPrec;
5148
5149 /// Add a new formula `a` to the given goal.
5150 ///
5151 /// The formula is split according to the following procedure that
5152 /// is applied until a fixed-point:
5153 ///
5154 /// - Conjunctions are split into separate formulas.
5155 /// - Negations are distributed over disjunctions, resulting in
5156 /// separate formulas.
5157 ///
5158 /// If the goal is `false`, adding new formulas is a no-op.
5159 ///
5160 /// If the formula `a` is `true`, then nothing is added.
5161 ///
5162 /// If the formula `a` is `false`, then the entire goal is
5163 /// replaced by the formula `false`.
5164 pub fn Z3_goal_assert(c: Z3_context, g: Z3_goal, a: Z3_ast);
5165
5166 /// Return true if the given goal contains the formula `false`.
5167 pub fn Z3_goal_inconsistent(c: Z3_context, g: Z3_goal) -> bool;
5168
5169 /// Return the depth of the given goal. It tracks how many transformations were applied to it.
5170 pub fn Z3_goal_depth(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
5171
5172 /// Erase all formulas from the given goal.
5173 pub fn Z3_goal_reset(c: Z3_context, g: Z3_goal);
5174
5175 /// Return the number of formulas in the given goal.
5176 pub fn Z3_goal_size(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
5177
5178 /// Return a formula from the given goal.
5179 ///
5180 /// # Preconditions:
5181 ///
5182 /// - `idx < Z3_goal_size(c, g)`
5183 pub fn Z3_goal_formula(c: Z3_context, g: Z3_goal, idx: ::core::ffi::c_uint) -> Option<Z3_ast>;
5184
5185 /// Return the number of formulas, subformulas and terms in the given goal.
5186 pub fn Z3_goal_num_exprs(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
5187
5188 /// Return true if the goal is empty, and it is precise or the product of a under approximation.
5189 pub fn Z3_goal_is_decided_sat(c: Z3_context, g: Z3_goal) -> bool;
5190
5191 /// Return true if the goal contains false, and it is precise or the product of an over approximation.
5192 pub fn Z3_goal_is_decided_unsat(c: Z3_context, g: Z3_goal) -> bool;
5193
5194 /// Copy a goal `g` from the context `source` to the context `target`.
5195 pub fn Z3_goal_translate(source: Z3_context, g: Z3_goal, target: Z3_context)
5196 -> Option<Z3_goal>;
5197
5198 /// Convert a model of the formulas of a goal to a model of an original goal.
5199 /// The model may be null, in which case the returned model is valid if the goal was
5200 /// established satisfiable.
5201 pub fn Z3_goal_convert_model(c: Z3_context, g: Z3_goal, m: Z3_model) -> Option<Z3_model>;
5202
5203 /// Convert a goal into a string.
5204 pub fn Z3_goal_to_string(c: Z3_context, g: Z3_goal) -> Z3_string;
5205
5206 /// Convert a goal into a DIMACS formatted string.
5207 /// The goal must be in CNF. You can convert a goal to CNF
5208 /// by applying the tseitin-cnf tactic. Bit-vectors are not automatically
5209 /// converted to Booleans either, so the if caller intends to
5210 /// preserve satisfiability, it should apply bit-blasting tactics.
5211 /// Quantifiers and theory atoms will not be encoded.
5212 pub fn Z3_goal_to_dimacs_string(c: Z3_context, g: Z3_goal) -> Z3_string;
5213
5214 /// Return a tactic associated with the given name.
5215 ///
5216 /// The complete list of tactics may be obtained using the procedures [`Z3_get_num_tactics`] and [`Z3_get_tactic_name`].
5217 /// It may also be obtained using the command `(help-tactic)` in the SMT 2.0 front-end.
5218 ///
5219 /// Tactics are the basic building block for creating custom solvers for specific problem domains.
5220 pub fn Z3_mk_tactic(c: Z3_context, name: Z3_string) -> Option<Z3_tactic>;
5221
5222 /// Increment the reference counter of the given tactic.
5223 pub fn Z3_tactic_inc_ref(c: Z3_context, t: Z3_tactic);
5224
5225 /// Decrement the reference counter of the given tactic.
5226 pub fn Z3_tactic_dec_ref(c: Z3_context, g: Z3_tactic);
5227
5228 /// Return a probe associated with the given name.
5229 /// The complete list of probes may be obtained using the procedures [`Z3_get_num_probes`] and [`Z3_get_probe_name`].
5230 /// It may also be obtained using the command `(help-tactic)` in the SMT 2.0 front-end.
5231 ///
5232 /// Probes are used to inspect a goal (aka problem) and collect information that may be used to decide
5233 /// which solver and/or preprocessing step will be used.
5234 pub fn Z3_mk_probe(c: Z3_context, name: Z3_string) -> Option<Z3_probe>;
5235
5236 /// Increment the reference counter of the given probe.
5237 pub fn Z3_probe_inc_ref(c: Z3_context, p: Z3_probe);
5238
5239 /// Decrement the reference counter of the given probe.
5240 pub fn Z3_probe_dec_ref(c: Z3_context, p: Z3_probe);
5241
5242 /// Return a tactic that applies `t1` to a given goal and `t2`
5243 /// to every subgoal produced by `t1`.
5244 pub fn Z3_tactic_and_then(c: Z3_context, t1: Z3_tactic, t2: Z3_tactic) -> Option<Z3_tactic>;
5245
5246 /// Return a tactic that first applies `t1` to a given goal,
5247 /// if it fails then returns the result of `t2` applied to the given goal.
5248 pub fn Z3_tactic_or_else(c: Z3_context, t1: Z3_tactic, t2: Z3_tactic) -> Option<Z3_tactic>;
5249
5250 /// Return a tactic that applies the given tactics in parallel.
5251 pub fn Z3_tactic_par_or(
5252 c: Z3_context,
5253 num: ::core::ffi::c_uint,
5254 ts: *const Z3_tactic,
5255 ) -> Option<Z3_tactic>;
5256
5257 /// Return a tactic that applies `t1` to a given goal and then `t2`
5258 /// to every subgoal produced by `t1`. The subgoals are processed in parallel.
5259 pub fn Z3_tactic_par_and_then(c: Z3_context, t1: Z3_tactic, t2: Z3_tactic)
5260 -> Option<Z3_tactic>;
5261
5262 /// Return a tactic that applies `t` to a given goal for `ms` milliseconds.
5263 /// If `t` does not terminate in `ms` milliseconds, then it fails.
5264 pub fn Z3_tactic_try_for(
5265 c: Z3_context,
5266 t: Z3_tactic,
5267 ms: ::core::ffi::c_uint,
5268 ) -> Option<Z3_tactic>;
5269
5270 /// Return a tactic that applies `t` to a given goal is the probe `p` evaluates to true.
5271 /// If `p` evaluates to false, then the new tactic behaves like the skip tactic.
5272 pub fn Z3_tactic_when(c: Z3_context, p: Z3_probe, t: Z3_tactic) -> Option<Z3_tactic>;
5273
5274 /// Return a tactic that applies `t1` to a given goal if the probe `p` evaluates to true,
5275 /// and `t2` if `p` evaluates to false.
5276 pub fn Z3_tactic_cond(
5277 c: Z3_context,
5278 p: Z3_probe,
5279 t1: Z3_tactic,
5280 t2: Z3_tactic,
5281 ) -> Option<Z3_tactic>;
5282
5283 /// Return a tactic that keeps applying `t` until the goal is not modified anymore or the maximum
5284 /// number of iterations `max` is reached.
5285 pub fn Z3_tactic_repeat(
5286 c: Z3_context,
5287 t: Z3_tactic,
5288 max: ::core::ffi::c_uint,
5289 ) -> Option<Z3_tactic>;
5290
5291 /// Return a tactic that just return the given goal.
5292 pub fn Z3_tactic_skip(c: Z3_context) -> Option<Z3_tactic>;
5293
5294 /// Return a tactic that always fails.
5295 pub fn Z3_tactic_fail(c: Z3_context) -> Option<Z3_tactic>;
5296
5297 /// Return a tactic that fails if the probe `p` evaluates to false.
5298 pub fn Z3_tactic_fail_if(c: Z3_context, p: Z3_probe) -> Option<Z3_tactic>;
5299
5300 /// Return a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or
5301 /// trivially unsatisfiable (i.e., contains false).
5302 pub fn Z3_tactic_fail_if_not_decided(c: Z3_context) -> Option<Z3_tactic>;
5303
5304 /// Return a tactic that applies `t` using the given set of parameters.
5305 pub fn Z3_tactic_using_params(c: Z3_context, t: Z3_tactic, p: Z3_params) -> Option<Z3_tactic>;
5306
5307 /// Return a probe that always evaluates to val.
5308 pub fn Z3_probe_const(x: Z3_context, val: f64) -> Option<Z3_probe>;
5309
5310 /// Return a probe that evaluates to "true" when the value returned by `p1` is less than the value returned by `p2`.
5311 ///
5312 /// NOTE: For probes, "true" is any value different from 0.0.
5313 pub fn Z3_probe_lt(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5314
5315 /// Return a probe that evaluates to "true" when the value returned by `p1` is greater than the value returned by `p2`.
5316 ///
5317 /// NOTE: For probes, "true" is any value different from 0.0.
5318 pub fn Z3_probe_gt(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5319
5320 /// Return a probe that evaluates to "true" when the value returned by `p1` is less than or equal to the value returned by `p2`.
5321 ///
5322 /// NOTE: For probes, "true" is any value different from 0.0.
5323 pub fn Z3_probe_le(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5324
5325 /// Return a probe that evaluates to "true" when the value returned by `p1` is greater than or equal to the value returned by `p2`.
5326 ///
5327 /// NOTE: For probes, "true" is any value different from 0.0.
5328 pub fn Z3_probe_ge(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5329
5330 /// Return a probe that evaluates to "true" when the value returned by `p1` is equal to the value returned by `p2`.
5331 ///
5332 /// NOTE: For probes, "true" is any value different from 0.0.
5333 pub fn Z3_probe_eq(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5334
5335 /// Return a probe that evaluates to "true" when `p1` and `p2` evaluates to true.
5336 ///
5337 /// NOTE: For probes, "true" is any value different from 0.0.
5338 pub fn Z3_probe_and(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5339
5340 /// Return a probe that evaluates to "true" when `p1` or `p2` evaluates to true.
5341 ///
5342 /// NOTE: For probes, "true" is any value different from 0.0.
5343 pub fn Z3_probe_or(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
5344
5345 /// Return a probe that evaluates to "true" when `p` does not evaluate to true.
5346 ///
5347 /// NOTE: For probes, "true" is any value different from 0.0.
5348 pub fn Z3_probe_not(x: Z3_context, p: Z3_probe) -> Option<Z3_probe>;
5349
5350 /// Return the number of builtin tactics available in Z3.
5351 ///
5352 /// # See also:
5353 ///
5354 /// - [`Z3_get_tactic_name`]
5355 pub fn Z3_get_num_tactics(c: Z3_context) -> ::core::ffi::c_uint;
5356
5357 /// Return the name of the idx tactic.
5358 ///
5359 /// # Preconditions:
5360 ///
5361 /// - `i < Z3_get_num_tactics(c)`
5362 ///
5363 /// # See also:
5364 ///
5365 /// - [`Z3_get_num_tactics`]
5366 pub fn Z3_get_tactic_name(c: Z3_context, i: ::core::ffi::c_uint) -> Z3_string;
5367
5368 /// Return the number of builtin probes available in Z3.
5369 ///
5370 /// # See also:
5371 ///
5372 /// - [`Z3_get_probe_name`]
5373 pub fn Z3_get_num_probes(c: Z3_context) -> ::core::ffi::c_uint;
5374
5375 /// Return the name of the `i` probe.
5376 ///
5377 /// # Preconditions:
5378 ///
5379 /// - `i < Z3_get_num_probes(c)`
5380 ///
5381 /// # See also:
5382 ///
5383 /// - [`Z3_get_num_probes`]
5384 pub fn Z3_get_probe_name(c: Z3_context, i: ::core::ffi::c_uint) -> Z3_string;
5385
5386 /// Return a string containing a description of parameters accepted by the given tactic.
5387 pub fn Z3_tactic_get_help(c: Z3_context, t: Z3_tactic) -> Z3_string;
5388
5389 /// Return the parameter description set for the given tactic object.
5390 pub fn Z3_tactic_get_param_descrs(c: Z3_context, t: Z3_tactic) -> Option<Z3_param_descrs>;
5391
5392 /// Return a string containing a description of the tactic with the given name.
5393 pub fn Z3_tactic_get_descr(c: Z3_context, name: Z3_string) -> Z3_string;
5394
5395 /// Return a string containing a description of the probe with the given name.
5396 pub fn Z3_probe_get_descr(c: Z3_context, name: Z3_string) -> Z3_string;
5397
5398 /// Execute the probe over the goal. The probe always produce a double value.
5399 /// "Boolean" probes return 0.0 for false, and a value different from 0.0 for true.
5400 pub fn Z3_probe_apply(c: Z3_context, p: Z3_probe, g: Z3_goal) -> f64;
5401
5402 /// Apply tactic `t` to the goal `g`.
5403 ///
5404 /// # See also:
5405 ///
5406 /// - [`Z3_tactic_apply_ex`]
5407 pub fn Z3_tactic_apply(c: Z3_context, t: Z3_tactic, g: Z3_goal) -> Option<Z3_apply_result>;
5408
5409 /// Apply tactic `t` to the goal `g` using the parameter set `p`.
5410 ///
5411 /// # See also:
5412 ///
5413 /// - [`Z3_tactic_apply`]
5414 pub fn Z3_tactic_apply_ex(
5415 c: Z3_context,
5416 t: Z3_tactic,
5417 g: Z3_goal,
5418 p: Z3_params,
5419 ) -> Option<Z3_apply_result>;
5420
5421 /// Increment the reference counter of the given `Z3_apply_result` object.
5422 pub fn Z3_apply_result_inc_ref(c: Z3_context, r: Z3_apply_result);
5423
5424 /// Decrement the reference counter of the given `Z3_apply_result` object.
5425 pub fn Z3_apply_result_dec_ref(c: Z3_context, r: Z3_apply_result);
5426
5427 /// Convert the `Z3_apply_result` object returned by [`Z3_tactic_apply`] into a string.
5428 pub fn Z3_apply_result_to_string(c: Z3_context, r: Z3_apply_result) -> Z3_string;
5429
5430 /// Return the number of subgoals in the `Z3_apply_result` object returned by [`Z3_tactic_apply`].
5431 ///
5432 /// # See also:
5433 ///
5434 /// - [`Z3_apply_result_get_subgoal`]
5435 pub fn Z3_apply_result_get_num_subgoals(
5436 c: Z3_context,
5437 r: Z3_apply_result,
5438 ) -> ::core::ffi::c_uint;
5439
5440 /// Return one of the subgoals in the `Z3_apply_result` object returned by [`Z3_tactic_apply`].
5441 ///
5442 /// # Preconditions:
5443 ///
5444 /// - `i < Z3_apply_result_get_num_subgoals(c, r)`
5445 ///
5446 /// # See also:
5447 ///
5448 /// - [`Z3_apply_result_get_num_subgoals`]
5449 pub fn Z3_apply_result_get_subgoal(
5450 c: Z3_context,
5451 r: Z3_apply_result,
5452 i: ::core::ffi::c_uint,
5453 ) -> Option<Z3_goal>;
5454
5455 /// Create a new solver. This solver is a "combined solver" (see
5456 /// `combined_solver` module) that internally uses a non-incremental (solver1) and an
5457 /// incremental solver (solver2). This combined solver changes its behaviour based
5458 /// on how it is used and how its parameters are set.
5459 ///
5460 /// If the solver is used in a non incremental way (i.e. no calls to
5461 /// [`Z3_solver_push`] or [`Z3_solver_pop`], and no calls to
5462 /// [`Z3_solver_assert`] or [`Z3_solver_assert_and_track`] after checking
5463 /// satisfiability without an intervening [`Z3_solver_reset`]) then solver1
5464 /// will be used. This solver will apply Z3's "default" tactic.
5465 ///
5466 /// The "default" tactic will attempt to probe the logic used by the
5467 /// assertions and will apply a specialized tactic if one is supported.
5468 /// Otherwise the general `(and-then simplify smt)` tactic will be used.
5469 ///
5470 /// If the solver is used in an incremental way then the combined solver
5471 /// will switch to using solver2 (which behaves similarly to the general
5472 /// "smt" tactic).
5473 ///
5474 /// Note however it is possible to set the `solver2_timeout`,
5475 /// `solver2_unknown`, and `ignore_solver1` parameters of the combined
5476 /// solver to change its behaviour.
5477 ///
5478 /// The function [`Z3_solver_get_model`] retrieves a model if the
5479 /// assertions is satisfiable (i.e., the result is
5480 /// `Z3_L_TRUE`) and model construction is enabled.
5481 /// The function [`Z3_solver_get_model`] can also be used even
5482 /// if the result is `Z3_L_UNDEF`, but the returned model
5483 /// is not guaranteed to satisfy quantified assertions.
5484 ///
5485 /// NOTE: User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
5486 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5487 ///
5488 /// # See also:
5489 ///
5490 /// - [`Z3_mk_simple_solver`]
5491 /// - [`Z3_mk_solver_for_logic`]
5492 /// - [`Z3_mk_solver_from_tactic`]
5493 pub fn Z3_mk_solver(c: Z3_context) -> Option<Z3_solver>;
5494
5495 /// Create a new incremental solver.
5496 ///
5497 /// This is equivalent to applying the "smt" tactic.
5498 ///
5499 /// Unlike [`Z3_mk_solver`] this solver
5500 /// - Does not attempt to apply any logic specific tactics.
5501 /// - Does not change its behaviour based on whether it used
5502 /// incrementally/non-incrementally.
5503 ///
5504 /// Note that these differences can result in very different performance
5505 /// compared to `Z3_mk_solver()`.
5506 ///
5507 /// The function [`Z3_solver_get_model`] retrieves a model if the
5508 /// assertions is satisfiable (i.e., the result is
5509 /// `Z3_L_TRUE`) and model construction is enabled.
5510 /// The function [`Z3_solver_get_model`] can also be used even
5511 /// if the result is `Z3_L_UNDEF`, but the returned model
5512 /// is not guaranteed to satisfy quantified assertions.
5513 ///
5514 /// NOTE: User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
5515 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5516 ///
5517 /// # See also:
5518 ///
5519 /// - [`Z3_mk_solver`]
5520 /// - [`Z3_mk_solver_for_logic`]
5521 /// - [`Z3_mk_solver_from_tactic`]
5522 pub fn Z3_mk_simple_solver(c: Z3_context) -> Option<Z3_solver>;
5523
5524 /// Create a new solver customized for the given logic.
5525 /// It behaves like [`Z3_mk_solver`] if the logic is unknown or unsupported.
5526 ///
5527 /// NOTE: User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
5528 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5529 ///
5530 /// # See also:
5531 ///
5532 /// - [`Z3_mk_solver`]
5533 /// - [`Z3_mk_simple_solver`]
5534 /// - [`Z3_mk_solver_from_tactic`]
5535 pub fn Z3_mk_solver_for_logic(c: Z3_context, logic: Z3_symbol) -> Option<Z3_solver>;
5536
5537 /// Create a new solver that is implemented using the given tactic.
5538 /// The solver supports the commands [`Z3_solver_push`] and [`Z3_solver_pop`], but it
5539 /// will always solve each [`Z3_solver_check`] from scratch.
5540 ///
5541 /// NOTE: User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
5542 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5543 ///
5544 /// # See also:
5545 ///
5546 /// - [`Z3_mk_solver`]
5547 /// - [`Z3_mk_simple_solver`]
5548 /// - [`Z3_mk_solver_for_logic`]
5549 pub fn Z3_mk_solver_from_tactic(c: Z3_context, t: Z3_tactic) -> Option<Z3_solver>;
5550
5551 /// Copy a solver `s` from the context `source` to the context `target`.
5552 pub fn Z3_solver_translate(
5553 source: Z3_context,
5554 s: Z3_solver,
5555 target: Z3_context,
5556 ) -> Option<Z3_solver>;
5557
5558 /// Ad-hoc method for importing model conversion from solver.
5559 pub fn Z3_solver_import_model_converter(ctx: Z3_context, src: Z3_solver, dst: Z3_solver);
5560
5561 /// Return a string describing all solver available parameters.
5562 ///
5563 /// # See also:
5564 ///
5565 /// - [`Z3_solver_get_param_descrs`]
5566 /// - [`Z3_solver_set_params`]
5567 pub fn Z3_solver_get_help(c: Z3_context, s: Z3_solver) -> Z3_string;
5568
5569 /// Return the parameter description set for the given solver object.
5570 ///
5571 /// # See also:
5572 ///
5573 /// - [`Z3_solver_get_help`]
5574 /// - [`Z3_solver_set_params`]
5575 pub fn Z3_solver_get_param_descrs(c: Z3_context, s: Z3_solver) -> Option<Z3_param_descrs>;
5576
5577 /// Set the given solver using the given parameters.
5578 ///
5579 /// # See also:
5580 ///
5581 /// - [`Z3_solver_get_help`]
5582 /// - [`Z3_solver_get_param_descrs`]
5583 pub fn Z3_solver_set_params(c: Z3_context, s: Z3_solver, p: Z3_params);
5584
5585 /// Increment the reference counter of the given solver.
5586 pub fn Z3_solver_inc_ref(c: Z3_context, s: Z3_solver);
5587
5588 /// Decrement the reference counter of the given solver.
5589 pub fn Z3_solver_dec_ref(c: Z3_context, s: Z3_solver);
5590
5591 /// Create a backtracking point.
5592 ///
5593 /// The solver contains a stack of assertions.
5594 ///
5595 /// # See also:
5596 ///
5597 /// - [`Z3_solver_pop`]
5598 pub fn Z3_solver_push(c: Z3_context, s: Z3_solver);
5599
5600 /// Backtrack `n` backtracking points.
5601 ///
5602 /// # See also:
5603 ///
5604 /// - [`Z3_solver_push`]
5605 ///
5606 /// # Preconditions:
5607 ///
5608 /// - `n <= Z3_solver_get_num_scopes(c, s)`
5609 pub fn Z3_solver_pop(c: Z3_context, s: Z3_solver, n: ::core::ffi::c_uint);
5610
5611 /// Remove all assertions from the solver.
5612 ///
5613 /// # See also:
5614 ///
5615 /// - [`Z3_solver_assert`]
5616 /// - [`Z3_solver_assert_and_track`]
5617 pub fn Z3_solver_reset(c: Z3_context, s: Z3_solver);
5618
5619 /// Return the number of backtracking points.
5620 ///
5621 /// # See also:
5622 ///
5623 /// - [`Z3_solver_push`]
5624 /// - [`Z3_solver_pop`]
5625 pub fn Z3_solver_get_num_scopes(c: Z3_context, s: Z3_solver) -> ::core::ffi::c_uint;
5626
5627 /// Assert a constraint into the solver.
5628 ///
5629 /// The functions [`Z3_solver_check`] and [`Z3_solver_check_assumptions`] should be
5630 /// used to check whether the logical context is consistent or not.
5631 ///
5632 /// # See also:
5633 ///
5634 /// - [`Z3_solver_assert_and_track`]
5635 /// - [`Z3_solver_reset`]
5636 pub fn Z3_solver_assert(c: Z3_context, s: Z3_solver, a: Z3_ast);
5637
5638 /// Assert a constraint `a` into the solver, and track it (in the
5639 /// unsat) core using the Boolean constant `p`.
5640 ///
5641 /// This API is an alternative to [`Z3_solver_check_assumptions`]
5642 /// for extracting unsat cores. Both APIs can be used in the same solver.
5643 /// The unsat core will contain a combination of the Boolean variables
5644 /// provided using [`Z3_solver_assert_and_track`]
5645 /// and the Boolean literals provided using
5646 /// [`Z3_solver_check_assumptions`].
5647 ///
5648 /// # Preconditions:
5649 ///
5650 /// * `a` must be a Boolean expression
5651 /// * `p` must be a Boolean constant (aka variable).
5652 ///
5653 /// # See also:
5654 ///
5655 /// - [`Z3_solver_assert`]
5656 /// - [`Z3_solver_reset`]
5657 pub fn Z3_solver_assert_and_track(c: Z3_context, s: Z3_solver, a: Z3_ast, p: Z3_ast);
5658
5659 /// load solver assertions from a file.
5660 ///
5661 /// # See also:
5662 ///
5663 /// - [`Z3_solver_from_string`]
5664 /// - [`Z3_solver_to_string`]
5665 pub fn Z3_solver_from_file(c: Z3_context, s: Z3_solver, file_name: Z3_string);
5666
5667 /// load solver assertions from a string.
5668 ///
5669 /// # See also:
5670 ///
5671 /// - [`Z3_solver_from_file`]
5672 /// - [`Z3_solver_to_string`]
5673 pub fn Z3_solver_from_string(c: Z3_context, s: Z3_solver, c_str: Z3_string);
5674
5675 /// Return the set of asserted formulas on the solver.
5676 pub fn Z3_solver_get_assertions(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
5677
5678 /// Return the set of units modulo model conversion.
5679 pub fn Z3_solver_get_units(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
5680
5681 /// Return the set of non units in the solver state.
5682 pub fn Z3_solver_get_non_units(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
5683
5684 /// Check whether the assertions in a given solver are consistent or not.
5685 ///
5686 /// The function [`Z3_solver_get_model`]
5687 /// retrieves a model if the assertions is satisfiable (i.e., the
5688 /// result is `Z3_L_TRUE`) and model construction is enabled.
5689 /// Note that if the call returns `Z3_L_UNDEF`, Z3 does not
5690 /// ensure that calls to [`Z3_solver_get_model`]
5691 /// succeed and any models produced in this case are not guaranteed
5692 /// to satisfy the assertions.
5693 ///
5694 /// The function [`Z3_solver_get_proof`]
5695 /// retrieves a proof if proof generation was enabled when the context
5696 /// was created, and the assertions are unsatisfiable (i.e., the result
5697 /// is `Z3_L_FALSE`).
5698 ///
5699 /// # See also:
5700 ///
5701 /// - [`Z3_solver_check_assumptions`]
5702 pub fn Z3_solver_check(c: Z3_context, s: Z3_solver) -> Z3_lbool;
5703
5704 /// Check whether the assertions in the given solver and
5705 /// optional assumptions are consistent or not.
5706 ///
5707 /// The function
5708 /// [`Z3_solver_get_unsat_core`]
5709 /// retrieves the subset of the assumptions used in the
5710 /// unsatisfiability proof produced by Z3.
5711 ///
5712 /// # See also:
5713 ///
5714 /// - [`Z3_solver_check`]
5715 pub fn Z3_solver_check_assumptions(
5716 c: Z3_context,
5717 s: Z3_solver,
5718 num_assumptions: ::core::ffi::c_uint,
5719 assumptions: *const Z3_ast,
5720 ) -> Z3_lbool;
5721
5722 /// Retrieve congruence class representatives for terms.
5723 ///
5724 /// The function can be used for relying on Z3 to identify equal terms under the current
5725 /// set of assumptions. The array of terms and array of class identifiers should have
5726 /// the same length. The class identifiers are numerals that are assigned to the same
5727 /// value for their corresponding terms if the current context forces the terms to be
5728 /// equal. You cannot deduce that terms corresponding to different numerals must be all different,
5729 /// (especially when using non-convex theories).
5730 /// All implied equalities are returned by this call.
5731 /// This means that two terms map to the same class identifier if and only if
5732 /// the current context implies that they are equal.
5733 ///
5734 /// A side-effect of the function is a satisfiability check on the assertions on the solver that is passed in.
5735 /// The function return `Z3_L_FALSE` if the current assertions are not satisfiable.
5736 pub fn Z3_get_implied_equalities(
5737 c: Z3_context,
5738 s: Z3_solver,
5739 num_terms: ::core::ffi::c_uint,
5740 terms: *const Z3_ast,
5741 class_ids: *mut ::core::ffi::c_uint,
5742 ) -> Z3_lbool;
5743
5744 /// retrieve consequences from solver that determine values of the supplied function symbols.
5745 pub fn Z3_solver_get_consequences(
5746 c: Z3_context,
5747 s: Z3_solver,
5748 assumptions: Z3_ast_vector,
5749 variables: Z3_ast_vector,
5750 consequences: Z3_ast_vector,
5751 ) -> Z3_lbool;
5752
5753 /// Extract a next cube for a solver. The last cube is the constant `true` or `false`.
5754 /// The number of (non-constant) cubes is by default 1. For the sat solver cubing is controlled
5755 /// using parameters sat.lookahead.cube.cutoff and sat.lookahead.cube.fraction.
5756 ///
5757 /// The third argument is a vector of variables that may be used for cubing.
5758 /// The contents of the vector is only used in the first call. The initial list of variables
5759 /// is used in subsequent calls until it returns the unsatisfiable cube.
5760 /// The vector is modified to contain a set of Autarky variables that occur in clauses that
5761 /// are affected by the (last literal in the) cube. These variables could be used by a different
5762 /// cuber (on a different solver object) for further recursive cubing.
5763 ///
5764 /// The last argument is a backtracking level. It instructs the cube process to backtrack below
5765 /// the indicated level for the next cube.
5766 pub fn Z3_solver_cube(
5767 c: Z3_context,
5768 s: Z3_solver,
5769 vars: Z3_ast_vector,
5770 backtrack_level: ::core::ffi::c_uint,
5771 ) -> Option<Z3_ast_vector>;
5772
5773 /// Retrieve the model for the last [`Z3_solver_check`]
5774 ///
5775 /// The error handler is invoked if a model is not available because
5776 /// the commands above were not invoked for the given solver, or if the result was `Z3_L_FALSE`.
5777 pub fn Z3_solver_get_model(c: Z3_context, s: Z3_solver) -> Option<Z3_model>;
5778
5779 /// Retrieve the proof for the last [`Z3_solver_check`]
5780 ///
5781 /// The error handler is invoked if proof generation is not enabled,
5782 /// or if the commands above were not invoked for the given solver,
5783 /// or if the result was different from `Z3_L_FALSE`.
5784 pub fn Z3_solver_get_proof(c: Z3_context, s: Z3_solver) -> Option<Z3_ast>;
5785
5786 /// Retrieve the unsat core for the last [`Z3_solver_check_assumptions`]
5787 /// The unsat core is a subset of the assumptions `a`.
5788 ///
5789 /// By default, the unsat core will not be minimized. Generation of a minimized
5790 /// unsat core can be enabled via the `"sat.core.minimize"` and `"smt.core.minimize"`
5791 /// settings for SAT and SMT cores respectively. Generation of minimized unsat cores
5792 /// will be more expensive.
5793 pub fn Z3_solver_get_unsat_core(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
5794
5795 /// Return a brief justification for an "unknown" result (i.e., `Z3_L_UNDEF`) for
5796 /// the commands [`Z3_solver_check`]
5797 pub fn Z3_solver_get_reason_unknown(c: Z3_context, s: Z3_solver) -> Z3_string;
5798
5799 /// Return statistics for the given solver.
5800 ///
5801 /// NOTE: User must use [`Z3_stats_inc_ref`] and [`Z3_stats_dec_ref`] to manage [`Z3_stats`] objects.
5802 pub fn Z3_solver_get_statistics(c: Z3_context, s: Z3_solver) -> Option<Z3_stats>;
5803
5804 /// Convert a solver into a string.
5805 ///
5806 /// # See also:
5807 ///
5808 /// - [`Z3_solver_from_file`]
5809 /// - [`Z3_solver_from_string`]
5810 pub fn Z3_solver_to_string(c: Z3_context, s: Z3_solver) -> Z3_string;
5811
5812 /// Convert a statistics into a string.
5813 pub fn Z3_stats_to_string(c: Z3_context, s: Z3_stats) -> Z3_string;
5814
5815 /// Increment the reference counter of the given statistics object.
5816 pub fn Z3_stats_inc_ref(c: Z3_context, s: Z3_stats);
5817
5818 /// Decrement the reference counter of the given statistics object.
5819 pub fn Z3_stats_dec_ref(c: Z3_context, s: Z3_stats);
5820
5821 /// Return the number of statistical data in `s`.
5822 pub fn Z3_stats_size(c: Z3_context, s: Z3_stats) -> ::core::ffi::c_uint;
5823
5824 /// Return the key (a string) for a particular statistical data.
5825 ///
5826 /// # Preconditions:
5827 ///
5828 /// - `idx < Z3_stats_size(c, s)`
5829 pub fn Z3_stats_get_key(c: Z3_context, s: Z3_stats, idx: ::core::ffi::c_uint) -> Z3_string;
5830
5831 /// Return `true` if the given statistical data is a unsigned integer.
5832 ///
5833 /// # Preconditions:
5834 ///
5835 /// - `idx < Z3_stats_size(c, s)`
5836 pub fn Z3_stats_is_uint(c: Z3_context, s: Z3_stats, idx: ::core::ffi::c_uint) -> bool;
5837
5838 /// Return `true` if the given statistical data is a double.
5839 ///
5840 /// # Preconditions:
5841 ///
5842 /// - `idx < Z3_stats_size(c, s)`
5843 pub fn Z3_stats_is_double(c: Z3_context, s: Z3_stats, idx: ::core::ffi::c_uint) -> bool;
5844
5845 /// Return the unsigned value of the given statistical data.
5846 ///
5847 /// # Preconditions:
5848 ///
5849 /// - `idx < Z3_stats_size(c, s) && Z3_stats_is_uint(c, s)`
5850 pub fn Z3_stats_get_uint_value(
5851 c: Z3_context,
5852 s: Z3_stats,
5853 idx: ::core::ffi::c_uint,
5854 ) -> ::core::ffi::c_uint;
5855
5856 /// Return the double value of the given statistical data.
5857 ///
5858 /// # Preconditions:
5859 ///
5860 /// - `idx < Z3_stats_size(c, s) && Z3_stats_is_double(c, s)`
5861 pub fn Z3_stats_get_double_value(c: Z3_context, s: Z3_stats, idx: ::core::ffi::c_uint) -> f64;
5862
5863 /// Return the estimated allocated memory in bytes.
5864 pub fn Z3_get_estimated_alloc_size() -> u64;
5865
5866 /// Return an empty AST vector.
5867 ///
5868 /// NOTE: Reference counting must be used to manage AST vectors, even when the `Z3_context` was
5869 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5870 pub fn Z3_mk_ast_vector(c: Z3_context) -> Option<Z3_ast_vector>;
5871
5872 /// Increment the reference counter of the given AST vector.
5873 pub fn Z3_ast_vector_inc_ref(c: Z3_context, v: Z3_ast_vector);
5874
5875 /// Decrement the reference counter of the given AST vector.
5876 pub fn Z3_ast_vector_dec_ref(c: Z3_context, v: Z3_ast_vector);
5877
5878 /// Return the size of the given AST vector.
5879 pub fn Z3_ast_vector_size(c: Z3_context, v: Z3_ast_vector) -> ::core::ffi::c_uint;
5880
5881 /// Return the AST at position `i` in the AST vector `v`.
5882 ///
5883 /// # Preconditions:
5884 ///
5885 /// - `i < Z3_ast_vector_size(c, v)`
5886 pub fn Z3_ast_vector_get(
5887 c: Z3_context,
5888 v: Z3_ast_vector,
5889 i: ::core::ffi::c_uint,
5890 ) -> Option<Z3_ast>;
5891
5892 /// Update position `i` of the AST vector `v` with the AST `a`.
5893 ///
5894 /// # Preconditions:
5895 ///
5896 /// - `i < Z3_ast_vector_size(c, v)`
5897 pub fn Z3_ast_vector_set(c: Z3_context, v: Z3_ast_vector, i: ::core::ffi::c_uint, a: Z3_ast);
5898
5899 /// Resize the AST vector `v`.
5900 pub fn Z3_ast_vector_resize(c: Z3_context, v: Z3_ast_vector, n: ::core::ffi::c_uint);
5901
5902 /// Add the AST `a` in the end of the AST vector `v`. The size of `v` is increased by one.
5903 pub fn Z3_ast_vector_push(c: Z3_context, v: Z3_ast_vector, a: Z3_ast);
5904
5905 /// Translate the AST vector `v` from context `s` into an AST vector in context `t`.
5906 pub fn Z3_ast_vector_translate(
5907 s: Z3_context,
5908 v: Z3_ast_vector,
5909 t: Z3_context,
5910 ) -> Option<Z3_ast_vector>;
5911
5912 /// Convert AST vector into a string.
5913 pub fn Z3_ast_vector_to_string(c: Z3_context, v: Z3_ast_vector) -> Z3_string;
5914
5915 /// Return an empty mapping from AST to AST
5916 ///
5917 /// NOTE: Reference counting must be used to manage AST maps, even when the `Z3_context` was
5918 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5919 pub fn Z3_mk_ast_map(c: Z3_context) -> Option<Z3_ast_map>;
5920
5921 /// Increment the reference counter of the given AST map.
5922 pub fn Z3_ast_map_inc_ref(c: Z3_context, m: Z3_ast_map);
5923
5924 /// Decrement the reference counter of the given AST map.
5925 pub fn Z3_ast_map_dec_ref(c: Z3_context, m: Z3_ast_map);
5926
5927 /// Return true if the map `m` contains the AST key `k`.
5928 pub fn Z3_ast_map_contains(c: Z3_context, m: Z3_ast_map, k: Z3_ast) -> bool;
5929
5930 /// Return the value associated with the key `k`.
5931 ///
5932 /// The procedure invokes the error handler if `k` is not in the map.
5933 pub fn Z3_ast_map_find(c: Z3_context, m: Z3_ast_map, k: Z3_ast) -> Option<Z3_ast>;
5934
5935 /// Store/Replace a new key, value pair in the given map.
5936 pub fn Z3_ast_map_insert(c: Z3_context, m: Z3_ast_map, k: Z3_ast, v: Z3_ast);
5937
5938 /// Erase a key from the map.
5939 pub fn Z3_ast_map_erase(c: Z3_context, m: Z3_ast_map, k: Z3_ast);
5940
5941 /// Remove all keys from the given map.
5942 pub fn Z3_ast_map_reset(c: Z3_context, m: Z3_ast_map);
5943
5944 /// Return the size of the given map.
5945 pub fn Z3_ast_map_size(c: Z3_context, m: Z3_ast_map) -> ::core::ffi::c_uint;
5946
5947 /// Return the keys stored in the given map.
5948 pub fn Z3_ast_map_keys(c: Z3_context, m: Z3_ast_map) -> Option<Z3_ast_vector>;
5949
5950 /// Convert the given map into a string.
5951 pub fn Z3_ast_map_to_string(c: Z3_context, m: Z3_ast_map) -> Z3_string;
5952
5953 /// Return `true` if `a` can be used as value in the Z3 real algebraic
5954 /// number package.
5955 pub fn Z3_algebraic_is_value(c: Z3_context, a: Z3_ast) -> bool;
5956
5957 /// Return `true` if `a` is positive, and `false` otherwise.
5958 ///
5959 /// # Preconditions:
5960 ///
5961 /// - `Z3_algebraic_is_value(c, a)`
5962 ///
5963 /// # See also:
5964 ///
5965 /// - [`Z3_algebraic_is_value`]
5966 pub fn Z3_algebraic_is_pos(c: Z3_context, a: Z3_ast) -> bool;
5967
5968 /// Return `true` if `a` is negative, and `false` otherwise.
5969 ///
5970 /// # Preconditions:
5971 ///
5972 /// - `Z3_algebraic_is_value(c, a)`
5973 ///
5974 /// # See also:
5975 ///
5976 /// - [`Z3_algebraic_is_value`]
5977 pub fn Z3_algebraic_is_neg(c: Z3_context, a: Z3_ast) -> bool;
5978
5979 /// Return `true` if `a` is zero, and `false` otherwise.
5980 ///
5981 /// # Preconditions:
5982 ///
5983 /// - `Z3_algebraic_is_value(c, a)`
5984 ///
5985 /// # See also:
5986 ///
5987 /// - [`Z3_algebraic_is_value`]
5988 pub fn Z3_algebraic_is_zero(c: Z3_context, a: Z3_ast) -> bool;
5989
5990 /// Return 1 if `a` is positive, 0 if `a` is zero, and -1 if `a` is negative.
5991 ///
5992 /// # Preconditions:
5993 ///
5994 /// - `Z3_algebraic_is_value(c, a)`
5995 ///
5996 /// # See also:
5997 ///
5998 /// - [`Z3_algebraic_is_value`]
5999 pub fn Z3_algebraic_sign(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_int;
6000
6001 /// Return the value `a + b`.
6002 ///
6003 /// # Preconditions:
6004 ///
6005 /// - `Z3_algebraic_is_value(c, a)`
6006 /// - `Z3_algebraic_is_value(c, b)`
6007 ///
6008 /// # Postconditions:
6009 ///
6010 /// - `Z3_algebraic_is_value(c, result)`
6011 ///
6012 /// # See also:
6013 ///
6014 /// - [`Z3_algebraic_is_value`]
6015 pub fn Z3_algebraic_add(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
6016
6017 /// Return the value `a - b`.
6018 ///
6019 /// # Preconditions:
6020 ///
6021 /// - `Z3_algebraic_is_value(c, a)`
6022 /// - `Z3_algebraic_is_value(c, b)`
6023 ///
6024 /// # Postconditions:
6025 ///
6026 /// - `Z3_algebraic_is_value(c, result)`
6027 ///
6028 /// # See also:
6029 ///
6030 /// - [`Z3_algebraic_is_value`]
6031 pub fn Z3_algebraic_sub(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
6032
6033 /// Return the value `a * b`.
6034 ///
6035 /// # Preconditions:
6036 ///
6037 /// - `Z3_algebraic_is_value(c, a)`
6038 /// - `Z3_algebraic_is_value(c, b)`
6039 ///
6040 /// # Postconditions:
6041 ///
6042 /// - `Z3_algebraic_is_value(c, result)`
6043 ///
6044 /// # See also:
6045 ///
6046 /// - [`Z3_algebraic_is_value`]
6047 pub fn Z3_algebraic_mul(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
6048
6049 /// Return the value `a / b`.
6050 ///
6051 /// # Preconditions:
6052 ///
6053 /// - `Z3_algebraic_is_value(c, a)`
6054 /// - `Z3_algebraic_is_value(c, b)`
6055 /// - `!Z3_algebraic_is_zero(c, b)`
6056 ///
6057 /// # Postconditions:
6058 ///
6059 /// - `Z3_algebraic_is_value(c, result)`
6060 ///
6061 /// # See also:
6062 ///
6063 /// - [`Z3_algebraic_is_value`]
6064 /// - [`Z3_algebraic_is_zero`]
6065 pub fn Z3_algebraic_div(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
6066
6067 /// Return the `a^(1/k)`
6068 ///
6069 /// # Preconditions:
6070 ///
6071 /// - `Z3_algebraic_is_value(c, a)`
6072 /// - k is even => `!Z3_algebraic_is_neg(c, a)`
6073 ///
6074 /// # Postconditions:
6075 ///
6076 /// - `Z3_algebraic_is_value(c, result)`
6077 ///
6078 /// # See also:
6079 ///
6080 /// - [`Z3_algebraic_is_neg`]
6081 /// - [`Z3_algebraic_is_value`]
6082 pub fn Z3_algebraic_root(c: Z3_context, a: Z3_ast, k: ::core::ffi::c_uint) -> Option<Z3_ast>;
6083
6084 /// Return the `a^k`
6085 ///
6086 /// # Preconditions:
6087 ///
6088 /// - `Z3_algebraic_is_value(c, a)`
6089 ///
6090 /// # Postconditions:
6091 ///
6092 /// - `Z3_algebraic_is_value(c, result)`
6093 ///
6094 /// # See also:
6095 ///
6096 /// - [`Z3_algebraic_is_value`]
6097 pub fn Z3_algebraic_power(c: Z3_context, a: Z3_ast, k: ::core::ffi::c_uint) -> Option<Z3_ast>;
6098
6099 /// Return `true` if `a < b`, and `false` otherwise.
6100 ///
6101 /// # Preconditions:
6102 ///
6103 /// - `Z3_algebraic_is_value(c, a)`
6104 /// - `Z3_algebraic_is_value(c, b)`
6105 ///
6106 /// # See also:
6107 ///
6108 /// - [`Z3_algebraic_is_value`]
6109 pub fn Z3_algebraic_lt(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6110
6111 /// Return `true` if `a > b`, and `false` otherwise.
6112 ///
6113 /// # Preconditions:
6114 ///
6115 /// - `Z3_algebraic_is_value(c, a)`
6116 /// - `Z3_algebraic_is_value(c, b)`
6117 ///
6118 /// # See also:
6119 ///
6120 /// - [`Z3_algebraic_is_value`]
6121 pub fn Z3_algebraic_gt(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6122
6123 /// Return `true` if `a <= b`, and `false` otherwise.
6124 ///
6125 /// # Preconditions:
6126 ///
6127 /// - `Z3_algebraic_is_value(c, a)`
6128 /// - `Z3_algebraic_is_value(c, b)`
6129 ///
6130 /// # See also:
6131 ///
6132 /// - [`Z3_algebraic_is_value`]
6133 pub fn Z3_algebraic_le(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6134
6135 /// Return `true` if `a >= b`, and `false` otherwise.
6136 ///
6137 /// # Preconditions:
6138 ///
6139 /// - `Z3_algebraic_is_value(c, a)`
6140 /// - `Z3_algebraic_is_value(c, b)`
6141 ///
6142 /// # See also:
6143 ///
6144 /// - [`Z3_algebraic_is_value`]
6145 pub fn Z3_algebraic_ge(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6146
6147 /// Return `true` if `a == b`, and `false` otherwise.
6148 ///
6149 /// # Preconditions:
6150 ///
6151 /// - `Z3_algebraic_is_value(c, a)`
6152 /// - `Z3_algebraic_is_value(c, b)`
6153 ///
6154 /// # See also:
6155 ///
6156 /// - [`Z3_algebraic_is_value`]
6157 pub fn Z3_algebraic_eq(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6158
6159 /// Return `true` if `a != b`, and `false` otherwise.
6160 ///
6161 /// # Preconditions:
6162 ///
6163 /// - `Z3_algebraic_is_value(c, a)`
6164 /// - `Z3_algebraic_is_value(c, b)`
6165 ///
6166 /// # See also:
6167 ///
6168 /// - [`Z3_algebraic_is_value`]
6169 pub fn Z3_algebraic_neq(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
6170
6171 /// Given a multivariate polynomial `p(x_0, ..., x_{n-1}, x_n)`, returns the
6172 /// roots of the univariate polynomial `p(a[0], ..., a[n-1], x_n)`.
6173 ///
6174 /// # Preconditions:
6175 ///
6176 /// - `p` is a Z3 expression that contains only arithmetic terms and free variables.
6177 /// - `forall i in [0, n) Z3_algebraic_is_value(c, a[i])`
6178 ///
6179 /// # Postconditions:
6180 ///
6181 /// - `forall r in result Z3_algebraic_is_value(c, result)`
6182 ///
6183 /// # See also:
6184 ///
6185 /// - [`Z3_algebraic_is_value`]
6186 pub fn Z3_algebraic_roots(
6187 c: Z3_context,
6188 p: Z3_ast,
6189 n: ::core::ffi::c_uint,
6190 a: *mut Z3_ast,
6191 ) -> Option<Z3_ast_vector>;
6192
6193 /// Given a multivariate polynomial `p(x_0, ..., x_{n-1})`, return the
6194 /// sign of `p(a[0], ..., a[n-1])`.
6195 ///
6196 /// # Preconditions:
6197 ///
6198 /// - `p` is a Z3 expression that contains only arithmetic terms and free variables.
6199 /// - `forall i in [0, n) Z3_algebraic_is_value(c, a[i])`
6200 ///
6201 /// # See also:
6202 ///
6203 /// - [`Z3_algebraic_is_value`]
6204 pub fn Z3_algebraic_eval(
6205 c: Z3_context,
6206 p: Z3_ast,
6207 n: ::core::ffi::c_uint,
6208 a: *mut Z3_ast,
6209 ) -> ::core::ffi::c_int;
6210
6211 /// Return the nonzero subresultants of `p` and `q` with respect to the "variable" `x`.
6212 ///
6213 /// # Preconditions:
6214 ///
6215 /// - `p`, `q` and `x` are Z3 expressions where `p` and `q` are arithmetic terms.
6216 ///
6217 /// Note that, any subterm that cannot be viewed as a polynomial is assumed to be a variable.
6218 /// Example: `f(a)` is a considered to be a variable in the polynomial
6219 /// `f(a)*f(a) + 2*f(a) + 1`
6220 pub fn Z3_polynomial_subresultants(
6221 c: Z3_context,
6222 p: Z3_ast,
6223 q: Z3_ast,
6224 x: Z3_ast,
6225 ) -> Option<Z3_ast_vector>;
6226
6227 /// Delete a RCF numeral created using the RCF API.
6228 pub fn Z3_rcf_del(c: Z3_context, a: Z3_rcf_num);
6229
6230 /// Return a RCF rational using the given string.
6231 pub fn Z3_rcf_mk_rational(c: Z3_context, val: Z3_string) -> Option<Z3_rcf_num>;
6232
6233 /// Return a RCF small integer.
6234 pub fn Z3_rcf_mk_small_int(c: Z3_context, val: ::core::ffi::c_int) -> Option<Z3_rcf_num>;
6235
6236 /// Return Pi
6237 pub fn Z3_rcf_mk_pi(c: Z3_context) -> Option<Z3_rcf_num>;
6238
6239 /// Return e (Euler's constant)
6240 pub fn Z3_rcf_mk_e(c: Z3_context) -> Option<Z3_rcf_num>;
6241
6242 /// Return a new infinitesimal that is smaller than all elements in the Z3 field.
6243 pub fn Z3_rcf_mk_infinitesimal(c: Z3_context) -> Option<Z3_rcf_num>;
6244
6245 /// Store in roots the roots of the polynomial `a[n-1]*x^{n-1} + ... + a[0]`.
6246 /// The output vector `roots` must have size `n`.
6247 /// It returns the number of roots of the polynomial.
6248 ///
6249 /// # Preconditions:
6250 ///
6251 /// - The input polynomial is not the zero polynomial.
6252 pub fn Z3_rcf_mk_roots(
6253 c: Z3_context,
6254 n: ::core::ffi::c_uint,
6255 a: *const Z3_rcf_num,
6256 roots: *mut Z3_rcf_num,
6257 ) -> ::core::ffi::c_uint;
6258
6259 /// Return the value `a + b`.
6260 pub fn Z3_rcf_add(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
6261
6262 /// Return the value `a - b`.
6263 pub fn Z3_rcf_sub(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
6264
6265 /// Return the value `a * b`.
6266 pub fn Z3_rcf_mul(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
6267
6268 /// Return the value `a / b`.
6269 pub fn Z3_rcf_div(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
6270
6271 /// Return the value `-a`.
6272 pub fn Z3_rcf_neg(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_rcf_num>;
6273
6274 /// Return the value `1/a`.
6275 pub fn Z3_rcf_inv(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_rcf_num>;
6276
6277 /// Return the value `a^k`.
6278 pub fn Z3_rcf_power(c: Z3_context, a: Z3_rcf_num, k: ::core::ffi::c_uint)
6279 -> Option<Z3_rcf_num>;
6280
6281 /// Return `true` if `a < b`.
6282 pub fn Z3_rcf_lt(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6283
6284 /// Return `true` if `a > b`.
6285 pub fn Z3_rcf_gt(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6286
6287 /// Return `true` if `a <= b`.
6288 pub fn Z3_rcf_le(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6289
6290 /// Return `true` if `a >= b`.
6291 pub fn Z3_rcf_ge(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6292
6293 /// Return `true` if `a == b`.
6294 pub fn Z3_rcf_eq(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6295
6296 /// Return `true` if `a != b`.
6297 pub fn Z3_rcf_neq(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
6298
6299 /// Convert the RCF numeral into a string.
6300 pub fn Z3_rcf_num_to_string(
6301 c: Z3_context,
6302 a: Z3_rcf_num,
6303 compact: bool,
6304 html: bool,
6305 ) -> Z3_string;
6306
6307 /// Convert the RCF numeral into a string in decimal notation.
6308 pub fn Z3_rcf_num_to_decimal_string(
6309 c: Z3_context,
6310 a: Z3_rcf_num,
6311 prec: ::core::ffi::c_uint,
6312 ) -> Z3_string;
6313
6314 /// Extract the "numerator" and "denominator" of the given RCF numeral.
6315 ///
6316 /// We have that `a = n/d`, moreover `n` and `d` are not represented using rational functions.
6317 pub fn Z3_rcf_get_numerator_denominator(
6318 c: Z3_context,
6319 a: Z3_rcf_num,
6320 n: *mut Z3_rcf_num,
6321 d: *mut Z3_rcf_num,
6322 );
6323
6324 /// Create a new fixedpoint context.
6325 ///
6326 /// NOTE: User must use [`Z3_fixedpoint_inc_ref`] and [`Z3_fixedpoint_dec_ref`] to manage fixedpoint objects.
6327 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
6328 pub fn Z3_mk_fixedpoint(c: Z3_context) -> Option<Z3_fixedpoint>;
6329
6330 /// Increment the reference counter of the given fixedpoint context
6331 pub fn Z3_fixedpoint_inc_ref(c: Z3_context, d: Z3_fixedpoint);
6332
6333 /// Decrement the reference counter of the given fixedpoint context.
6334 pub fn Z3_fixedpoint_dec_ref(c: Z3_context, d: Z3_fixedpoint);
6335
6336 /// Add a universal Horn clause as a named rule.
6337 /// The `horn_rule` should be of the form:
6338 ///
6339 /// ```text
6340 /// horn_rule ::= (forall (bound-vars) horn_rule)
6341 /// | (=> atoms horn_rule)
6342 /// | atom
6343 /// ```
6344 pub fn Z3_fixedpoint_add_rule(c: Z3_context, d: Z3_fixedpoint, rule: Z3_ast, name: Z3_symbol);
6345
6346 /// Add a Database fact.
6347 ///
6348 /// - `c`: - context
6349 /// - `d`: - fixed point context
6350 /// - `r`: - relation signature for the row.
6351 /// - `num_args`: - number of columns for the given row.
6352 /// - `args`: - array of the row elements.
6353 ///
6354 /// The number of arguments `num_args` should be equal to the number
6355 /// of sorts in the domain of `r`. Each sort in the domain should be an integral
6356 /// (bit-vector, Boolean or or finite domain sort).
6357 ///
6358 /// The call has the same effect as adding a rule where `r` is applied to the arguments.
6359 pub fn Z3_fixedpoint_add_fact(
6360 c: Z3_context,
6361 d: Z3_fixedpoint,
6362 r: Z3_func_decl,
6363 num_args: ::core::ffi::c_uint,
6364 args: *mut ::core::ffi::c_uint,
6365 );
6366
6367 /// Assert a constraint to the fixedpoint context.
6368 ///
6369 /// The constraints are used as background axioms when the fixedpoint engine uses the PDR mode.
6370 /// They are ignored for standard Datalog mode.
6371 pub fn Z3_fixedpoint_assert(c: Z3_context, d: Z3_fixedpoint, axiom: Z3_ast);
6372
6373 /// Pose a query against the asserted rules.
6374 ///
6375 /// ```text
6376 /// query ::= (exists (bound-vars) query)
6377 /// | literals
6378 /// ```
6379 ///
6380 /// query returns
6381 /// - `Z3_L_FALSE` if the query is unsatisfiable.
6382 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by calling [`Z3_fixedpoint_get_answer`].
6383 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
6384 pub fn Z3_fixedpoint_query(c: Z3_context, d: Z3_fixedpoint, query: Z3_ast) -> Z3_lbool;
6385
6386 /// Pose multiple queries against the asserted rules.
6387 ///
6388 /// The queries are encoded as relations (function declarations).
6389 ///
6390 /// query returns
6391 /// - `Z3_L_FALSE` if the query is unsatisfiable.
6392 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by calling [`Z3_fixedpoint_get_answer`].
6393 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
6394 pub fn Z3_fixedpoint_query_relations(
6395 c: Z3_context,
6396 d: Z3_fixedpoint,
6397 num_relations: ::core::ffi::c_uint,
6398 relations: *const Z3_func_decl,
6399 ) -> Z3_lbool;
6400
6401 /// Retrieve a formula that encodes satisfying answers to the query.
6402 ///
6403 ///
6404 /// When used in Datalog mode, the returned answer is a disjunction of conjuncts.
6405 /// Each conjunct encodes values of the bound variables of the query that are satisfied.
6406 /// In PDR mode, the returned answer is a single conjunction.
6407 ///
6408 /// When used in Datalog mode the previous call to `Z3_fixedpoint_query` must have returned `Z3_L_TRUE`.
6409 /// When used with the PDR engine, the previous call must have been either `Z3_L_TRUE` or `Z3_L_FALSE`.
6410 pub fn Z3_fixedpoint_get_answer(c: Z3_context, d: Z3_fixedpoint) -> Option<Z3_ast>;
6411
6412 /// Retrieve a string that describes the last status returned by [`Z3_fixedpoint_query`].
6413 ///
6414 /// Use this method when [`Z3_fixedpoint_query`] returns `Z3_L_UNDEF`.
6415 pub fn Z3_fixedpoint_get_reason_unknown(c: Z3_context, d: Z3_fixedpoint) -> Z3_string;
6416
6417 /// Update a named rule.
6418 /// A rule with the same name must have been previously created.
6419 pub fn Z3_fixedpoint_update_rule(c: Z3_context, d: Z3_fixedpoint, a: Z3_ast, name: Z3_symbol);
6420
6421 /// Query the PDR engine for the maximal levels properties are known about predicate.
6422 ///
6423 /// This call retrieves the maximal number of relevant unfoldings
6424 /// of `pred` with respect to the current exploration state.
6425 /// Note: this functionality is PDR specific.
6426 pub fn Z3_fixedpoint_get_num_levels(
6427 c: Z3_context,
6428 d: Z3_fixedpoint,
6429 pred: Z3_func_decl,
6430 ) -> ::core::ffi::c_uint;
6431
6432 /// Retrieve the current cover of `pred` up to `level` unfoldings.
6433 /// Return just the delta that is known at `level`. To
6434 /// obtain the full set of properties of `pred` one should query
6435 /// at `level`+1 , `level`+2 etc, and include `level`=-1.
6436 ///
6437 /// Note: this functionality is PDR specific.
6438 pub fn Z3_fixedpoint_get_cover_delta(
6439 c: Z3_context,
6440 d: Z3_fixedpoint,
6441 level: ::core::ffi::c_int,
6442 pred: Z3_func_decl,
6443 ) -> Option<Z3_ast>;
6444
6445 /// Add property about the predicate `pred`.
6446 /// Add a property of predicate `pred` at `level`.
6447 /// It gets pushed forward when possible.
6448 ///
6449 /// Note: level = -1 is treated as the fixedpoint. So passing -1 for the `level`
6450 /// means that the property is true of the fixed-point unfolding with respect to `pred`.
6451 ///
6452 /// Note: this functionality is PDR specific.
6453 pub fn Z3_fixedpoint_add_cover(
6454 c: Z3_context,
6455 d: Z3_fixedpoint,
6456 level: ::core::ffi::c_int,
6457 pred: Z3_func_decl,
6458 property: Z3_ast,
6459 );
6460
6461 /// Retrieve statistics information from the last call to [`Z3_fixedpoint_query`].
6462 pub fn Z3_fixedpoint_get_statistics(c: Z3_context, d: Z3_fixedpoint) -> Option<Z3_stats>;
6463
6464 /// Register relation as Fixedpoint defined.
6465 /// Fixedpoint defined relations have least-fixedpoint semantics.
6466 /// For example, the relation is empty if it does not occur
6467 /// in a head or a fact.
6468 pub fn Z3_fixedpoint_register_relation(c: Z3_context, d: Z3_fixedpoint, f: Z3_func_decl);
6469
6470 /// Configure the predicate representation.
6471 ///
6472 /// It sets the predicate to use a set of domains given by the list of symbols.
6473 /// The domains given by the list of symbols must belong to a set
6474 /// of built-in domains.
6475 pub fn Z3_fixedpoint_set_predicate_representation(
6476 c: Z3_context,
6477 d: Z3_fixedpoint,
6478 f: Z3_func_decl,
6479 num_relations: ::core::ffi::c_uint,
6480 relation_kinds: *const Z3_symbol,
6481 );
6482
6483 /// Retrieve set of rules from fixedpoint context.
6484 pub fn Z3_fixedpoint_get_rules(c: Z3_context, f: Z3_fixedpoint) -> Option<Z3_ast_vector>;
6485
6486 /// Retrieve set of background assertions from fixedpoint context.
6487 pub fn Z3_fixedpoint_get_assertions(c: Z3_context, f: Z3_fixedpoint) -> Option<Z3_ast_vector>;
6488
6489 /// Set parameters on fixedpoint context.
6490 ///
6491 /// # See also:
6492 ///
6493 /// - [`Z3_fixedpoint_get_help`]
6494 /// - [`Z3_fixedpoint_get_param_descrs`]
6495 pub fn Z3_fixedpoint_set_params(c: Z3_context, f: Z3_fixedpoint, p: Z3_params);
6496
6497 /// Return a string describing all fixedpoint available parameters.
6498 ///
6499 /// # See also:
6500 ///
6501 /// - [`Z3_fixedpoint_get_param_descrs`]
6502 /// - [`Z3_fixedpoint_set_params`]
6503 pub fn Z3_fixedpoint_get_help(c: Z3_context, f: Z3_fixedpoint) -> Z3_string;
6504
6505 /// Return the parameter description set for the given fixedpoint object.
6506 ///
6507 /// # See also:
6508 ///
6509 /// - [`Z3_fixedpoint_get_help`]
6510 /// - [`Z3_fixedpoint_set_params`]
6511 pub fn Z3_fixedpoint_get_param_descrs(
6512 c: Z3_context,
6513 f: Z3_fixedpoint,
6514 ) -> Option<Z3_param_descrs>;
6515
6516 /// Print the current rules and background axioms as a string.
6517 /// - `c`: - context.
6518 /// - `f`: - fixedpoint context.
6519 /// - `num_queries`: - number of additional queries to print.
6520 /// - `queries`: - additional queries.
6521 ///
6522 /// # See also:
6523 ///
6524 /// - [`Z3_fixedpoint_from_file`]
6525 /// - [`Z3_fixedpoint_from_string`]
6526 pub fn Z3_fixedpoint_to_string(
6527 c: Z3_context,
6528 f: Z3_fixedpoint,
6529 num_queries: ::core::ffi::c_uint,
6530 queries: *mut Z3_ast,
6531 ) -> Z3_string;
6532
6533 /// Parse an SMT-LIB2 string with fixedpoint rules.
6534 /// Add the rules to the current fixedpoint context.
6535 /// Return the set of queries in the string.
6536 ///
6537 /// - `c`: - context.
6538 /// - `f`: - fixedpoint context.
6539 /// - `s`: - string containing SMT2 specification.
6540 ///
6541 /// # See also:
6542 ///
6543 /// - [`Z3_fixedpoint_from_file`]
6544 /// - [`Z3_fixedpoint_to_string`]
6545 pub fn Z3_fixedpoint_from_string(
6546 c: Z3_context,
6547 f: Z3_fixedpoint,
6548 s: Z3_string,
6549 ) -> Option<Z3_ast_vector>;
6550
6551 /// Parse an SMT-LIB2 file with fixedpoint rules.
6552 /// Add the rules to the current fixedpoint context.
6553 /// Return the set of queries in the file.
6554 ///
6555 /// - `c`: - context.
6556 /// - `f`: - fixedpoint context.
6557 /// - `s`: - path to file containing SMT2 specification.
6558 ///
6559 /// # See also:
6560 ///
6561 /// - [`Z3_fixedpoint_from_string`]
6562 /// - [`Z3_fixedpoint_to_string`]
6563 pub fn Z3_fixedpoint_from_file(
6564 c: Z3_context,
6565 f: Z3_fixedpoint,
6566 s: Z3_string,
6567 ) -> Option<Z3_ast_vector>;
6568
6569 /// String less-than lexicographic comparison operation.
6570 /// Return a new AST node `Bool`.
6571 pub fn Z3_mk_str_lt(c: Z3_context, lhs: Z3_ast, rhs: Z3_ast) -> Option<Z3_ast>;
6572
6573 /// String less-than-or-equal lexicographic comparison operation.
6574 /// Return a new AST node `Bool`.
6575 pub fn Z3_mk_str_le(c: Z3_context, lhs: Z3_ast, rhs: Z3_ast) -> Option<Z3_ast>;
6576}
6577/// The following utilities allows adding user-defined domains.
6578pub type Z3_fixedpoint_reduce_assign_callback_fptr = ::core::option::Option<
6579 unsafe extern "C" fn(
6580 arg1: *mut ::core::ffi::c_void,
6581 arg2: Z3_func_decl,
6582 arg3: ::core::ffi::c_uint,
6583 arg4: *const Z3_ast,
6584 arg5: ::core::ffi::c_uint,
6585 arg6: *const Z3_ast,
6586 ),
6587>;
6588pub type Z3_fixedpoint_reduce_app_callback_fptr = ::core::option::Option<
6589 unsafe extern "C" fn(
6590 arg1: *mut ::core::ffi::c_void,
6591 arg2: Z3_func_decl,
6592 arg3: ::core::ffi::c_uint,
6593 arg4: *const Z3_ast,
6594 arg5: *mut Z3_ast,
6595 ),
6596>;
6597unsafe extern "C" {
6598 /// Initialize the context with a user-defined state.
6599 pub fn Z3_fixedpoint_init(c: Z3_context, d: Z3_fixedpoint, state: *mut ::core::ffi::c_void);
6600
6601 /// Register a callback to destructive updates.
6602 ///
6603 /// Registers are identified with terms encoded as fresh constants,
6604 pub fn Z3_fixedpoint_set_reduce_assign_callback(
6605 c: Z3_context,
6606 d: Z3_fixedpoint,
6607 cb: Z3_fixedpoint_reduce_assign_callback_fptr,
6608 );
6609
6610 /// Register a callback for building terms based on the relational operators.
6611 pub fn Z3_fixedpoint_set_reduce_app_callback(
6612 c: Z3_context,
6613 d: Z3_fixedpoint,
6614 cb: Z3_fixedpoint_reduce_app_callback_fptr,
6615 );
6616}
6617
6618pub type Z3_fixedpoint_new_lemma_eh = ::core::option::Option<
6619 unsafe extern "C" fn(
6620 state: *mut ::core::ffi::c_void,
6621 lemma: Z3_ast,
6622 level: ::core::ffi::c_uint,
6623 ),
6624>;
6625pub type Z3_fixedpoint_predecessor_eh =
6626 ::core::option::Option<unsafe extern "C" fn(state: *mut ::core::ffi::c_void)>;
6627pub type Z3_fixedpoint_unfold_eh =
6628 ::core::option::Option<unsafe extern "C" fn(state: *mut ::core::ffi::c_void)>;
6629
6630unsafe extern "C" {
6631 /// Set export callback for lemmas.
6632 pub fn Z3_fixedpoint_add_callback(
6633 ctx: Z3_context,
6634 f: Z3_fixedpoint,
6635 state: *mut ::core::ffi::c_void,
6636 new_lemma_eh: Z3_fixedpoint_new_lemma_eh,
6637 predecessor_eh: Z3_fixedpoint_predecessor_eh,
6638 unfold_eh: Z3_fixedpoint_unfold_eh,
6639 );
6640
6641 pub fn Z3_fixedpoint_add_constraint(
6642 c: Z3_context,
6643 d: Z3_fixedpoint,
6644 e: Z3_ast,
6645 lvl: ::core::ffi::c_uint,
6646 );
6647
6648 /// Create a new optimize context.
6649 ///
6650 /// NOTE: User must use [`Z3_optimize_inc_ref`]
6651 /// and [`Z3_optimize_dec_ref`] to manage optimize objects,
6652 /// even if the context was created using [`Z3_mk_context`]
6653 /// instead of [`Z3_mk_context_rc`].
6654 pub fn Z3_mk_optimize(c: Z3_context) -> Option<Z3_optimize>;
6655
6656 /// Increment the reference counter of the given optimize context
6657 pub fn Z3_optimize_inc_ref(c: Z3_context, d: Z3_optimize);
6658
6659 /// Decrement the reference counter of the given optimize context.
6660 pub fn Z3_optimize_dec_ref(c: Z3_context, d: Z3_optimize);
6661
6662 /// Assert hard constraint to the optimization context.
6663 ///
6664 /// # See also:
6665 ///
6666 /// - [`Z3_optimize_assert_and_track`]
6667 /// - [`Z3_optimize_assert_soft`]
6668 pub fn Z3_optimize_assert(c: Z3_context, o: Z3_optimize, a: Z3_ast);
6669
6670 /// Assert tracked hard constraint to the optimization context.
6671 ///
6672 /// # See also:
6673 ///
6674 /// - [`Z3_optimize_assert`]
6675 /// - [`Z3_optimize_assert_soft`]
6676 pub fn Z3_optimize_assert_and_track(c: Z3_context, o: Z3_optimize, a: Z3_ast, t: Z3_ast);
6677
6678 /// Assert soft constraint to the optimization context.
6679 /// - `c`: - context
6680 /// - `o`: - optimization context
6681 /// - `a`: - formula
6682 /// - `weight`: - a positive weight, penalty for violating soft constraint
6683 /// - `id`: - optional identifier to group soft constraints
6684 ///
6685 /// # See also:
6686 ///
6687 /// - [`Z3_optimize_assert`]
6688 /// - [`Z3_optimize_assert_and_track`]
6689 pub fn Z3_optimize_assert_soft(
6690 c: Z3_context,
6691 o: Z3_optimize,
6692 a: Z3_ast,
6693 weight: Z3_string,
6694 id: Option<Z3_symbol>,
6695 ) -> ::core::ffi::c_uint;
6696
6697 /// Add a maximization constraint.
6698 /// - `c`: - context
6699 /// - `o`: - optimization context
6700 /// - `t`: - arithmetical term
6701 ///
6702 /// # See also:
6703 ///
6704 /// - [`Z3_optimize_minimize`]
6705 pub fn Z3_optimize_maximize(c: Z3_context, o: Z3_optimize, t: Z3_ast) -> ::core::ffi::c_uint;
6706
6707 /// Add a minimization constraint.
6708 /// - `c`: - context
6709 /// - `o`: - optimization context
6710 /// - `t`: - arithmetical term
6711 ///
6712 /// # See also:
6713 ///
6714 /// - [`Z3_optimize_maximize`]
6715 pub fn Z3_optimize_minimize(c: Z3_context, o: Z3_optimize, t: Z3_ast) -> ::core::ffi::c_uint;
6716
6717 /// Create a backtracking point.
6718 ///
6719 /// The optimize solver contains a set of rules, added facts and assertions.
6720 /// The set of rules, facts and assertions are restored upon calling [`Z3_optimize_pop`].
6721 ///
6722 /// # See also:
6723 ///
6724 /// - [`Z3_optimize_pop`]
6725 pub fn Z3_optimize_push(c: Z3_context, d: Z3_optimize);
6726
6727 /// Backtrack one level.
6728 ///
6729 /// # Preconditions:
6730 ///
6731 /// - The number of calls to pop cannot exceed calls to push.
6732 ///
6733 /// # See also:
6734 ///
6735 /// - [`Z3_optimize_push`]
6736 pub fn Z3_optimize_pop(c: Z3_context, d: Z3_optimize);
6737
6738 /// Check consistency and produce optimal values.
6739 ///
6740 /// - `c`: - context
6741 /// - `o`: - optimization context
6742 /// - `num_assumptions`: - number of additional assumptions
6743 /// - `assumptions`: - the additional assumptions
6744 ///
6745 /// # See also:
6746 ///
6747 /// - [`Z3_optimize_get_reason_unknown`]
6748 /// - [`Z3_optimize_get_model`]
6749 /// - [`Z3_optimize_get_statistics`]
6750 /// - [`Z3_optimize_get_unsat_core`]
6751 pub fn Z3_optimize_check(
6752 c: Z3_context,
6753 o: Z3_optimize,
6754 num_assumptions: ::core::ffi::c_uint,
6755 assumptions: *const Z3_ast,
6756 ) -> Z3_lbool;
6757
6758 /// Retrieve a string that describes the last status returned by [`Z3_optimize_check`].
6759 ///
6760 /// Use this method when [`Z3_optimize_check`] returns `Z3_L_UNDEF`.
6761 pub fn Z3_optimize_get_reason_unknown(c: Z3_context, d: Z3_optimize) -> Z3_string;
6762
6763 /// Retrieve the model for the last [`Z3_optimize_check`].
6764 ///
6765 /// The error handler is invoked if a model is not available because
6766 /// the commands above were not invoked for the given optimization
6767 /// solver, or if the result was `Z3_L_FALSE`.
6768 pub fn Z3_optimize_get_model(c: Z3_context, o: Z3_optimize) -> Option<Z3_model>;
6769
6770 /// Retrieve the unsat core for the last [`Z3_optimize_check`].
6771 ///
6772 /// The unsat core is a subset of the assumptions `a`.
6773 pub fn Z3_optimize_get_unsat_core(c: Z3_context, o: Z3_optimize) -> Option<Z3_ast_vector>;
6774
6775 /// Set parameters on optimization context.
6776 ///
6777 /// - `c`: - context
6778 /// - `o`: - optimization context
6779 /// - `p`: - parameters
6780 ///
6781 /// # See also:
6782 ///
6783 /// - [`Z3_optimize_get_help`]
6784 /// - [`Z3_optimize_get_param_descrs`]
6785 pub fn Z3_optimize_set_params(c: Z3_context, o: Z3_optimize, p: Z3_params);
6786
6787 /// Return the parameter description set for the given optimize object.
6788 ///
6789 /// - `c`: - context
6790 /// - `o`: - optimization context
6791 ///
6792 /// # See also:
6793 ///
6794 /// - [`Z3_optimize_get_help`]
6795 /// - [`Z3_optimize_set_params`]
6796 pub fn Z3_optimize_get_param_descrs(c: Z3_context, o: Z3_optimize) -> Option<Z3_param_descrs>;
6797
6798 /// Retrieve lower bound value or approximation for the i'th optimization objective.
6799 ///
6800 /// - `c`: - context
6801 /// - `o`: - optimization context
6802 /// - `idx`: - index of optimization objective
6803 ///
6804 /// # See also:
6805 ///
6806 /// - [`Z3_optimize_get_upper`]
6807 /// - [`Z3_optimize_get_lower_as_vector`]
6808 /// - [`Z3_optimize_get_upper_as_vector`]
6809 pub fn Z3_optimize_get_lower(
6810 c: Z3_context,
6811 o: Z3_optimize,
6812 idx: ::core::ffi::c_uint,
6813 ) -> Option<Z3_ast>;
6814
6815 /// Retrieve upper bound value or approximation for the i'th optimization objective.
6816 ///
6817 /// - `c`: - context
6818 /// - `o`: - optimization context
6819 /// - `idx`: - index of optimization objective
6820 ///
6821 /// # See also:
6822 ///
6823 /// - [`Z3_optimize_get_lower`]
6824 /// - [`Z3_optimize_get_lower_as_vector`]
6825 /// - [`Z3_optimize_get_upper_as_vector`]
6826 pub fn Z3_optimize_get_upper(
6827 c: Z3_context,
6828 o: Z3_optimize,
6829 idx: ::core::ffi::c_uint,
6830 ) -> Option<Z3_ast>;
6831
6832 /// Retrieve lower bound value or approximation for the i'th optimization objective.
6833 /// The returned vector is of length 3. It always contains numerals.
6834 /// The three numerals are coefficients a, b, c and encode the result of [`Z3_optimize_get_lower`]
6835 /// a * infinity + b + c * epsilon.
6836 ///
6837 /// - `c`: - context
6838 /// - `o`: - optimization context
6839 /// - `idx`: - index of optimization objective
6840 ///
6841 /// # See also:
6842 ///
6843 /// - [`Z3_optimize_get_lower`]
6844 /// - [`Z3_optimize_get_upper`]
6845 /// - [`Z3_optimize_get_upper_as_vector`]
6846 pub fn Z3_optimize_get_lower_as_vector(
6847 c: Z3_context,
6848 o: Z3_optimize,
6849 idx: ::core::ffi::c_uint,
6850 ) -> Option<Z3_ast_vector>;
6851
6852 /// Retrieve upper bound value or approximation for the i'th optimization objective.
6853 ///
6854 /// - `c`: - context
6855 /// - `o`: - optimization context
6856 /// - `idx`: - index of optimization objective
6857 ///
6858 /// # See also:
6859 ///
6860 /// - [`Z3_optimize_get_lower`]
6861 /// - [`Z3_optimize_get_upper`]
6862 /// - [`Z3_optimize_get_lower_as_vector`]
6863 pub fn Z3_optimize_get_upper_as_vector(
6864 c: Z3_context,
6865 o: Z3_optimize,
6866 idx: ::core::ffi::c_uint,
6867 ) -> Option<Z3_ast_vector>;
6868
6869 /// Print the current context as a string.
6870 /// - `c`: - context.
6871 /// - `o`: - optimization context.
6872 ///
6873 /// # See also:
6874 ///
6875 /// - [`Z3_optimize_from_file`]
6876 /// - [`Z3_optimize_from_string`]
6877 pub fn Z3_optimize_to_string(c: Z3_context, o: Z3_optimize) -> Z3_string;
6878
6879 /// Parse an SMT-LIB2 string with assertions,
6880 /// soft constraints and optimization objectives.
6881 /// Add the parsed constraints and objectives to the optimization context.
6882 ///
6883 /// - `c`: - context.
6884 /// - `o`: - optimize context.
6885 /// - `s`: - string containing SMT2 specification.
6886 ///
6887 /// # See also:
6888 ///
6889 /// - [`Z3_optimize_from_file`]
6890 /// - [`Z3_optimize_to_string`]
6891 pub fn Z3_optimize_from_string(c: Z3_context, o: Z3_optimize, s: Z3_string);
6892
6893 /// Parse an SMT-LIB2 file with assertions,
6894 /// soft constraints and optimization objectives.
6895 /// Add the parsed constraints and objectives to the optimization context.
6896 ///
6897 /// - `c`: - context.
6898 /// - `o`: - optimize context.
6899 /// - `s`: - string containing SMT2 specification.
6900 ///
6901 /// # See also:
6902 ///
6903 /// - [`Z3_optimize_from_string`]
6904 /// - [`Z3_optimize_to_string`]
6905 pub fn Z3_optimize_from_file(c: Z3_context, o: Z3_optimize, s: Z3_string);
6906
6907 /// Return a string containing a description of parameters accepted by optimize.
6908 ///
6909 /// # See also:
6910 ///
6911 /// - [`Z3_optimize_get_param_descrs`]
6912 /// - [`Z3_optimize_set_params`]
6913 pub fn Z3_optimize_get_help(c: Z3_context, t: Z3_optimize) -> Z3_string;
6914
6915 /// Retrieve statistics information from the last call to [`Z3_optimize_check`]
6916 pub fn Z3_optimize_get_statistics(c: Z3_context, d: Z3_optimize) -> Option<Z3_stats>;
6917
6918 /// Return the set of asserted formulas on the optimization context.
6919 pub fn Z3_optimize_get_assertions(c: Z3_context, o: Z3_optimize) -> Option<Z3_ast_vector>;
6920
6921 /// Return objectives on the optimization context.
6922 /// If the objective function is a max-sat objective it is returned
6923 /// as a Pseudo-Boolean (minimization) sum of the form (+ (if f1 w1 0) (if f2 w2 0) ...)
6924 /// If the objective function is entered as a maximization objective, then return
6925 /// the corresponding minimization objective. In this way the resulting objective
6926 /// function is always returned as a minimization objective.
6927 pub fn Z3_optimize_get_objectives(c: Z3_context, o: Z3_optimize) -> Option<Z3_ast_vector>;
6928
6929 /// Create the `RoundingMode` sort.
6930 ///
6931 /// - `c`: logical context
6932 ///
6933 /// # See also:
6934 ///
6935 /// - [`Z3_mk_fpa_rounding_mode_sort`]
6936 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`] or [`Z3_mk_fpa_rna`]
6937 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`] or [`Z3_mk_fpa_rne`]
6938 /// - [`Z3_mk_fpa_round_toward_negative`] or [`Z3_mk_fpa_rtn`]
6939 /// - [`Z3_mk_fpa_round_toward_positive`] or [`Z3_mk_fpa_rtp`]
6940 /// - [`Z3_mk_fpa_round_toward_zero`] or [`Z3_mk_fpa_rtz`]
6941 pub fn Z3_mk_fpa_rounding_mode_sort(c: Z3_context) -> Option<Z3_sort>;
6942
6943 /// Create a numeral of `RoundingMode` sort which represents the `NearestTiesToEven` rounding mode.
6944 ///
6945 /// This is the same as [`Z3_mk_fpa_rne`].
6946 ///
6947 /// - `c`: logical context
6948 ///
6949 /// # See also:
6950 ///
6951 /// - [`Z3_mk_fpa_rounding_mode_sort`]
6952 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
6953 /// - [`Z3_mk_fpa_round_toward_negative`]
6954 /// - [`Z3_mk_fpa_round_toward_positive`]
6955 /// - [`Z3_mk_fpa_round_toward_zero`]
6956 pub fn Z3_mk_fpa_round_nearest_ties_to_even(c: Z3_context) -> Option<Z3_ast>;
6957
6958 /// Create a numeral of `RoundingMode` sort which represents the `NearestTiesToEven` rounding mode.
6959 ///
6960 /// This is the same as [`Z3_mk_fpa_round_nearest_ties_to_even`].
6961 ///
6962 /// - `c`: logical context
6963 ///
6964 /// # See also:
6965 ///
6966 /// - [`Z3_mk_fpa_rounding_mode_sort`]
6967 /// - [`Z3_mk_fpa_rna`]
6968 /// - [`Z3_mk_fpa_rtn`]
6969 /// - [`Z3_mk_fpa_rtp`]
6970 /// - [`Z3_mk_fpa_rtz`]
6971 pub fn Z3_mk_fpa_rne(c: Z3_context) -> Option<Z3_ast>;
6972
6973 /// Create a numeral of `RoundingMode` sort which represents the `NearestTiesToAway` rounding mode.
6974 ///
6975 /// This is the same as [`Z3_mk_fpa_rna`].
6976 ///
6977 /// - `c`: logical context
6978 ///
6979 /// # See also:
6980 ///
6981 /// - [`Z3_mk_fpa_rounding_mode_sort`]
6982 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
6983 /// - [`Z3_mk_fpa_round_toward_negative`]
6984 /// - [`Z3_mk_fpa_round_toward_positive`]
6985 /// - [`Z3_mk_fpa_round_toward_zero`]
6986 pub fn Z3_mk_fpa_round_nearest_ties_to_away(c: Z3_context) -> Option<Z3_ast>;
6987
6988 /// Create a numeral of `RoundingMode` sort which represents the `NearestTiesToAway` rounding mode.
6989 ///
6990 /// This is the same as [`Z3_mk_fpa_round_nearest_ties_to_away`].
6991 ///
6992 /// - `c`: logical context
6993 ///
6994 /// # See also:
6995 ///
6996 /// - [`Z3_mk_fpa_rounding_mode_sort`]
6997 /// - [`Z3_mk_fpa_rne`]
6998 /// - [`Z3_mk_fpa_rtn`]
6999 /// - [`Z3_mk_fpa_rtp`]
7000 /// - [`Z3_mk_fpa_rtz`]
7001 pub fn Z3_mk_fpa_rna(c: Z3_context) -> Option<Z3_ast>;
7002
7003 /// Create a numeral of `RoundingMode` sort which represents the `TowardPositive` rounding mode.
7004 ///
7005 /// This is the same as [`Z3_mk_fpa_rtp`].
7006 ///
7007 /// - `c`: logical context
7008 ///
7009 /// # See also:
7010 ///
7011 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7012 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
7013 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
7014 /// - [`Z3_mk_fpa_round_toward_negative`]
7015 /// - [`Z3_mk_fpa_round_toward_zero`]
7016 pub fn Z3_mk_fpa_round_toward_positive(c: Z3_context) -> Option<Z3_ast>;
7017
7018 /// Create a numeral of `RoundingMode` sort which represents the `TowardPositive` rounding mode.
7019 ///
7020 /// This is the same as [`Z3_mk_fpa_round_toward_positive`].
7021 ///
7022 /// - `c`: logical context
7023 ///
7024 /// # See also:
7025 ///
7026 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7027 /// - [`Z3_mk_fpa_rna`]
7028 /// - [`Z3_mk_fpa_rne`]
7029 /// - [`Z3_mk_fpa_rtn`]
7030 /// - [`Z3_mk_fpa_rtz`]
7031 pub fn Z3_mk_fpa_rtp(c: Z3_context) -> Option<Z3_ast>;
7032
7033 /// Create a numeral of `RoundingMode` sort which represents the `TowardNegative` rounding mode.
7034 ///
7035 /// This is the same as [`Z3_mk_fpa_rtn`].
7036 ///
7037 /// - `c`: logical context
7038 ///
7039 /// # See also:
7040 ///
7041 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7042 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
7043 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
7044 /// - [`Z3_mk_fpa_round_toward_positive`]
7045 /// - [`Z3_mk_fpa_round_toward_zero`]
7046 pub fn Z3_mk_fpa_round_toward_negative(c: Z3_context) -> Option<Z3_ast>;
7047
7048 /// Create a numeral of `RoundingMode` sort which represents the `TowardNegative` rounding mode.
7049 ///
7050 /// This is the same as [`Z3_mk_fpa_round_toward_negative`].
7051 ///
7052 /// - `c`: logical context
7053 ///
7054 /// # See also:
7055 ///
7056 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7057 /// - [`Z3_mk_fpa_rna`]
7058 /// - [`Z3_mk_fpa_rne`]
7059 /// - [`Z3_mk_fpa_rtp`]
7060 /// - [`Z3_mk_fpa_rtz`]
7061 pub fn Z3_mk_fpa_rtn(c: Z3_context) -> Option<Z3_ast>;
7062
7063 /// Create a numeral of `RoundingMode` sort which represents the `TowardZero` rounding mode.
7064 ///
7065 /// This is the same as [`Z3_mk_fpa_rtz`].
7066 ///
7067 /// - `c`: logical context
7068 ///
7069 /// # See also:
7070 ///
7071 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7072 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
7073 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
7074 /// - [`Z3_mk_fpa_round_toward_negative`]
7075 /// - [`Z3_mk_fpa_round_toward_positive`]
7076 pub fn Z3_mk_fpa_round_toward_zero(c: Z3_context) -> Option<Z3_ast>;
7077
7078 /// Create a numeral of `RoundingMode` sort which represents the `TowardZero` rounding mode.
7079 ///
7080 /// This is the same as [`Z3_mk_fpa_round_toward_zero`].
7081 ///
7082 /// - `c`: logical context
7083 ///
7084 /// # See also:
7085 ///
7086 /// - [`Z3_mk_fpa_rounding_mode_sort`]
7087 /// - [`Z3_mk_fpa_rna`]
7088 /// - [`Z3_mk_fpa_rne`]
7089 /// - [`Z3_mk_fpa_rtn`]
7090 /// - [`Z3_mk_fpa_rtp`]
7091 pub fn Z3_mk_fpa_rtz(c: Z3_context) -> Option<Z3_ast>;
7092
7093 /// Create a `FloatingPoint` sort.
7094 ///
7095 /// - `c`: logical context
7096 /// - `ebits`: number of exponent bits
7097 /// - `sbits`: number of significand bits
7098 ///
7099 /// NOTE: ebits must be larger than 1 and sbits must be larger than 2.
7100 ///
7101 /// # See also:
7102 ///
7103 /// - [`Z3_mk_fpa_sort_half`] or [`Z3_mk_fpa_sort_16`]
7104 /// - [`Z3_mk_fpa_sort_single`] or [`Z3_mk_fpa_sort_32`]
7105 /// - [`Z3_mk_fpa_sort_double`] or [`Z3_mk_fpa_sort_64`]
7106 /// - [`Z3_mk_fpa_sort_quadruple`] or [`Z3_mk_fpa_sort_128`]
7107 pub fn Z3_mk_fpa_sort(
7108 c: Z3_context,
7109 ebits: ::core::ffi::c_uint,
7110 sbits: ::core::ffi::c_uint,
7111 ) -> Option<Z3_sort>;
7112
7113 /// Create the half-precision (16-bit) `FloatingPoint` sort.
7114 ///
7115 /// This is the same as [`Z3_mk_fpa_sort_16`].
7116 ///
7117 /// - `c`: logical context
7118 ///
7119 /// # See also:
7120 ///
7121 /// - [`Z3_mk_fpa_sort_single`]
7122 /// - [`Z3_mk_fpa_sort_double`]
7123 /// - [`Z3_mk_fpa_sort_quadruple`]
7124 pub fn Z3_mk_fpa_sort_half(c: Z3_context) -> Option<Z3_sort>;
7125
7126 /// Create the half-precision (16-bit) `FloatingPoint` sort.
7127 ///
7128 /// This is the same as [`Z3_mk_fpa_sort_half`].
7129 ///
7130 /// - `c`: logical context
7131 ///
7132 /// # See also:
7133 ///
7134 /// - [`Z3_mk_fpa_sort_32`]
7135 /// - [`Z3_mk_fpa_sort_64`]
7136 /// - [`Z3_mk_fpa_sort_128`]
7137 pub fn Z3_mk_fpa_sort_16(c: Z3_context) -> Option<Z3_sort>;
7138
7139 /// Create the single-precision (32-bit) `FloatingPoint` sort.
7140 ///
7141 /// This is the same as [`Z3_mk_fpa_sort_32`].
7142 ///
7143 /// - `c`: logical context.
7144 ///
7145 /// # See also:
7146 ///
7147 /// - [`Z3_mk_fpa_sort_half`]
7148 /// - [`Z3_mk_fpa_sort_double`]
7149 /// - [`Z3_mk_fpa_sort_quadruple`]
7150 pub fn Z3_mk_fpa_sort_single(c: Z3_context) -> Option<Z3_sort>;
7151
7152 /// Create the single-precision (32-bit) `FloatingPoint` sort.
7153 ///
7154 /// This is the same as [`Z3_mk_fpa_sort_single`].
7155 ///
7156 /// - `c`: logical context
7157 ///
7158 /// # See also:
7159 ///
7160 /// - [`Z3_mk_fpa_sort_16`]
7161 /// - [`Z3_mk_fpa_sort_64`]
7162 /// - [`Z3_mk_fpa_sort_128`]
7163 pub fn Z3_mk_fpa_sort_32(c: Z3_context) -> Option<Z3_sort>;
7164
7165 /// Create the double-precision (64-bit) `FloatingPoint` sort.
7166 ///
7167 /// This is the same as [`Z3_mk_fpa_sort_64`].
7168 ///
7169 /// - `c`: logical context
7170 ///
7171 /// # See also:
7172 ///
7173 /// - [`Z3_mk_fpa_sort_half`]
7174 /// - [`Z3_mk_fpa_sort_single`]
7175 /// - [`Z3_mk_fpa_sort_quadruple`]
7176 pub fn Z3_mk_fpa_sort_double(c: Z3_context) -> Option<Z3_sort>;
7177
7178 /// Create the double-precision (64-bit) `FloatingPoint` sort.
7179 ///
7180 /// This is the same as [`Z3_mk_fpa_sort_double`].
7181 ///
7182 /// - `c`: logical context
7183 ///
7184 /// # See also:
7185 ///
7186 /// - [`Z3_mk_fpa_sort_16`]
7187 /// - [`Z3_mk_fpa_sort_32`]
7188 /// - [`Z3_mk_fpa_sort_128`]
7189 pub fn Z3_mk_fpa_sort_64(c: Z3_context) -> Option<Z3_sort>;
7190
7191 /// Create the quadruple-precision (128-bit) `FloatingPoint` sort.
7192 ///
7193 /// This is the same as [`Z3_mk_fpa_sort_128`].
7194 ///
7195 /// - `c`: logical context
7196 ///
7197 /// # See also:
7198 ///
7199 /// - [`Z3_mk_fpa_sort_half`]
7200 /// - [`Z3_mk_fpa_sort_single`]
7201 /// - [`Z3_mk_fpa_sort_double`]
7202 pub fn Z3_mk_fpa_sort_quadruple(c: Z3_context) -> Option<Z3_sort>;
7203
7204 /// Create the quadruple-precision (128-bit) `FloatingPoint` sort.
7205 ///
7206 /// This is the same as [`Z3_mk_fpa_sort_quadruple`].
7207 ///
7208 /// - `c`: logical context
7209 ///
7210 /// # See also:
7211 ///
7212 /// - [`Z3_mk_fpa_sort_16`]
7213 /// - [`Z3_mk_fpa_sort_32`]
7214 /// - [`Z3_mk_fpa_sort_64`]
7215 pub fn Z3_mk_fpa_sort_128(c: Z3_context) -> Option<Z3_sort>;
7216
7217 /// Create a floating-point NaN of sort `s`.
7218 ///
7219 /// - `c`: logical context
7220 /// - `s`: target sort
7221 ///
7222 /// # See also:
7223 ///
7224 /// - [`Z3_mk_fpa_inf`]
7225 /// - [`Z3_mk_fpa_is_nan`]
7226 /// - [`Z3_mk_fpa_zero`]
7227 pub fn Z3_mk_fpa_nan(c: Z3_context, s: Z3_sort) -> Option<Z3_ast>;
7228
7229 /// Create a floating-point infinity of sort `s`.
7230 ///
7231 /// - `c`: logical context
7232 /// - `s`: target sort
7233 /// - `negative`: indicates whether the result should be negative
7234 ///
7235 /// When `negative` is true, -oo will be generated instead of +oo.
7236 ///
7237 /// # See also:
7238 ///
7239 /// - [`Z3_mk_fpa_is_infinite`]
7240 /// - [`Z3_mk_fpa_nan`]
7241 /// - [`Z3_mk_fpa_zero`]
7242 pub fn Z3_mk_fpa_inf(c: Z3_context, s: Z3_sort, negative: bool) -> Option<Z3_ast>;
7243
7244 /// Create a floating-point zero of sort `s`.
7245 ///
7246 /// - `c`: logical context
7247 /// - `s`: target sort
7248 /// - `negative`: indicates whether the result should be negative
7249 ///
7250 /// When `negative` is true, -zero will be generated instead of +zero.
7251 ///
7252 /// # See also:
7253 ///
7254 /// - [`Z3_mk_fpa_inf`]
7255 /// - [`Z3_mk_fpa_is_zero`]
7256 /// - [`Z3_mk_fpa_nan`]
7257 pub fn Z3_mk_fpa_zero(c: Z3_context, s: Z3_sort, negative: bool) -> Option<Z3_ast>;
7258
7259 /// Create an expression of `FloatingPoint` sort from three bit-vector expressions.
7260 ///
7261 /// This is the operator named `fp` in the SMT FP theory definition.
7262 /// Note that `sign` is required to be a bit-vector of size 1. Significand and exponent
7263 /// are required to be longer than 1 and 2 respectively. The `FloatingPoint` sort
7264 /// of the resulting expression is automatically determined from the bit-vector sizes
7265 /// of the arguments. The exponent is assumed to be in IEEE-754 biased representation.
7266 ///
7267 /// - `c`: logical context
7268 /// - `sgn`: sign
7269 /// - `exp`: exponent
7270 /// - `sig`: significand
7271 ///
7272 /// # See also:
7273 ///
7274 /// - [`Z3_mk_fpa_numeral_double`]
7275 /// - [`Z3_mk_fpa_numeral_float`]
7276 /// - [`Z3_mk_fpa_numeral_int`]
7277 /// - [`Z3_mk_fpa_numeral_int_uint`]
7278 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
7279 /// - [`Z3_mk_numeral`]
7280 pub fn Z3_mk_fpa_fp(c: Z3_context, sgn: Z3_ast, exp: Z3_ast, sig: Z3_ast) -> Option<Z3_ast>;
7281
7282 /// Create a numeral of `FloatingPoint` sort from a float.
7283 ///
7284 /// This function is used to create numerals that fit in a float value.
7285 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
7286 ///
7287 /// - `c`: logical context
7288 /// - `v`: value
7289 /// - `ty`: sort
7290 ///
7291 /// `ty` must be a `FloatingPoint` sort
7292 ///
7293 /// # See also:
7294 ///
7295 /// - [`Z3_mk_fpa_fp`]
7296 /// - [`Z3_mk_fpa_numeral_double`]
7297 /// - [`Z3_mk_fpa_numeral_int`]
7298 /// - [`Z3_mk_fpa_numeral_int_uint`]
7299 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
7300 /// - [`Z3_mk_numeral`]
7301 pub fn Z3_mk_fpa_numeral_float(c: Z3_context, v: f32, ty: Z3_sort) -> Option<Z3_ast>;
7302
7303 /// Create a numeral of `FloatingPoint` sort from a double.
7304 ///
7305 /// This function is used to create numerals that fit in a double value.
7306 /// It is slightly faster than [`Z3_mk_numeral`]
7307 ///
7308 /// - `c`: logical context
7309 /// - `v`: value
7310 /// - `ty`: sort
7311 ///
7312 /// `ty` must be a `FloatingPoint` sort
7313 ///
7314 /// # See also:
7315 ///
7316 /// - [`Z3_mk_fpa_fp`]
7317 /// - [`Z3_mk_fpa_numeral_float`]
7318 /// - [`Z3_mk_fpa_numeral_int`]
7319 /// - [`Z3_mk_fpa_numeral_int_uint`]
7320 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
7321 /// - [`Z3_mk_numeral`]
7322 pub fn Z3_mk_fpa_numeral_double(c: Z3_context, v: f64, ty: Z3_sort) -> Option<Z3_ast>;
7323
7324 /// Create a numeral of `FloatingPoint` sort from a signed integer.
7325 ///
7326 /// - `c`: logical context
7327 /// - `v`: value
7328 /// - `ty`: result sort
7329 ///
7330 /// `ty` must be a `FloatingPoint` sort
7331 ///
7332 /// # See also:
7333 ///
7334 /// - [`Z3_mk_fpa_fp`]
7335 /// - [`Z3_mk_fpa_numeral_double`]
7336 /// - [`Z3_mk_fpa_numeral_float`]
7337 /// - [`Z3_mk_fpa_numeral_int_uint`]
7338 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
7339 /// - [`Z3_mk_numeral`]
7340 pub fn Z3_mk_fpa_numeral_int(
7341 c: Z3_context,
7342 v: ::core::ffi::c_int,
7343 ty: Z3_sort,
7344 ) -> Option<Z3_ast>;
7345
7346 /// Create a numeral of `FloatingPoint` sort from a sign bit and two integers.
7347 ///
7348 /// - `c`: logical context
7349 /// - `sgn`: sign bit (true == negative)
7350 /// - `sig`: significand
7351 /// - `exp`: exponent
7352 /// - `ty`: result sort
7353 ///
7354 /// `ty` must be a `FloatingPoint` sort
7355 ///
7356 /// # See also:
7357 ///
7358 /// - [`Z3_mk_fpa_fp`]
7359 /// - [`Z3_mk_fpa_numeral_double`]
7360 /// - [`Z3_mk_fpa_numeral_float`]
7361 /// - [`Z3_mk_fpa_numeral_int`]
7362 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
7363 /// - [`Z3_mk_numeral`]
7364 pub fn Z3_mk_fpa_numeral_int_uint(
7365 c: Z3_context,
7366 sgn: bool,
7367 exp: ::core::ffi::c_int,
7368 sig: ::core::ffi::c_uint,
7369 ty: Z3_sort,
7370 ) -> Option<Z3_ast>;
7371
7372 /// Create a numeral of `FloatingPoint` sort from a sign bit and two 64-bit integers.
7373 ///
7374 /// - `c`: logical context
7375 /// - `sgn`: sign bit (true == negative)
7376 /// - `sig`: significand
7377 /// - `exp`: exponent
7378 /// - `ty`: result sort
7379 ///
7380 /// `ty` must be a `FloatingPoint` sort
7381 ///
7382 /// # See also:
7383 ///
7384 /// - [`Z3_mk_fpa_fp`]
7385 /// - [`Z3_mk_fpa_numeral_double`]
7386 /// - [`Z3_mk_fpa_numeral_float`]
7387 /// - [`Z3_mk_fpa_numeral_int`]
7388 /// - [`Z3_mk_fpa_numeral_int_uint`]
7389 /// - [`Z3_mk_numeral`]
7390 pub fn Z3_mk_fpa_numeral_int64_uint64(
7391 c: Z3_context,
7392 sgn: bool,
7393 exp: i64,
7394 sig: u64,
7395 ty: Z3_sort,
7396 ) -> Option<Z3_ast>;
7397
7398 /// Floating-point absolute value
7399 ///
7400 /// - `c`: logical context
7401 /// - `t`: term of `FloatingPoint` sort
7402 ///
7403 /// # See also:
7404 ///
7405 /// - [`Z3_mk_fpa_is_negative`]
7406 /// - [`Z3_mk_fpa_is_positive`]
7407 /// - [`Z3_mk_fpa_neg`]
7408 pub fn Z3_mk_fpa_abs(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7409
7410 /// Floating-point negation
7411 ///
7412 /// - `c`: logical context
7413 /// - `t`: term of `FloatingPoint` sort
7414 ///
7415 /// # See also:
7416 ///
7417 /// - [`Z3_mk_fpa_abs`]
7418 /// - [`Z3_mk_fpa_is_negative`]
7419 /// - [`Z3_mk_fpa_is_positive`]
7420 pub fn Z3_mk_fpa_neg(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7421
7422 /// Floating-point addition
7423 ///
7424 /// - `c`: logical context
7425 /// - `rm`: term of `RoundingMode` sort
7426 /// - `t1`: term of `FloatingPoint` sort
7427 /// - `t2`: term of `FloatingPoint` sort
7428 ///
7429 /// `rm` must be of `RoundingMode` sort, `t1` and `t2` must have the same `FloatingPoint` sort.
7430 pub fn Z3_mk_fpa_add(c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7431
7432 /// Floating-point subtraction
7433 ///
7434 /// - `c`: logical context
7435 /// - `rm`: term of `RoundingMode` sort
7436 /// - `t1`: term of `FloatingPoint` sort
7437 /// - `t2`: term of `FloatingPoint` sort
7438 ///
7439 /// `rm` must be of `RoundingMode` sort, `t1` and `t2` must have the same `FloatingPoint` sort.
7440 pub fn Z3_mk_fpa_sub(c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7441
7442 /// Floating-point multiplication
7443 ///
7444 /// - `c`: logical context
7445 /// - `rm`: term of `RoundingMode` sort
7446 /// - `t1`: term of `FloatingPoint` sort
7447 /// - `t2`: term of `FloatingPoint` sort
7448 ///
7449 /// `rm` must be of `RoundingMode` sort, `t1` and `t2` must have the same `FloatingPoint` sort.
7450 pub fn Z3_mk_fpa_mul(c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7451
7452 /// Floating-point division
7453 ///
7454 /// - `c`: logical context
7455 /// - `rm`: term of `RoundingMode` sort
7456 /// - `t1`: term of `FloatingPoint` sort.
7457 /// - `t2`: term of `FloatingPoint` sort
7458 ///
7459 /// The nodes `rm` must be of `RoundingMode` sort, `t1` and `t2` must have the same `FloatingPoint` sort.
7460 pub fn Z3_mk_fpa_div(c: Z3_context, rm: Z3_ast, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7461
7462 /// Floating-point fused multiply-add.
7463 ///
7464 /// - `c`: logical context
7465 /// - `rm`: term of `RoundingMode` sort
7466 /// - `t1`: term of `FloatingPoint` sort
7467 /// - `t2`: term of `FloatingPoint` sort
7468 /// - `t3`: term of `FloatingPoint` sort
7469 ///
7470 /// The result is round((t1 * t2) + t3)
7471 ///
7472 /// `rm` must be of `RoundingMode` sort, `t1`, `t2`, and `t3` must have the same `FloatingPoint` sort.
7473 pub fn Z3_mk_fpa_fma(
7474 c: Z3_context,
7475 rm: Z3_ast,
7476 t1: Z3_ast,
7477 t2: Z3_ast,
7478 t3: Z3_ast,
7479 ) -> Option<Z3_ast>;
7480
7481 /// Floating-point square root
7482 ///
7483 /// - `c`: logical context
7484 /// - `rm`: term of `RoundingMode` sort
7485 /// - `t`: term of `FloatingPoint` sort
7486 ///
7487 /// `rm` must be of `RoundingMode` sort, `t` must have `FloatingPoint` sort.
7488 pub fn Z3_mk_fpa_sqrt(c: Z3_context, rm: Z3_ast, t: Z3_ast) -> Option<Z3_ast>;
7489
7490 /// Floating-point remainder
7491 ///
7492 /// - `c`: logical context
7493 /// - `t1`: term of `FloatingPoint` sort
7494 /// - `t2`: term of `FloatingPoint` sort
7495 ///
7496 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7497 pub fn Z3_mk_fpa_rem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7498
7499 /// Floating-point roundToIntegral. Rounds a floating-point number to
7500 /// the closest integer, again represented as a floating-point number.
7501 ///
7502 /// - `c`: logical context
7503 /// - `rm`: term of `RoundingMode` sort
7504 /// - `t`: term of `FloatingPoint` sort
7505 ///
7506 /// `t` must be of `FloatingPoint` sort.
7507 pub fn Z3_mk_fpa_round_to_integral(c: Z3_context, rm: Z3_ast, t: Z3_ast) -> Option<Z3_ast>;
7508
7509 /// Minimum of floating-point numbers.
7510 ///
7511 /// - `c`: logical context
7512 /// - `t1`: term of `FloatingPoint` sort
7513 /// - `t2`: term of `FloatingPoint` sort
7514 ///
7515 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7516 ///
7517 /// # See also:
7518 ///
7519 /// - [`Z3_mk_fpa_max`]
7520 pub fn Z3_mk_fpa_min(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7521
7522 /// Maximum of floating-point numbers.
7523 ///
7524 /// - `c`: logical context
7525 /// - `t1`: term of `FloatingPoint` sort
7526 /// - `t2`: term of `FloatingPoint` sort
7527 ///
7528 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7529 ///
7530 /// # See also:
7531 ///
7532 /// - [`Z3_mk_fpa_min`]
7533 pub fn Z3_mk_fpa_max(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7534
7535 /// Floating-point less than or equal.
7536 ///
7537 /// - `c`: logical context
7538 /// - `t1`: term of `FloatingPoint` sort
7539 /// - `t2`: term of `FloatingPoint` sort
7540 ///
7541 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7542 ///
7543 /// # See also:
7544 ///
7545 /// - [`Z3_mk_fpa_eq`]
7546 /// - [`Z3_mk_fpa_geq`]
7547 /// - [`Z3_mk_fpa_gt`]
7548 /// - [`Z3_mk_fpa_lt`]
7549 pub fn Z3_mk_fpa_leq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7550
7551 /// Floating-point less than.
7552 ///
7553 /// - `c`: logical context
7554 /// - `t1`: term of `FloatingPoint` sort
7555 /// - `t2`: term of `FloatingPoint` sort
7556 ///
7557 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7558 ///
7559 /// # See also:
7560 ///
7561 /// - [`Z3_mk_fpa_eq`]
7562 /// - [`Z3_mk_fpa_geq`]
7563 /// - [`Z3_mk_fpa_gt`]
7564 /// - [`Z3_mk_fpa_leq`]
7565 pub fn Z3_mk_fpa_lt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7566
7567 /// Floating-point greater than or equal.
7568 ///
7569 /// - `c`: logical context
7570 /// - `t1`: term of `FloatingPoint` sort
7571 /// - `t2`: term of `FloatingPoint` sort
7572 ///
7573 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7574 ///
7575 /// # See also:
7576 ///
7577 /// - [`Z3_mk_fpa_eq`]
7578 /// - [`Z3_mk_fpa_gt`]
7579 /// - [`Z3_mk_fpa_leq`]
7580 /// - [`Z3_mk_fpa_lt`]
7581 pub fn Z3_mk_fpa_geq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7582
7583 /// Floating-point greater than.
7584 ///
7585 /// - `c`: logical context
7586 /// - `t1`: term of `FloatingPoint` sort
7587 /// - `t2`: term of `FloatingPoint` sort
7588 ///
7589 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7590 ///
7591 /// # See also:
7592 ///
7593 /// - [`Z3_mk_fpa_eq`]
7594 /// - [`Z3_mk_fpa_geq`]
7595 /// - [`Z3_mk_fpa_leq`]
7596 /// - [`Z3_mk_fpa_lt`]
7597 pub fn Z3_mk_fpa_gt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7598
7599 /// Floating-point equality.
7600 ///
7601 /// - `c`: logical context
7602 /// - `t1`: term of `FloatingPoint` sort
7603 /// - `t2`: term of `FloatingPoint` sort
7604 ///
7605 /// Note that this is IEEE 754 equality (as opposed to SMT-LIB =).
7606 ///
7607 /// `t1` and `t2` must have the same `FloatingPoint` sort.
7608 ///
7609 /// # See also:
7610 ///
7611 /// - [`Z3_mk_fpa_geq`]
7612 /// - [`Z3_mk_fpa_gt`]
7613 /// - [`Z3_mk_fpa_leq`]
7614 /// - [`Z3_mk_fpa_lt`]
7615 pub fn Z3_mk_fpa_eq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
7616
7617 /// Predicate indicating whether `t` is a normal floating-point number.
7618 ///
7619 /// - `c`: logical context
7620 /// - `t`: term of `FloatingPoint` sort
7621 ///
7622 /// `t` must have `FloatingPoint` sort.
7623 ///
7624 /// # See also:
7625 ///
7626 /// - [`Z3_mk_fpa_is_infinite`]
7627 /// - [`Z3_mk_fpa_is_nan`]
7628 /// - [`Z3_mk_fpa_is_subnormal`]
7629 /// - [`Z3_mk_fpa_is_zero`]
7630 pub fn Z3_mk_fpa_is_normal(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7631
7632 /// Predicate indicating whether `t` is a subnormal floating-point number.
7633 ///
7634 /// - `c`: logical context
7635 /// - `t`: term of `FloatingPoint` sort
7636 ///
7637 /// `t` must have `FloatingPoint` sort.
7638 ///
7639 /// # See also:
7640 ///
7641 /// - [`Z3_mk_fpa_is_infinite`]
7642 /// - [`Z3_mk_fpa_is_nan`]
7643 /// - [`Z3_mk_fpa_is_normal`]
7644 /// - [`Z3_mk_fpa_is_zero`]
7645 pub fn Z3_mk_fpa_is_subnormal(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7646
7647 /// Predicate indicating whether `t` is a floating-point number with zero value, i.e., +zero or -zero.
7648 ///
7649 /// - `c`: logical context
7650 /// - `t`: term of `FloatingPoint` sort
7651 ///
7652 /// `t` must have `FloatingPoint` sort.
7653 ///
7654 /// # See also:
7655 ///
7656 /// - [`Z3_mk_fpa_is_infinite`]
7657 /// - [`Z3_mk_fpa_is_nan`]
7658 /// - [`Z3_mk_fpa_is_normal`]
7659 /// - [`Z3_mk_fpa_is_subnormal`]
7660 /// - [`Z3_mk_fpa_is_zero`]
7661 /// - [`Z3_mk_fpa_zero`]
7662 pub fn Z3_mk_fpa_is_zero(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7663
7664 /// Predicate indicating whether `t` is a floating-point number representing +oo or -oo.
7665 ///
7666 /// - `c`: logical context
7667 /// - `t`: term of `FloatingPoint` sort
7668 ///
7669 /// `t` must have `FloatingPoint` sort.
7670 ///
7671 /// # See also:
7672 ///
7673 /// - [`Z3_mk_fpa_inf`]
7674 /// - [`Z3_mk_fpa_is_infinite`]
7675 /// - [`Z3_mk_fpa_is_nan`]
7676 /// - [`Z3_mk_fpa_is_normal`]
7677 /// - [`Z3_mk_fpa_is_subnormal`]
7678 /// - [`Z3_mk_fpa_is_zero`]
7679 pub fn Z3_mk_fpa_is_infinite(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7680
7681 /// Predicate indicating whether `t` is a NaN.
7682 ///
7683 /// - `c`: logical context
7684 /// - `t`: term of `FloatingPoint` sort
7685 ///
7686 /// `t` must have `FloatingPoint` sort.
7687 ///
7688 /// # See also:
7689 ///
7690 /// - [`Z3_mk_fpa_is_infinite`]
7691 /// - [`Z3_mk_fpa_is_normal`]
7692 /// - [`Z3_mk_fpa_is_subnormal`]
7693 /// - [`Z3_mk_fpa_is_zero`]
7694 /// - [`Z3_mk_fpa_nan`]
7695 pub fn Z3_mk_fpa_is_nan(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7696
7697 /// Predicate indicating whether `t` is a negative floating-point number.
7698 ///
7699 /// - `c`: logical context
7700 /// - `t`: term of `FloatingPoint` sort
7701 ///
7702 /// `t` must have `FloatingPoint` sort.
7703 ///
7704 /// # See also:
7705 ///
7706 /// - [`Z3_mk_fpa_abs`]
7707 /// - [`Z3_mk_fpa_is_positive`]
7708 /// - [`Z3_mk_fpa_neg`]
7709 pub fn Z3_mk_fpa_is_negative(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7710
7711 /// Predicate indicating whether `t` is a positive floating-point number.
7712 ///
7713 /// - `c`: logical context
7714 /// - `t`: term of `FloatingPoint` sort
7715 ///
7716 /// `t` must have `FloatingPoint` sort.
7717 ///
7718 /// # See also:
7719 ///
7720 /// - [`Z3_mk_fpa_abs`]
7721 /// - [`Z3_mk_fpa_is_negative`]
7722 /// - [`Z3_mk_fpa_neg`]
7723 pub fn Z3_mk_fpa_is_positive(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7724
7725 /// Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
7726 ///
7727 /// Produces a term that represents the conversion of a bit-vector term `bv` to a
7728 /// floating-point term of sort `s`.
7729 ///
7730 /// - `c`: logical context
7731 /// - `bv`: a bit-vector term
7732 /// - `s`: floating-point sort
7733 ///
7734 /// `s` must be a `FloatingPoint` sort, `t` must be of bit-vector sort, and the bit-vector
7735 /// size of `bv` must be equal to ebits+sbits of `s`. The format of the bit-vector is
7736 /// as defined by the IEEE 754-2008 interchange format.
7737 pub fn Z3_mk_fpa_to_fp_bv(c: Z3_context, bv: Z3_ast, s: Z3_sort) -> Option<Z3_ast>;
7738
7739 /// Conversion of a `FloatingPoint` term into another term of different `FloatingPoint` sort.
7740 ///
7741 /// Produces a term that represents the conversion of a floating-point term `t` to a
7742 /// floating-point term of sort `s`. If necessary, the result will be rounded according
7743 /// to rounding mode `rm`.
7744 ///
7745 /// - `c`: logical context
7746 /// - `rm`: term of `RoundingMode` sort
7747 /// - `t`: term of `FloatingPoint` sort
7748 /// - `s`: floating-point sort
7749 ///
7750 /// `s` must be a `FloatingPoint` sort, `rm` must be of `RoundingMode` sort, `t` must be
7751 /// of floating-point sort.
7752 pub fn Z3_mk_fpa_to_fp_float(
7753 c: Z3_context,
7754 rm: Z3_ast,
7755 t: Z3_ast,
7756 s: Z3_sort,
7757 ) -> Option<Z3_ast>;
7758
7759 /// Conversion of a term of real sort into a term of `FloatingPoint` sort.
7760 ///
7761 /// Produces a term that represents the conversion of term `t` of real sort into a
7762 /// floating-point term of sort `s`. If necessary, the result will be rounded according
7763 /// to rounding mode `rm`.
7764 ///
7765 /// - `c`: logical context
7766 /// - `rm`: term of `RoundingMode` sort
7767 /// - `t`: term of Real sort
7768 /// - `s`: floating-point sort
7769 ///
7770 /// `s` must be a `FloatingPoint` sort, `rm` must be of `RoundingMode` sort, `t` must be of
7771 /// Real sort.
7772 pub fn Z3_mk_fpa_to_fp_real(c: Z3_context, rm: Z3_ast, t: Z3_ast, s: Z3_sort)
7773 -> Option<Z3_ast>;
7774
7775 /// Conversion of a 2's complement signed bit-vector term into a term of `FloatingPoint` sort.
7776 ///
7777 /// Produces a term that represents the conversion of the bit-vector term `t` into a
7778 /// floating-point term of sort `s`. The bit-vector `t` is taken to be in signed
7779 /// 2's complement format. If necessary, the result will be rounded according
7780 /// to rounding mode `rm`.
7781 ///
7782 /// - `c`: logical context
7783 /// - `rm`: term of `RoundingMode` sort
7784 /// - `t`: term of bit-vector sort
7785 /// - `s`: floating-point sort
7786 ///
7787 /// `s` must be a `FloatingPoint` sort, `rm` must be of `RoundingMode` sort, `t` must be
7788 /// of bit-vector sort.
7789 pub fn Z3_mk_fpa_to_fp_signed(
7790 c: Z3_context,
7791 rm: Z3_ast,
7792 t: Z3_ast,
7793 s: Z3_sort,
7794 ) -> Option<Z3_ast>;
7795
7796 /// Conversion of a 2's complement unsigned bit-vector term into a term of `FloatingPoint` sort.
7797 ///
7798 /// Produces a term that represents the conversion of the bit-vector term `t` into a
7799 /// floating-point term of sort `s`. The bit-vector `t` is taken to be in unsigned
7800 /// 2's complement format. If necessary, the result will be rounded according
7801 /// to rounding mode `rm`.
7802 ///
7803 /// - `c`: logical context
7804 /// - `rm`: term of `RoundingMode` sort
7805 /// - `t`: term of bit-vector sort
7806 /// - `s`: floating-point sort
7807 ///
7808 /// `s` must be a `FloatingPoint` sort, `rm` must be of `RoundingMode` sort, `t` must be
7809 /// of bit-vector sort.
7810 pub fn Z3_mk_fpa_to_fp_unsigned(
7811 c: Z3_context,
7812 rm: Z3_ast,
7813 t: Z3_ast,
7814 s: Z3_sort,
7815 ) -> Option<Z3_ast>;
7816
7817 /// Conversion of a floating-point term into an unsigned bit-vector.
7818 ///
7819 /// Produces a term that represents the conversion of the floating-point term `t` into a
7820 /// bit-vector term of size `sz` in unsigned 2's complement format. If necessary, the result
7821 /// will be rounded according to rounding mode `rm`.
7822 ///
7823 /// - `c`: logical context
7824 /// - `rm`: term of `RoundingMode` sort
7825 /// - `t`: term of `FloatingPoint` sort
7826 /// - `sz`: size of the resulting bit-vector
7827 pub fn Z3_mk_fpa_to_ubv(
7828 c: Z3_context,
7829 rm: Z3_ast,
7830 t: Z3_ast,
7831 sz: ::core::ffi::c_uint,
7832 ) -> Option<Z3_ast>;
7833
7834 /// Conversion of a floating-point term into a signed bit-vector.
7835 ///
7836 /// Produces a term that represents the conversion of the floating-point term `t` into a
7837 /// bit-vector term of size `sz` in signed 2's complement format. If necessary, the result
7838 /// will be rounded according to rounding mode `rm`.
7839 ///
7840 /// - `c`: logical context
7841 /// - `rm`: term of `RoundingMode` sort
7842 /// - `t`: term of `FloatingPoint` sort
7843 /// - `sz`: size of the resulting bit-vector
7844 pub fn Z3_mk_fpa_to_sbv(
7845 c: Z3_context,
7846 rm: Z3_ast,
7847 t: Z3_ast,
7848 sz: ::core::ffi::c_uint,
7849 ) -> Option<Z3_ast>;
7850
7851 /// Conversion of a floating-point term into a real-numbered term.
7852 ///
7853 /// Produces a term that represents the conversion of the floating-point term `t` into a
7854 /// real number. Note that this type of conversion will often result in non-linear
7855 /// constraints over real terms.
7856 ///
7857 /// - `c`: logical context
7858 /// - `t`: term of `FloatingPoint` sort
7859 pub fn Z3_mk_fpa_to_real(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7860
7861 /// Retrieves the number of bits reserved for the exponent in a `FloatingPoint` sort.
7862 ///
7863 /// - `c`: logical context
7864 /// - `s`: `FloatingPoint` sort
7865 ///
7866 /// # See also:
7867 ///
7868 /// - [`Z3_fpa_get_sbits`]
7869 pub fn Z3_fpa_get_ebits(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
7870
7871 /// Retrieves the number of bits reserved for the significand in a `FloatingPoint` sort.
7872 ///
7873 /// - `c`: logical context
7874 /// - `s`: `FloatingPoint` sort
7875 ///
7876 /// # See also:
7877 ///
7878 /// - [`Z3_fpa_get_ebits`]
7879 pub fn Z3_fpa_get_sbits(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
7880
7881 /// Checks whether a given floating-point numeral is a NaN.
7882 ///
7883 /// - `c`: logical context
7884 /// - `t`: a floating-point numeral
7885 ///
7886 /// # See also:
7887 ///
7888 /// - [`Z3_fpa_is_numeral_inf`]
7889 /// - [`Z3_fpa_is_numeral_normal`]
7890 /// - [`Z3_fpa_is_numeral_subnormal`]
7891 /// - [`Z3_fpa_is_numeral_zero`]
7892 pub fn Z3_fpa_is_numeral_nan(c: Z3_context, t: Z3_ast) -> bool;
7893
7894 /// Checks whether a given floating-point numeral is a +oo or -oo.
7895 ///
7896 /// - `c`: logical context
7897 /// - `t`: a floating-point numeral
7898 ///
7899 /// # See also:
7900 ///
7901 /// - [`Z3_fpa_is_numeral_nan`]
7902 /// - [`Z3_fpa_is_numeral_normal`]
7903 /// - [`Z3_fpa_is_numeral_subnormal`]
7904 /// - [`Z3_fpa_is_numeral_zero`]
7905 pub fn Z3_fpa_is_numeral_inf(c: Z3_context, t: Z3_ast) -> bool;
7906
7907 /// Checks whether a given floating-point numeral is +zero or -zero.
7908 ///
7909 /// - `c`: logical context
7910 /// - `t`: a floating-point numeral
7911 ///
7912 /// # See also:
7913 ///
7914 /// - [`Z3_fpa_is_numeral_inf`]
7915 /// - [`Z3_fpa_is_numeral_nan`]
7916 /// - [`Z3_fpa_is_numeral_normal`]
7917 /// - [`Z3_fpa_is_numeral_subnormal`]
7918 pub fn Z3_fpa_is_numeral_zero(c: Z3_context, t: Z3_ast) -> bool;
7919
7920 /// Checks whether a given floating-point numeral is normal.
7921 ///
7922 /// - `c`: logical context
7923 /// - `t`: a floating-point numeral
7924 ///
7925 /// # See also:
7926 ///
7927 /// - [`Z3_fpa_is_numeral_inf`]
7928 /// - [`Z3_fpa_is_numeral_nan`]
7929 /// - [`Z3_fpa_is_numeral_subnormal`]
7930 /// - [`Z3_fpa_is_numeral_zero`]
7931 pub fn Z3_fpa_is_numeral_normal(c: Z3_context, t: Z3_ast) -> bool;
7932
7933 /// Checks whether a given floating-point numeral is subnormal.
7934 ///
7935 /// - `c`: logical context
7936 /// - `t`: a floating-point numeral
7937 ///
7938 /// # See also:
7939 ///
7940 /// - [`Z3_fpa_is_numeral_inf`]
7941 /// - [`Z3_fpa_is_numeral_nan`]
7942 /// - [`Z3_fpa_is_numeral_normal`]
7943 /// - [`Z3_fpa_is_numeral_zero`]
7944 pub fn Z3_fpa_is_numeral_subnormal(c: Z3_context, t: Z3_ast) -> bool;
7945
7946 /// Checks whether a given floating-point numeral is positive.
7947 ///
7948 /// - `c`: logical context
7949 /// - `t`: a floating-point numeral
7950 ///
7951 /// # See also:
7952 ///
7953 /// - [`Z3_fpa_is_numeral_negative`]
7954 pub fn Z3_fpa_is_numeral_positive(c: Z3_context, t: Z3_ast) -> bool;
7955
7956 /// Checks whether a given floating-point numeral is negative.
7957 ///
7958 /// - `c`: logical context
7959 /// - `t`: a floating-point numeral
7960 ///
7961 /// # See also:
7962 ///
7963 /// - [`Z3_fpa_is_numeral_positive`]
7964 pub fn Z3_fpa_is_numeral_negative(c: Z3_context, t: Z3_ast) -> bool;
7965
7966 /// Retrieves the sign of a floating-point literal as a bit-vector expression.
7967 ///
7968 /// - `c`: logical context
7969 /// - `t`: a floating-point numeral
7970 ///
7971 /// Remarks: NaN is an invalid argument.
7972 pub fn Z3_fpa_get_numeral_sign_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7973
7974 /// Retrieves the significand of a floating-point literal as a bit-vector expression.
7975 ///
7976 /// - `c`: logical context
7977 /// - `t`: a floating-point numeral
7978 ///
7979 /// Remarks: NaN is an invalid argument.
7980 pub fn Z3_fpa_get_numeral_significand_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
7981
7982 /// Retrieves the sign of a floating-point literal.
7983 ///
7984 /// - `c`: logical context
7985 /// - `t`: a floating-point numeral
7986 /// - `sgn`: sign
7987 ///
7988 /// Remarks: sets `sgn` to 0 if `t` is positive and to 1 otherwise, except for
7989 /// NaN, which is an invalid argument.
7990 pub fn Z3_fpa_get_numeral_sign(c: Z3_context, t: Z3_ast, sgn: *mut ::core::ffi::c_int) -> bool;
7991
7992 /// Return the significand value of a floating-point numeral as a string.
7993 ///
7994 /// - `c`: logical context
7995 /// - `t`: a floating-point numeral
7996 ///
7997 /// Remarks: The significand `s` is always `0.0 <= s < 2.0`; the resulting string is
7998 /// long enough to represent the real significand precisely.
7999 pub fn Z3_fpa_get_numeral_significand_string(c: Z3_context, t: Z3_ast) -> Z3_string;
8000
8001 /// Return the significand value of a floating-point numeral as a uint64.
8002 ///
8003 /// - `c`: logical context
8004 /// - `t`: a floating-point numeral
8005 /// - `n`: pointer to output uint64
8006 ///
8007 /// Remarks: This function extracts the significand bits in `t`, without the
8008 /// hidden bit or normalization. Sets the `ErrorCode::InvalidArg` error code if the
8009 /// significand does not fit into a uint64. NaN is an invalid argument.
8010 pub fn Z3_fpa_get_numeral_significand_uint64(c: Z3_context, t: Z3_ast, n: *mut u64) -> bool;
8011
8012 /// Return the exponent value of a floating-point numeral as a string.
8013 ///
8014 /// - `c`: logical context
8015 /// - `t`: a floating-point numeral
8016 /// - `biased`: flag to indicate whether the result is in biased representation
8017 ///
8018 /// Remarks: This function extracts the exponent in `t`, without normalization.
8019 /// NaN is an invalid argument.
8020 pub fn Z3_fpa_get_numeral_exponent_string(c: Z3_context, t: Z3_ast, biased: bool) -> Z3_string;
8021
8022 /// Return the exponent value of a floating-point numeral as a signed 64-bit integer
8023 ///
8024 /// - `c`: logical context
8025 /// - `t`: a floating-point numeral
8026 /// - `n`: exponent
8027 /// - `biased`: flag to indicate whether the result is in biased representation
8028 ///
8029 /// Remarks: This function extracts the exponent in `t`, without normalization.
8030 /// NaN is an invalid argument.
8031 pub fn Z3_fpa_get_numeral_exponent_int64(
8032 c: Z3_context,
8033 t: Z3_ast,
8034 n: *mut i64,
8035 biased: bool,
8036 ) -> bool;
8037
8038 /// Retrieves the exponent of a floating-point literal as a bit-vector expression.
8039 ///
8040 /// - `c`: logical context
8041 /// - `t`: a floating-point numeral
8042 /// - `biased`: flag to indicate whether the result is in biased representation
8043 ///
8044 /// Remarks: This function extracts the exponent in `t`, without normalization.
8045 /// NaN is an invalid arguments.
8046 pub fn Z3_fpa_get_numeral_exponent_bv(c: Z3_context, t: Z3_ast, biased: bool)
8047 -> Option<Z3_ast>;
8048
8049 /// Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.
8050 ///
8051 /// - `c`: logical context
8052 /// - `t`: term of `FloatingPoint` sort
8053 ///
8054 /// `t` must have `FloatingPoint` sort. The size of the resulting bit-vector is automatically
8055 /// determined.
8056 ///
8057 /// Note that IEEE 754-2008 allows multiple different representations of NaN. This conversion
8058 /// knows only one NaN and it will always produce the same bit-vector representation of
8059 /// that NaN.
8060 pub fn Z3_mk_fpa_to_ieee_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
8061
8062 /// Conversion of a real-sorted significand and an integer-sorted exponent into a term of `FloatingPoint` sort.
8063 ///
8064 /// Produces a term that represents the conversion of `sig * 2^exp` into a
8065 /// floating-point term of sort `s`. If necessary, the result will be rounded
8066 /// according to rounding mode `rm`.
8067 ///
8068 /// - `c`: logical context
8069 /// - `rm`: term of `RoundingMode` sort
8070 /// - `exp`: exponent term of Int sort
8071 /// - `sig`: significand term of Real sort
8072 /// - `s`: `FloatingPoint` sort
8073 ///
8074 /// `s` must be a `FloatingPoint` sort, `rm` must be of `RoundingMode` sort,
8075 /// `exp` must be of int sort, `sig` must be of real sort.
8076 pub fn Z3_mk_fpa_to_fp_int_real(
8077 c: Z3_context,
8078 rm: Z3_ast,
8079 exp: Z3_ast,
8080 sig: Z3_ast,
8081 s: Z3_sort,
8082 ) -> Option<Z3_ast>;
8083
8084 /// Pose a query against the asserted rules at the given level.
8085 ///
8086 /// ```text
8087 /// query ::= (exists (bound-vars) query)
8088 /// | literals
8089 /// ```
8090 ///
8091 /// query returns
8092 /// - `Z3_L_FALSE` if the query is unsatisfiable.
8093 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by
8094 /// calling [`Z3_fixedpoint_get_answer`].
8095 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
8096 pub fn Z3_fixedpoint_query_from_lvl(
8097 c: Z3_context,
8098 d: Z3_fixedpoint,
8099 query: Z3_ast,
8100 lvl: ::core::ffi::c_uint,
8101 ) -> Z3_lbool;
8102
8103 /// Retrieve a bottom-up (from query) sequence of ground facts
8104 ///
8105 /// The previous call to [`Z3_fixedpoint_query`]
8106 /// must have returned `Z3_L_TRUE`.
8107 pub fn Z3_fixedpoint_get_ground_sat_answer(c: Z3_context, d: Z3_fixedpoint) -> Option<Z3_ast>;
8108
8109 /// Obtain the list of rules along the counterexample trace.
8110 pub fn Z3_fixedpoint_get_rules_along_trace(
8111 c: Z3_context,
8112 d: Z3_fixedpoint,
8113 ) -> Option<Z3_ast_vector>;
8114
8115 /// Obtain the list of rules along the counterexample trace.
8116 pub fn Z3_fixedpoint_get_rule_names_along_trace(
8117 c: Z3_context,
8118 d: Z3_fixedpoint,
8119 ) -> Option<Z3_symbol>;
8120
8121 /// Add an assumed invariant of predicate `pred`.
8122 ///
8123 /// Note: this functionality is Spacer specific.
8124 pub fn Z3_fixedpoint_add_invariant(
8125 c: Z3_context,
8126 d: Z3_fixedpoint,
8127 pred: Z3_func_decl,
8128 property: Z3_ast,
8129 );
8130
8131 /// Retrieve reachable states of a predicate.
8132 ///
8133 /// Note: this functionality is Spacer specific.
8134 pub fn Z3_fixedpoint_get_reachable(
8135 c: Z3_context,
8136 d: Z3_fixedpoint,
8137 pred: Z3_func_decl,
8138 ) -> Option<Z3_ast>;
8139
8140 /// Project variables given a model
8141 pub fn Z3_qe_model_project(
8142 c: Z3_context,
8143 m: Z3_model,
8144 num_bounds: ::core::ffi::c_uint,
8145 bound: *const Z3_app,
8146 body: Z3_ast,
8147 ) -> Option<Z3_ast>;
8148
8149 /// Project variables given a model
8150 pub fn Z3_qe_model_project_skolem(
8151 c: Z3_context,
8152 m: Z3_model,
8153 num_bounds: ::core::ffi::c_uint,
8154 bound: *const Z3_app,
8155 body: Z3_ast,
8156 map: Z3_ast_map,
8157 ) -> Option<Z3_ast>;
8158
8159 /// Extrapolates a model of a formula
8160 pub fn Z3_model_extrapolate(c: Z3_context, m: Z3_model, fml: Z3_ast) -> Option<Z3_ast>;
8161
8162 /// Best-effort quantifier elimination
8163 pub fn Z3_qe_lite(c: Z3_context, vars: Z3_ast_vector, body: Z3_ast) -> Option<Z3_ast>;
8164}
8165
8166#[cfg(not(windows))]
8167#[link(name = "z3")]
8168unsafe extern "C" {}
8169
8170#[cfg(windows)]
8171#[link(name = "libz3")]
8172unsafe extern "C" {}