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