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