z3_sys/generated/functions.rs
1// Auto-generated by z3-sys bindgen feature — do not edit manually.
2
3unsafe extern "C" {
4 /// Set a global (or module) parameter.
5 /// This setting is shared by all Z3 contexts.
6 ///
7 /// When a Z3 module is initialized it will use the value of these parameters
8 /// when Z3_params objects are not provided.
9 ///
10 /// The name of parameter can be composed of characters \[a-z]\[A-Z], digits \[0-9], '-' and '_'.
11 /// The character '.' is a delimiter (more later).
12 ///
13 /// The parameter names are case-insensitive. The character '-' should be viewed as an "alias" for '_'.
14 /// Thus, the following parameter names are considered equivalent: "pp.decimal-precision" and "PP.DECIMAL_PRECISION".
15 ///
16 /// This function can be used to set parameters for a specific Z3 module.
17 /// This can be done by using `<module-name>.<parameter-name>`.
18 /// For example:
19 /// Z3_global_param_set('pp.decimal', 'true')
20 /// will set the parameter "decimal" in the module "pp" to true.
21 ///
22 /// # See also
23 ///
24 /// - [`Z3_global_param_get`]
25 /// - [`Z3_global_param_reset_all`]
26 pub fn Z3_global_param_set(param_id: Z3_string, param_value: Z3_string);
27 /// Restore the value of all global (and module) parameters.
28 /// This command will not affect already created objects (such as tactics and solvers).
29 ///
30 /// # See also
31 ///
32 /// - [`Z3_global_param_get`]
33 /// - [`Z3_global_param_set`]
34 pub fn Z3_global_param_reset_all();
35 /// Get a global (or module) parameter.
36 ///
37 /// Returns `false` if the parameter value does not exist.
38 ///
39 ///
40 /// **Remark:** This function cannot be invoked simultaneously from different threads without synchronization.
41 /// The result string stored in param_value is stored in shared location.
42 ///
43 /// # See also
44 ///
45 /// - [`Z3_global_param_reset_all`]
46 /// - [`Z3_global_param_set`]
47 pub fn Z3_global_param_get(param_id: Z3_string, param_value: Z3_string_ptr) -> bool;
48 /// Create a configuration object for the Z3 context object.
49 ///
50 /// Configurations are created in order to assign parameters prior to creating
51 /// contexts for Z3 interaction. For example, if the users wishes to use proof
52 /// generation, then call:
53 ///
54 /// `Z3_set_param_value(cfg, "proof", "true")`
55 ///
56 /// **Remark:** In previous versions of Z3, the `Z3_config` was used to store
57 /// global and module configurations. Now, we should use `Z3_global_param_set`.
58 ///
59 /// The following parameters can be set:
60 ///
61 /// - proof (Boolean) Enable proof generation
62 /// - debug_ref_count (Boolean) Enable debug support for Z3_ast reference counting
63 /// - trace (Boolean) Tracing support for VCC
64 /// - trace_file_name (String) Trace out file for VCC traces
65 /// - timeout (unsigned) default timeout (in milliseconds) used for solvers
66 /// - well_sorted_check type checker
67 /// - auto_config use heuristics to automatically select solver and configure it
68 /// - model model generation for solvers, this parameter can be overwritten when creating a solver
69 /// - model_validate validate models produced by solvers
70 /// - unsat_core unsat-core generation for solvers, this parameter can be overwritten when creating a solver
71 /// - encoding the string encoding used internally (must be either "unicode" - 18 bit, "bmp" - 16 bit or "ascii" - 8 bit)
72 ///
73 /// # See also
74 ///
75 /// - [`Z3_set_param_value`]
76 /// - [`Z3_del_config`]
77 pub fn Z3_mk_config() -> Option<Z3_config>;
78 /// Delete the given configuration object.
79 ///
80 /// # See also
81 ///
82 /// - [`Z3_mk_config`]
83 pub fn Z3_del_config(c: Z3_config);
84 /// Set a configuration parameter.
85 ///
86 /// The following parameters can be set for
87 ///
88 /// # See also
89 ///
90 /// - [`Z3_mk_config`]
91 pub fn Z3_set_param_value(c: Z3_config, param_id: Z3_string, param_value: Z3_string);
92 /// Create a context using the given configuration.
93 ///
94 /// After a context is created, the configuration cannot be changed,
95 /// although some parameters can be changed using [`Z3_update_param_value`].
96 /// All main interaction with Z3 happens in the context of a `Z3_context`.
97 ///
98 /// In contrast to `Z3_mk_context_rc` the life time of `Z3_ast` objects
99 /// persists with the life time of the context.
100 ///
101 /// Note that all other reference counted objects, including `Z3_model`,
102 /// `Z3_solver`, `Z3_func_interp` have to be managed by the caller.
103 /// Their reference counts are not handled by the context.
104 ///
105 /// **Remark:** Thread safety: objects created using a given context should not be
106 /// accessed from different threads without synchronization. In other words,
107 /// operations on a context are not thread safe. To use Z3 from different threads
108 /// create separate context objects. The `Z3_translate`, `Z3_solver_translate`,
109 /// `Z3_model_translate`, `Z3_goal_translate`
110 /// methods are exposed to allow copying state from one context to another.
111 ///
112 /// **Remark:**
113 /// - `Z3_sort`, `Z3_func_decl`, `Z3_app`, `Z3_pattern` are `Z3_ast`'s.
114 /// - Z3 uses hash-consing, i.e., when the same `Z3_ast` is created twice,
115 /// Z3 will return the same pointer twice.
116 ///
117 /// # See also
118 ///
119 /// - [`Z3_del_context`]
120 /// - [`Z3_set_error_handler`]
121 pub fn Z3_mk_context(c: Z3_config) -> Option<Z3_context>;
122 /// Create a context using the given configuration.
123 /// This function is similar to [`Z3_mk_context`]. However,
124 /// in the context returned by this function, the user
125 /// is responsible for managing `Z3_ast` reference counters.
126 /// Managing reference counters is a burden and error-prone,
127 /// but allows the user to use the memory more efficiently.
128 /// The user must invoke [`Z3_inc_ref`] for any `Z3_ast` returned
129 /// by Z3, and [`Z3_dec_ref`] whenever the `Z3_ast` is not needed
130 /// anymore. This idiom is similar to the one used in
131 /// BDD (binary decision diagrams) packages such as CUDD.
132 ///
133 /// Remarks:
134 ///
135 /// - `Z3_sort`, `Z3_func_decl`, `Z3_app`, `Z3_pattern` are `Z3_ast`'s.
136 /// - After a context is created, the configuration cannot be changed.
137 /// - All main interaction with Z3 happens in the context of a `Z3_context`.
138 /// - Z3 uses hash-consing, i.e., when the same `Z3_ast` is created twice,
139 /// Z3 will return the same pointer twice.
140 ///
141 /// # See also
142 ///
143 /// - [`Z3_del_context`]
144 /// - [`Z3_set_error_handler`]
145 pub fn Z3_mk_context_rc(c: Z3_config) -> Option<Z3_context>;
146 /// Delete the given logical context.
147 ///
148 /// # See also
149 ///
150 /// - [`Z3_mk_context`]
151 pub fn Z3_del_context(c: Z3_context);
152 /// Register a client proof checker for `c`.
153 ///
154 /// Replaces the previous callback and user data. Passing a null callback
155 /// unregisters it. The client owns the callback and user data and must keep
156 /// them alive until replacement, unregistration, or context destruction.
157 ///
158 /// SMT-LIB evaluation through [`Z3_eval_smtlib2_string`] invokes the callback
159 /// after an unsatisfiable check-sat,
160 /// check-sat-assuming, or check-sat-using command. Automatic reports go to the
161 /// command context's diagnostic stream, included in the returned evaluation
162 /// text. Ordinary [`Z3_solver_check`] calls do not invoke it automatically.
163 ///
164 /// Automatic checking requires proof production to be enabled before
165 /// assertions are added. An unavailable proof is reported as a command error.
166 /// The automatic assertion vector contains the active input assertions and
167 /// current check assumptions. Named assertions tracked for unsat cores are
168 /// represented by their guarded assertions and tracking literals, matching
169 /// the proof premises.
170 ///
171 /// Registration survives SMT-LIB reset commands. The report is opaque:
172 /// Z3 does not interpret it or change the solver's satisfiability result.
173 pub fn Z3_set_proof_check_callback(
174 c: Z3_context,
175 user_context: *mut ::core::ffi::c_void,
176 callback: Z3_proof_check_eh,
177 );
178 /// Increment the reference counter of the given AST.
179 /// The context `c` should have been created using [`Z3_mk_context_rc`].
180 /// This function is a NOOP if `c` was created using [`Z3_mk_context`].
181 pub fn Z3_inc_ref(c: Z3_context, a: Z3_ast);
182 /// Decrement the reference counter of the given AST.
183 /// The context `c` should have been created using [`Z3_mk_context_rc`].
184 /// This function is a NOOP if `c` was created using [`Z3_mk_context`].
185 pub fn Z3_dec_ref(c: Z3_context, a: Z3_ast);
186 /// Set a value of a context parameter.
187 ///
188 /// # See also
189 ///
190 /// - [`Z3_global_param_set`]
191 pub fn Z3_update_param_value(
192 c: Z3_context,
193 param_id: Z3_string,
194 param_value: Z3_string,
195 );
196 /// Retrieve description of global parameters.
197 pub fn Z3_get_global_param_descrs(c: Z3_context) -> Option<Z3_param_descrs>;
198 /// Interrupt the execution of a Z3 procedure.
199 /// This procedure can be used to interrupt: solvers, simplifiers and tactics.
200 pub fn Z3_interrupt(c: Z3_context);
201 /// use concurrency control for dec-ref.
202 /// Reference counting decrements are allowed in separate threads from the context.
203 /// If this setting is not invoked, reference counting decrements are not going to be thread safe.
204 pub fn Z3_enable_concurrent_dec_ref(c: Z3_context);
205 /// Create a Z3 (empty) parameter set.
206 /// Starting at Z3 4.0, parameter sets are used to configure many components such as:
207 /// simplifiers, tactics, solvers, etc.
208 ///
209 /// **Remark:** Reference counting must be used to manage parameter sets, even when the `Z3_context` was
210 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
211 pub fn Z3_mk_params(c: Z3_context) -> Option<Z3_params>;
212 /// Increment the reference counter of the given parameter set.
213 pub fn Z3_params_inc_ref(c: Z3_context, p: Z3_params);
214 /// Decrement the reference counter of the given parameter set.
215 pub fn Z3_params_dec_ref(c: Z3_context, p: Z3_params);
216 /// Add a Boolean parameter `k` with value `v` to the parameter set `p`.
217 pub fn Z3_params_set_bool(c: Z3_context, p: Z3_params, k: Z3_symbol, v: bool);
218 /// Add a unsigned parameter `k` with value `v` to the parameter set `p`.
219 pub fn Z3_params_set_uint(
220 c: Z3_context,
221 p: Z3_params,
222 k: Z3_symbol,
223 v: ::core::ffi::c_uint,
224 );
225 /// Add a double parameter `k` with value `v` to the parameter set `p`.
226 pub fn Z3_params_set_double(c: Z3_context, p: Z3_params, k: Z3_symbol, v: f64);
227 /// Add a symbol parameter `k` with value `v` to the parameter set `p`.
228 pub fn Z3_params_set_symbol(c: Z3_context, p: Z3_params, k: Z3_symbol, v: Z3_symbol);
229 /// Convert a parameter set into a string. This function is mainly used for printing the
230 /// contents of a parameter set.
231 pub fn Z3_params_to_string(c: Z3_context, p: Z3_params) -> Z3_string;
232 /// Validate the parameter set `p` against the parameter description set `d`.
233 ///
234 /// The procedure invokes the error handler if `p` is invalid.
235 pub fn Z3_params_validate(c: Z3_context, p: Z3_params, d: Z3_param_descrs);
236 /// Increment the reference counter of the given parameter description set.
237 pub fn Z3_param_descrs_inc_ref(c: Z3_context, p: Z3_param_descrs);
238 /// Decrement the reference counter of the given parameter description set.
239 pub fn Z3_param_descrs_dec_ref(c: Z3_context, p: Z3_param_descrs);
240 /// Return the kind associated with the given parameter name `n`.
241 pub fn Z3_param_descrs_get_kind(
242 c: Z3_context,
243 p: Z3_param_descrs,
244 n: Z3_symbol,
245 ) -> Z3_param_kind;
246 /// Return the number of parameters in the given parameter description set.
247 pub fn Z3_param_descrs_size(
248 c: Z3_context,
249 p: Z3_param_descrs,
250 ) -> ::core::ffi::c_uint;
251 /// Return the name of the parameter at given index `i`.
252 ///
253 /// # Preconditions
254 ///
255 /// - `i < Z3_param_descrs_size(c, p)`
256 pub fn Z3_param_descrs_get_name(
257 c: Z3_context,
258 p: Z3_param_descrs,
259 i: ::core::ffi::c_uint,
260 ) -> Option<Z3_symbol>;
261 /// Retrieve documentation string corresponding to parameter name `s`.
262 pub fn Z3_param_descrs_get_documentation(
263 c: Z3_context,
264 p: Z3_param_descrs,
265 s: Z3_symbol,
266 ) -> Z3_string;
267 /// Convert a parameter description set into a string. This function is mainly used for printing the
268 /// contents of a parameter description set.
269 pub fn Z3_param_descrs_to_string(c: Z3_context, p: Z3_param_descrs) -> Z3_string;
270 /// Create a Z3 symbol using an integer.
271 ///
272 /// Symbols are used to name several term and type constructors.
273 ///
274 /// NB. Not all integers can be passed to this function.
275 /// The legal range of unsigned integers is 0 to 2^30-1.
276 ///
277 /// # See also
278 ///
279 /// - [`Z3_get_symbol_int`]
280 /// - [`Z3_mk_string_symbol`]
281 pub fn Z3_mk_int_symbol(c: Z3_context, i: ::core::ffi::c_int) -> Option<Z3_symbol>;
282 /// Create a Z3 symbol using a C string.
283 ///
284 /// Symbols are used to name several term and type constructors.
285 ///
286 /// # See also
287 ///
288 /// - [`Z3_get_symbol_string`]
289 /// - [`Z3_mk_int_symbol`]
290 pub fn Z3_mk_string_symbol(c: Z3_context, s: Z3_string) -> Option<Z3_symbol>;
291 /// Create a free (uninterpreted) type using the given name (symbol).
292 ///
293 /// Two free types are considered the same iff the have the same name.
294 pub fn Z3_mk_uninterpreted_sort(c: Z3_context, s: Z3_symbol) -> Option<Z3_sort>;
295 /// Create a type variable.
296 ///
297 /// Functions using type variables can be applied to instantiations that match the signature
298 /// of the function. Assertions using type variables correspond to assertions over all possible
299 /// instantiations.
300 pub fn Z3_mk_type_variable(c: Z3_context, s: Z3_symbol) -> Option<Z3_sort>;
301 /// Create the Boolean type.
302 ///
303 /// This type is used to create propositional variables and predicates.
304 pub fn Z3_mk_bool_sort(c: Z3_context) -> Option<Z3_sort>;
305 /// Create the integer type.
306 ///
307 /// This type is not the int type found in programming languages.
308 /// A machine integer can be represented using bit-vectors. The function
309 /// [`Z3_mk_bv_sort`] creates a bit-vector type.
310 ///
311 /// # See also
312 ///
313 /// - [`Z3_mk_bv_sort`]
314 pub fn Z3_mk_int_sort(c: Z3_context) -> Option<Z3_sort>;
315 /// Create the real type.
316 ///
317 /// Note that this type is not a floating point number.
318 pub fn Z3_mk_real_sort(c: Z3_context) -> Option<Z3_sort>;
319 /// Create the Complex sort. Complex numbers are pairs of Reals.
320 ///
321 /// Use `Z3_mk_complex` to construct values and `Z3_mk_real_part` and
322 /// `Z3_mk_imag_part` to access their components. The arithmetic APIs
323 /// for addition, subtraction, multiplication, negation, and division
324 /// accept Complex expressions. Ordering and exponentiation do not.
325 pub fn Z3_mk_complex_sort(c: Z3_context) -> Option<Z3_sort>;
326 /// Create a complex number with the given real and imaginary components.
327 /// Integer components are coerced to Real.
328 pub fn Z3_mk_complex(c: Z3_context, re: Z3_ast, im: Z3_ast) -> Option<Z3_ast>;
329 /// Return the real component of a Complex expression.
330 pub fn Z3_mk_real_part(c: Z3_context, z: Z3_ast) -> Option<Z3_ast>;
331 /// Return the imaginary component of a Complex expression.
332 pub fn Z3_mk_imag_part(c: Z3_context, z: Z3_ast) -> Option<Z3_ast>;
333 /// Create a bit-vector type of the given size.
334 ///
335 /// This type can also be seen as a machine integer.
336 ///
337 /// **Remark:** The size of the bit-vector type must be greater than zero.
338 pub fn Z3_mk_bv_sort(c: Z3_context, sz: ::core::ffi::c_uint) -> Option<Z3_sort>;
339 /// Create a named finite domain sort.
340 ///
341 /// To create constants that belong to the finite domain,
342 /// use the APIs for creating numerals and pass a numeric
343 /// constant together with the sort returned by this call.
344 /// The numeric constant should be between 0 and the less
345 /// than the size of the domain.
346 ///
347 /// # See also
348 ///
349 /// - [`Z3_get_finite_domain_sort_size`]
350 pub fn Z3_mk_finite_domain_sort(
351 c: Z3_context,
352 name: Z3_symbol,
353 size: u64,
354 ) -> Option<Z3_sort>;
355 /// Create a prime-field sort. Large moduli undergo probable-prime screening.
356 pub fn Z3_mk_finite_field_sort(c: Z3_context, prime: Z3_string) -> Option<Z3_sort>;
357 /// Return the decimal modulus of a finite-field sort.
358 pub fn Z3_get_finite_field_sort_size(c: Z3_context, s: Z3_sort) -> Z3_string;
359 /// Sum at least two elements of the same prime field.
360 pub fn Z3_mk_ff_add(
361 c: Z3_context,
362 n: ::core::ffi::c_uint,
363 args: *const Z3_ast,
364 ) -> Option<Z3_ast>;
365 /// Multiply at least two elements of the same prime field.
366 pub fn Z3_mk_ff_mul(
367 c: Z3_context,
368 n: ::core::ffi::c_uint,
369 args: *const Z3_ast,
370 ) -> Option<Z3_ast>;
371 /// Additive inverse in a prime field.
372 pub fn Z3_mk_ff_neg(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
373 /// Weighted sum a0 + 2*a1 + 4*a2 + ... (does not constrain arguments to bits).
374 pub fn Z3_mk_ff_bitsum(
375 c: Z3_context,
376 n: ::core::ffi::c_uint,
377 args: *const Z3_ast,
378 ) -> Option<Z3_ast>;
379 /// Create an array type.
380 ///
381 /// We usually represent the array type as: `[domain -> range]`.
382 /// Arrays are usually used to model the heap/memory in software verification.
383 ///
384 /// # See also
385 ///
386 /// - [`Z3_mk_select`]
387 /// - [`Z3_mk_store`]
388 pub fn Z3_mk_array_sort(
389 c: Z3_context,
390 domain: Z3_sort,
391 range: Z3_sort,
392 ) -> Option<Z3_sort>;
393 /// Create an array type with N arguments
394 ///
395 /// # See also
396 ///
397 /// - [`Z3_mk_select_n`]
398 /// - [`Z3_mk_store_n`]
399 pub fn Z3_mk_array_sort_n(
400 c: Z3_context,
401 n: ::core::ffi::c_uint,
402 domain: *const Z3_sort,
403 range: Z3_sort,
404 ) -> Option<Z3_sort>;
405 /// Create a tuple type.
406 ///
407 /// A tuple with `n` fields has a constructor and `n` projections.
408 /// This function will also declare the constructor and projection functions.
409 ///
410 /// - `c`: logical context
411 /// - `mk_tuple_name`: name of the constructor function associated with the tuple type.
412 /// - `num_fields`: number of fields in the tuple type.
413 /// - `field_names`: name of the projection functions.
414 /// - `field_sorts`: type of the tuple fields.
415 /// - `mk_tuple_decl`: output parameter that will contain the constructor declaration.
416 /// - `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.
417 pub fn Z3_mk_tuple_sort(
418 c: Z3_context,
419 mk_tuple_name: Z3_symbol,
420 num_fields: ::core::ffi::c_uint,
421 field_names: *const Z3_symbol,
422 field_sorts: *const Z3_sort,
423 mk_tuple_decl: *mut Z3_func_decl,
424 proj_decl: *mut Z3_func_decl,
425 ) -> Option<Z3_sort>;
426 /// Create a enumeration sort.
427 ///
428 /// An enumeration sort with `n` elements.
429 /// This function will also declare the functions corresponding to the enumerations.
430 ///
431 /// - `c`: logical context
432 /// - `name`: name of the enumeration sort.
433 /// - `n`: number of elements in enumeration sort.
434 /// - `enum_names`: names of the enumerated elements.
435 /// - `enum_consts`: constants corresponding to the enumerated elements.
436 /// - `enum_testers`: predicates testing if terms of the enumeration sort correspond to an enumeration.
437 ///
438 /// For example, if this function is called with three symbols A, B, C and the name S, then
439 /// `s` is a sort whose name is S, and the function returns three terms corresponding to A, B, C in
440 /// `enum_consts`. The array `enum_testers` has three predicates of type `(s -> Bool)`.
441 /// The first predicate (corresponding to A) is true when applied to A, and false otherwise.
442 /// Similarly for the other predicates.
443 pub fn Z3_mk_enumeration_sort(
444 c: Z3_context,
445 name: Z3_symbol,
446 n: ::core::ffi::c_uint,
447 enum_names: *const Z3_symbol,
448 enum_consts: *mut Z3_func_decl,
449 enum_testers: *mut Z3_func_decl,
450 ) -> Option<Z3_sort>;
451 /// Create a list sort
452 ///
453 /// A list sort over `elem_sort`
454 /// This function declares the corresponding constructors and testers for lists.
455 ///
456 /// - `c`: logical context
457 /// - `name`: name of the list sort.
458 /// - `elem_sort`: sort of list elements.
459 /// - `nil_decl`: declaration for the empty list.
460 /// - `is_nil_decl`: test for the empty list.
461 /// - `cons_decl`: declaration for a cons cell.
462 /// - `is_cons_decl`: cons cell test.
463 /// - `head_decl`: list head.
464 /// - `tail_decl`: list tail.
465 pub fn Z3_mk_list_sort(
466 c: Z3_context,
467 name: Z3_symbol,
468 elem_sort: Z3_sort,
469 nil_decl: *mut Z3_func_decl,
470 is_nil_decl: *mut Z3_func_decl,
471 cons_decl: *mut Z3_func_decl,
472 is_cons_decl: *mut Z3_func_decl,
473 head_decl: *mut Z3_func_decl,
474 tail_decl: *mut Z3_func_decl,
475 ) -> Option<Z3_sort>;
476 /// Retrieve the number of fields of a constructor
477 ///
478 /// - `c`: logical context.
479 /// - `constr`: constructor.
480 pub fn Z3_constructor_num_fields(
481 c: Z3_context,
482 constr: Z3_constructor,
483 ) -> ::core::ffi::c_uint;
484 /// Reclaim memory allocated to constructor.
485 ///
486 /// - `c`: logical context.
487 /// - `constr`: constructor.
488 ///
489 /// # See also
490 ///
491 /// - [`Z3_mk_constructor`]
492 pub fn Z3_del_constructor(c: Z3_context, constr: Z3_constructor);
493 /// Create datatype, such as lists, trees, records, enumerations or unions of records.
494 /// The datatype may be recursive. Return the datatype sort.
495 ///
496 /// - `c`: logical context.
497 /// - `name`: name of datatype.
498 /// - `num_constructors`: number of constructors passed in.
499 /// - `constructors`: array of constructor containers.
500 ///
501 /// # See also
502 ///
503 /// - [`Z3_mk_constructor`]
504 /// - [`Z3_mk_constructor_list`]
505 /// - [`Z3_mk_datatypes`]
506 pub fn Z3_mk_datatype(
507 c: Z3_context,
508 name: Z3_symbol,
509 num_constructors: ::core::ffi::c_uint,
510 constructors: *mut Z3_constructor,
511 ) -> Option<Z3_sort>;
512 /// Create a parametric datatype with explicit type parameters.
513 ///
514 /// This function is similar to [`Z3_mk_datatype`], except it takes an explicit set of type parameters.
515 /// The parameters can be type variables created with [`Z3_mk_type_variable`], allowing the definition
516 /// of polymorphic datatypes that can be instantiated with different concrete types.
517 ///
518 /// - `c`: logical context
519 /// - `name`: name of the datatype
520 /// - `num_parameters`: number of type parameters (can be 0)
521 /// - `parameters`: array of type parameters (type variables or concrete sorts)
522 /// - `num_constructors`: number of constructors
523 /// - `constructors`: array of constructor specifications
524 ///
525 /// # See also
526 ///
527 /// - [`Z3_mk_datatype`]
528 /// - [`Z3_mk_type_variable`]
529 /// - [`Z3_mk_datatype_sort`]
530 pub fn Z3_mk_polymorphic_datatype(
531 c: Z3_context,
532 name: Z3_symbol,
533 num_parameters: ::core::ffi::c_uint,
534 parameters: *mut Z3_sort,
535 num_constructors: ::core::ffi::c_uint,
536 constructors: *mut Z3_constructor,
537 ) -> Option<Z3_sort>;
538 /// create a forward reference to a recursive datatype being declared.
539 /// The forward reference can be used in a nested occurrence: the range of an array
540 /// or as element sort of a sequence. The forward reference should only be used when
541 /// used in an accessor for a recursive datatype that gets declared.
542 ///
543 /// Forward references can replace the use sort references, that are unsigned integers
544 /// in the `Z3_mk_constructor` call
545 ///
546 /// - `c`: logical context
547 /// - `name`: name of the datatype
548 /// - `num_params`: number of sort parameters
549 /// - `params`: array of sort parameters
550 pub fn Z3_mk_datatype_sort(
551 c: Z3_context,
552 name: Z3_symbol,
553 num_params: ::core::ffi::c_uint,
554 params: *const Z3_sort,
555 ) -> Option<Z3_sort>;
556 /// Create list of constructors.
557 ///
558 /// - `c`: logical context.
559 /// - `num_constructors`: number of constructors in list.
560 /// - `constructors`: list of constructors.
561 ///
562 /// # See also
563 ///
564 /// - [`Z3_del_constructor_list`]
565 /// - [`Z3_mk_constructor`]
566 pub fn Z3_mk_constructor_list(
567 c: Z3_context,
568 num_constructors: ::core::ffi::c_uint,
569 constructors: *const Z3_constructor,
570 ) -> Option<Z3_constructor_list>;
571 /// Reclaim memory allocated for constructor list.
572 ///
573 /// Each constructor inside the constructor list must be independently reclaimed using [`Z3_del_constructor`].
574 ///
575 /// - `c`: logical context.
576 /// - `clist`: constructor list container.
577 ///
578 /// # See also
579 ///
580 /// - [`Z3_mk_constructor_list`]
581 pub fn Z3_del_constructor_list(c: Z3_context, clist: Z3_constructor_list);
582 /// Create mutually recursive datatypes.
583 ///
584 /// - `c`: logical context.
585 /// - `num_sorts`: number of datatype sorts.
586 /// - `sort_names`: names of datatype sorts.
587 /// - `sorts`: array of datatype sorts.
588 /// - `constructor_lists`: list of constructors, one list per sort.
589 ///
590 /// # See also
591 ///
592 /// - [`Z3_mk_constructor`]
593 /// - [`Z3_mk_constructor_list`]
594 /// - [`Z3_mk_datatype`]
595 pub fn Z3_mk_datatypes(
596 c: Z3_context,
597 num_sorts: ::core::ffi::c_uint,
598 sort_names: *const Z3_symbol,
599 sorts: *mut Z3_sort,
600 constructor_lists: *mut Z3_constructor_list,
601 );
602 /// Query constructor for declared functions.
603 ///
604 /// - `c`: logical context.
605 /// - `constr`: constructor container. The container must have been passed into a [`Z3_mk_datatype`] call.
606 /// - `num_fields`: number of accessor fields in the constructor.
607 /// - `constructor`: constructor function declaration, allocated by user.
608 /// - `tester`: constructor test function declaration, allocated by user.
609 /// - `accessors`: array of accessor function declarations allocated by user. The array must contain num_fields elements.
610 ///
611 /// # See also
612 ///
613 /// - [`Z3_mk_constructor`]
614 pub fn Z3_query_constructor(
615 c: Z3_context,
616 constr: Z3_constructor,
617 num_fields: ::core::ffi::c_uint,
618 constructor: *mut Z3_func_decl,
619 tester: *mut Z3_func_decl,
620 accessors: *mut Z3_func_decl,
621 );
622 /// Declare a constant or function.
623 ///
624 /// - `c`: logical context.
625 /// - `s`: name of the constant or function.
626 /// - `domain_size`: number of arguments. It is 0 when declaring a constant.
627 /// - `domain`: array containing the sort of each argument. The array must contain domain_size elements. It is 0 when declaring a constant.
628 /// - `range`: sort of the constant or the return sort of the function.
629 ///
630 /// After declaring a constant or function, the function
631 /// [`Z3_mk_app`] can be used to create a constant or function
632 /// application.
633 ///
634 /// # See also
635 ///
636 /// - [`Z3_mk_app`]
637 /// - [`Z3_mk_fresh_func_decl`]
638 /// - [`Z3_mk_rec_func_decl`]
639 pub fn Z3_mk_func_decl(
640 c: Z3_context,
641 s: Z3_symbol,
642 domain_size: ::core::ffi::c_uint,
643 domain: *const Z3_sort,
644 range: Z3_sort,
645 ) -> Option<Z3_func_decl>;
646 /// Create a constant or function application.
647 ///
648 /// # See also
649 ///
650 /// - [`Z3_mk_fresh_func_decl`]
651 /// - [`Z3_mk_func_decl`]
652 /// - [`Z3_mk_rec_func_decl`]
653 pub fn Z3_mk_app(
654 c: Z3_context,
655 d: Z3_func_decl,
656 num_args: ::core::ffi::c_uint,
657 args: *const Z3_ast,
658 ) -> Option<Z3_ast>;
659 /// Declare and create a constant.
660 ///
661 /// This function is a shorthand for:
662 /// ```c
663 /// Z3_func_decl d = Z3_mk_func_decl(c, s, 0, 0, ty);
664 /// Z3_ast n = Z3_mk_app(c, d, 0, 0);
665 /// ```
666 ///
667 /// # See also
668 ///
669 /// - [`Z3_mk_app`]
670 /// - [`Z3_mk_fresh_const`]
671 /// - [`Z3_mk_func_decl`]
672 pub fn Z3_mk_const(c: Z3_context, s: Z3_symbol, ty: Z3_sort) -> Option<Z3_ast>;
673 /// Declare a fresh constant or function.
674 ///
675 /// Z3 will generate an unique name for this function declaration.
676 /// If prefix is different from `NULL`, then the name generate by Z3 will start with `prefix`.
677 ///
678 /// **Remark:** If `prefix` is `NULL`, then it is assumed to be the empty string.
679 ///
680 /// # See also
681 ///
682 /// - [`Z3_mk_func_decl`]
683 pub fn Z3_mk_fresh_func_decl(
684 c: Z3_context,
685 prefix: Z3_string,
686 domain_size: ::core::ffi::c_uint,
687 domain: *const Z3_sort,
688 range: Z3_sort,
689 ) -> Option<Z3_func_decl>;
690 /// Declare and create a fresh constant.
691 ///
692 /// This function is a shorthand for:
693 /// `Z3_func_decl d = Z3_mk_fresh_func_decl(c, prefix, 0, 0, ty); Z3_ast n = Z3_mk_app(c, d, 0, 0);`
694 ///
695 /// **Remark:** If `prefix` is `NULL`, then it is assumed to be the empty string.
696 ///
697 /// # See also
698 ///
699 /// - [`Z3_mk_app`]
700 /// - [`Z3_mk_const`]
701 /// - [`Z3_mk_fresh_func_decl`]
702 /// - [`Z3_mk_func_decl`]
703 pub fn Z3_mk_fresh_const(
704 c: Z3_context,
705 prefix: Z3_string,
706 ty: Z3_sort,
707 ) -> Option<Z3_ast>;
708 /// Declare a recursive function
709 ///
710 /// - `c`: logical context.
711 /// - `s`: name of the function.
712 /// - `domain_size`: number of arguments. It should be greater than 0.
713 /// - `domain`: array containing the sort of each argument. The array must contain domain_size elements.
714 /// - `range`: sort of the constant or the return sort of the function.
715 ///
716 /// After declaring recursive function, it should be associated with a recursive definition [`Z3_add_rec_def`].
717 /// The function [`Z3_mk_app`] can be used to create a constant or function
718 /// application.
719 ///
720 /// # See also
721 ///
722 /// - [`Z3_add_rec_def`]
723 /// - [`Z3_mk_app`]
724 /// - [`Z3_mk_func_decl`]
725 pub fn Z3_mk_rec_func_decl(
726 c: Z3_context,
727 s: Z3_symbol,
728 domain_size: ::core::ffi::c_uint,
729 domain: *const Z3_sort,
730 range: Z3_sort,
731 ) -> Option<Z3_func_decl>;
732 /// Define the body of a recursive function.
733 ///
734 /// - `c`: logical context.
735 /// - `f`: function declaration.
736 /// - `n`: number of arguments to the function
737 /// - `args`: constants that are used as arguments to the recursive function in the definition.
738 /// - `body`: body of the recursive function
739 ///
740 /// After declaring a recursive function or a collection of mutually recursive functions, use
741 /// this function to provide the definition for the recursive function.
742 ///
743 /// # See also
744 ///
745 /// - [`Z3_mk_rec_func_decl`]
746 pub fn Z3_add_rec_def(
747 c: Z3_context,
748 f: Z3_func_decl,
749 n: ::core::ffi::c_uint,
750 args: *mut Z3_ast,
751 body: Z3_ast,
752 );
753 /// Create an AST node representing `true`.
754 pub fn Z3_mk_true(c: Z3_context) -> Option<Z3_ast>;
755 /// Create an AST node representing `false`.
756 pub fn Z3_mk_false(c: Z3_context) -> Option<Z3_ast>;
757 /// Create an AST node representing `l = r`.
758 ///
759 /// The nodes `l` and `r` must have the same type.
760 pub fn Z3_mk_eq(c: Z3_context, l: Z3_ast, r: Z3_ast) -> Option<Z3_ast>;
761 /// Create an AST node representing `distinct(args[0], ..., args[num_args-1])`.
762 ///
763 /// The `distinct` construct is used for declaring the arguments pairwise distinct.
764 /// That is, `Forall 0 <= i < j < num_args. not args[i] = args[j]`.
765 ///
766 /// All arguments must have the same sort.
767 ///
768 /// **Remark:** The number of arguments of a distinct construct must be greater than one.
769 pub fn Z3_mk_distinct(
770 c: Z3_context,
771 num_args: ::core::ffi::c_uint,
772 args: *const Z3_ast,
773 ) -> Option<Z3_ast>;
774 /// Create an AST node representing `not(a)`.
775 ///
776 /// The node `a` must have Boolean sort.
777 pub fn Z3_mk_not(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
778 /// Create an AST node representing an if-then-else: `ite(t1, t2, t3)`.
779 ///
780 /// The node `t1` must have Boolean sort, `t2` and `t3` must have the same sort.
781 /// The sort of the new node is equal to the sort of `t2` and `t3`.
782 pub fn Z3_mk_ite(
783 c: Z3_context,
784 t1: Z3_ast,
785 t2: Z3_ast,
786 t3: Z3_ast,
787 ) -> Option<Z3_ast>;
788 /// Create an AST node representing `t1 iff t2`.
789 ///
790 /// The nodes `t1` and `t2` must have Boolean sort.
791 pub fn Z3_mk_iff(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
792 /// Create an AST node representing `t1 implies t2`.
793 ///
794 /// The nodes `t1` and `t2` must have Boolean sort.
795 pub fn Z3_mk_implies(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
796 /// Create an AST node representing `t1 xor t2`.
797 ///
798 /// The nodes `t1` and `t2` must have Boolean sort.
799 pub fn Z3_mk_xor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
800 /// Create an AST node representing `args[0] and ... and args[num_args-1]`.
801 ///
802 /// The array `args` must have `num_args` elements.
803 /// All arguments must have Boolean sort.
804 ///
805 /// **Remark:** The number of arguments must be greater than zero.
806 pub fn Z3_mk_and(
807 c: Z3_context,
808 num_args: ::core::ffi::c_uint,
809 args: *const Z3_ast,
810 ) -> Option<Z3_ast>;
811 /// Create an AST node representing `args[0] or ... or args[num_args-1]`.
812 ///
813 /// The array `args` must have `num_args` elements.
814 /// All arguments must have Boolean sort.
815 ///
816 /// **Remark:** The number of arguments must be greater than zero.
817 pub fn Z3_mk_or(
818 c: Z3_context,
819 num_args: ::core::ffi::c_uint,
820 args: *const Z3_ast,
821 ) -> Option<Z3_ast>;
822 /// Create an AST node representing `args[0] + ... + args[num_args-1]`.
823 ///
824 /// The array `args` must have `num_args` elements.
825 /// All arguments must have Int, Real, or Complex sort.
826 ///
827 /// **Remark:** The number of arguments must be greater than zero.
828 pub fn Z3_mk_add(
829 c: Z3_context,
830 num_args: ::core::ffi::c_uint,
831 args: *const Z3_ast,
832 ) -> Option<Z3_ast>;
833 /// Create an AST node representing `args[0] * ... * args[num_args-1]`.
834 ///
835 /// The array `args` must have `num_args` elements.
836 /// All arguments must have Int, Real, or Complex sort.
837 ///
838 /// **Remark:** Z3 has limited support for non-linear arithmetic.
839 /// **Remark:** The number of arguments must be greater than zero.
840 pub fn Z3_mk_mul(
841 c: Z3_context,
842 num_args: ::core::ffi::c_uint,
843 args: *const Z3_ast,
844 ) -> Option<Z3_ast>;
845 /// Create an AST node representing `args[0] - ... - args[num_args - 1]`.
846 ///
847 /// The array `args` must have `num_args` elements.
848 /// All arguments must have Int, Real, or Complex sort.
849 ///
850 /// **Remark:** The number of arguments must be greater than zero.
851 pub fn Z3_mk_sub(
852 c: Z3_context,
853 num_args: ::core::ffi::c_uint,
854 args: *const Z3_ast,
855 ) -> Option<Z3_ast>;
856 /// Create an AST node representing `- arg`.
857 ///
858 /// The argument must have Int, Real, or Complex sort.
859 pub fn Z3_mk_unary_minus(c: Z3_context, arg: Z3_ast) -> Option<Z3_ast>;
860 /// Create an AST node representing `arg1 div arg2`.
861 ///
862 /// The arguments must have Int, Real, or Complex sort. Int arguments use
863 /// integer division. Real and Complex arguments use their respective division
864 /// operations, with Int embedded in Real and Int/Real embedded in Complex.
865 /// Complex division is lowered to Real component division; at a zero Complex
866 /// denominator, both components are the same totalized Real `0`/0 value.
867 pub fn Z3_mk_div(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
868 /// Create an AST node representing `arg1 mod arg2`.
869 ///
870 /// The arguments must have int type.
871 pub fn Z3_mk_mod(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
872 /// Create an AST node representing `arg1 rem arg2`.
873 ///
874 /// The arguments must have int type.
875 pub fn Z3_mk_rem(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
876 /// Create an AST node representing `arg1 ^ arg2`.
877 ///
878 /// The arguments must have int or real type.
879 pub fn Z3_mk_power(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
880 /// Take the absolute value of an integer
881 pub fn Z3_mk_abs(c: Z3_context, arg: Z3_ast) -> Option<Z3_ast>;
882 /// Create less than.
883 ///
884 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
885 pub fn Z3_mk_lt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
886 /// Create less than or equal to.
887 ///
888 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
889 pub fn Z3_mk_le(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
890 /// Create greater than.
891 ///
892 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
893 pub fn Z3_mk_gt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
894 /// Create greater than or equal to.
895 ///
896 /// The nodes `t1` and `t2` must have the same sort, and must be int or real.
897 pub fn Z3_mk_ge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
898 /// Create division predicate.
899 ///
900 /// The nodes `t1` and `t2` must be of integer sort.
901 /// The predicate is true when `t1` divides `t2`. For the predicate to be part of
902 /// linear integer arithmetic, the first argument `t1` must be a non-zero integer.
903 pub fn Z3_mk_divides(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
904 /// Coerce an integer to a real.
905 ///
906 /// There is also a converse operation exposed.
907 /// It follows the semantics prescribed by the SMT-LIB standard.
908 ///
909 /// You can take the floor of a real by
910 /// creating an auxiliary integer constant `k` and
911 /// and asserting `mk_int2real(k) <= t1 < mk_int2real(k)+1`.
912 ///
913 /// The node `t1` must have sort integer.
914 ///
915 /// # See also
916 ///
917 /// - [`Z3_mk_real2int`]
918 /// - [`Z3_mk_is_int`]
919 pub fn Z3_mk_int2real(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
920 /// Coerce a real to an integer.
921 ///
922 /// The semantics of this function follows the SMT-LIB standard
923 /// for the function to_int
924 ///
925 /// # See also
926 ///
927 /// - [`Z3_mk_int2real`]
928 /// - [`Z3_mk_is_int`]
929 pub fn Z3_mk_real2int(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
930 /// Check if a real number is an integer.
931 ///
932 /// # See also
933 ///
934 /// - [`Z3_mk_int2real`]
935 /// - [`Z3_mk_real2int`]
936 pub fn Z3_mk_is_int(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
937 /// Bitwise negation.
938 ///
939 /// The node `t1` must have a bit-vector sort.
940 pub fn Z3_mk_bvnot(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
941 /// Take conjunction of bits in vector, return vector of length 1.
942 ///
943 /// The node `t1` must have a bit-vector sort.
944 pub fn Z3_mk_bvredand(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
945 /// Take disjunction of bits in vector, return vector of length 1.
946 ///
947 /// The node `t1` must have a bit-vector sort.
948 pub fn Z3_mk_bvredor(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
949 /// Bitwise and.
950 ///
951 /// The nodes `t1` and `t2` must have the same bit-vector sort.
952 pub fn Z3_mk_bvand(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
953 /// Bitwise or.
954 ///
955 /// The nodes `t1` and `t2` must have the same bit-vector sort.
956 pub fn Z3_mk_bvor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
957 /// Bitwise exclusive-or.
958 ///
959 /// The nodes `t1` and `t2` must have the same bit-vector sort.
960 pub fn Z3_mk_bvxor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
961 /// Bitwise nand.
962 ///
963 /// The nodes `t1` and `t2` must have the same bit-vector sort.
964 pub fn Z3_mk_bvnand(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
965 /// Bitwise nor.
966 ///
967 /// The nodes `t1` and `t2` must have the same bit-vector sort.
968 pub fn Z3_mk_bvnor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
969 /// Bitwise xnor.
970 ///
971 /// The nodes `t1` and `t2` must have the same bit-vector sort.
972 pub fn Z3_mk_bvxnor(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
973 /// Standard two's complement unary minus.
974 ///
975 /// The node `t1` must have bit-vector sort.
976 pub fn Z3_mk_bvneg(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
977 /// Standard two's complement addition.
978 ///
979 /// The nodes `t1` and `t2` must have the same bit-vector sort.
980 pub fn Z3_mk_bvadd(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
981 /// Standard two's complement subtraction.
982 ///
983 /// The nodes `t1` and `t2` must have the same bit-vector sort.
984 pub fn Z3_mk_bvsub(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
985 /// Standard two's complement multiplication.
986 ///
987 /// The nodes `t1` and `t2` must have the same bit-vector sort.
988 pub fn Z3_mk_bvmul(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
989 /// Unsigned division.
990 ///
991 /// It is defined as the `floor` of `t1/t2` if `t2` is
992 /// different from zero. If `t2` is zero, then the result
993 /// is undefined.
994 ///
995 /// The nodes `t1` and `t2` must have the same bit-vector sort.
996 pub fn Z3_mk_bvudiv(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
997 /// Two's complement signed division.
998 ///
999 /// It is defined in the following way:
1000 ///
1001 /// - The `floor` of `t1/t2` if `t2` is different from zero, and `t1*t2 >= 0`.
1002 ///
1003 /// - The `ceiling` of `t1/t2` if `t2` is different from zero, and `t1*t2 < 0`.
1004 ///
1005 /// If `t2` is zero, then the result is undefined.
1006 ///
1007 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1008 pub fn Z3_mk_bvsdiv(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1009 /// Unsigned remainder.
1010 ///
1011 /// It is defined as `t1 - (t1 /u t2) * t2`, where `/u` represents unsigned division.
1012 ///
1013 /// If `t2` is zero, then the result is undefined.
1014 ///
1015 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1016 pub fn Z3_mk_bvurem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1017 /// Two's complement signed remainder (sign follows dividend).
1018 ///
1019 /// It is defined as `t1 - (t1 /s t2) * t2`, where `/s` represents signed division.
1020 /// The most significant bit (sign) of the result is equal to the most significant bit of `t1`.
1021 ///
1022 /// If `t2` is zero, then the result is undefined.
1023 ///
1024 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1025 ///
1026 /// # See also
1027 ///
1028 /// - [`Z3_mk_bvsmod`]
1029 pub fn Z3_mk_bvsrem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1030 /// Two's complement signed remainder (sign follows divisor).
1031 ///
1032 /// If `t2` is zero, then the result is undefined.
1033 ///
1034 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1035 ///
1036 /// # See also
1037 ///
1038 /// - [`Z3_mk_bvsrem`]
1039 pub fn Z3_mk_bvsmod(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1040 /// Unsigned less than.
1041 ///
1042 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1043 pub fn Z3_mk_bvult(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1044 /// Two's complement signed less than.
1045 ///
1046 /// It abbreviates:
1047 /// ```c
1048 /// (or (and (= (extract[|m-1|:|m-1|] t1) bit1)
1049 /// (= (extract[|m-1|:|m-1|] t2) bit0))
1050 /// (and (= (extract[|m-1|:|m-1|] t1) (extract[|m-1|:|m-1|] t2))
1051 /// (bvult t1 t2)))
1052 /// ```
1053 ///
1054 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1055 pub fn Z3_mk_bvslt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1056 /// Unsigned less than or equal to.
1057 ///
1058 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1059 pub fn Z3_mk_bvule(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1060 /// Two's complement signed less than or equal to.
1061 ///
1062 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1063 pub fn Z3_mk_bvsle(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1064 /// Unsigned greater than or equal to.
1065 ///
1066 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1067 pub fn Z3_mk_bvuge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1068 /// Two's complement signed greater than or equal to.
1069 ///
1070 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1071 pub fn Z3_mk_bvsge(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1072 /// Unsigned greater than.
1073 ///
1074 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1075 pub fn Z3_mk_bvugt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1076 /// Two's complement signed greater than.
1077 ///
1078 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1079 pub fn Z3_mk_bvsgt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1080 /// Concatenate the given bit-vectors.
1081 ///
1082 /// The nodes `t1` and `t2` must have (possibly different) bit-vector sorts
1083 ///
1084 /// The result is a bit-vector of size `n1+n2`, where `n1` (`n2`) is the size
1085 /// of `t1` (`t2`).
1086 pub fn Z3_mk_concat(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1087 /// Extract the bits `high` down to `low` from a bit-vector of
1088 /// size `m` to yield a new bit-vector of size `n`, where `n = high - low + 1`.
1089 ///
1090 /// The node `t1` must have a bit-vector sort.
1091 pub fn Z3_mk_extract(
1092 c: Z3_context,
1093 high: ::core::ffi::c_uint,
1094 low: ::core::ffi::c_uint,
1095 t1: Z3_ast,
1096 ) -> Option<Z3_ast>;
1097 /// Sign-extend of the given bit-vector to the (signed) equivalent bit-vector of
1098 /// size `m+i`, where `m` is the size of the given
1099 /// bit-vector.
1100 ///
1101 /// The node `t1` must have a bit-vector sort.
1102 pub fn Z3_mk_sign_ext(
1103 c: Z3_context,
1104 i: ::core::ffi::c_uint,
1105 t1: Z3_ast,
1106 ) -> Option<Z3_ast>;
1107 /// Extend the given bit-vector with zeros to the (unsigned) equivalent
1108 /// bit-vector of size `m+i`, where `m` is the size of the
1109 /// given bit-vector.
1110 ///
1111 /// The node `t1` must have a bit-vector sort.
1112 pub fn Z3_mk_zero_ext(
1113 c: Z3_context,
1114 i: ::core::ffi::c_uint,
1115 t1: Z3_ast,
1116 ) -> Option<Z3_ast>;
1117 /// Repeat the given bit-vector up length `i`.
1118 ///
1119 /// The node `t1` must have a bit-vector sort.
1120 pub fn Z3_mk_repeat(
1121 c: Z3_context,
1122 i: ::core::ffi::c_uint,
1123 t1: Z3_ast,
1124 ) -> Option<Z3_ast>;
1125 /// Extracts the bit at position `i` of a bit-vector and
1126 /// yields a boolean.
1127 ///
1128 /// The node `t1` must have a bit-vector sort.
1129 pub fn Z3_mk_bit2bool(
1130 c: Z3_context,
1131 i: ::core::ffi::c_uint,
1132 t1: Z3_ast,
1133 ) -> Option<Z3_ast>;
1134 /// Shift left.
1135 ///
1136 /// It is equivalent to multiplication by `2^x` where `x` is the value of the
1137 /// third argument.
1138 ///
1139 /// NB. The semantics of shift operations varies between environments. This
1140 /// definition does not necessarily capture directly the semantics of the
1141 /// programming language or assembly architecture you are modeling.
1142 ///
1143 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1144 pub fn Z3_mk_bvshl(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1145 /// Logical shift right.
1146 ///
1147 /// It is equivalent to unsigned division by `2^x` where `x` is the
1148 /// value of the third argument.
1149 ///
1150 /// NB. The semantics of shift operations varies between environments. This
1151 /// definition does not necessarily capture directly the semantics of the
1152 /// programming language or assembly architecture you are modeling.
1153 ///
1154 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1155 pub fn Z3_mk_bvlshr(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1156 /// Arithmetic shift right.
1157 ///
1158 /// It is like logical shift right except that the most significant
1159 /// bits of the result always copy the most significant bit of the
1160 /// second argument.
1161 ///
1162 /// The semantics of shift operations varies between environments. This
1163 /// definition does not necessarily capture directly the semantics of the
1164 /// programming language or assembly architecture you are modeling.
1165 ///
1166 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1167 pub fn Z3_mk_bvashr(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
1168 /// Rotate bits of `t1` to the left `i` times.
1169 ///
1170 /// The node `t1` must have a bit-vector sort.
1171 pub fn Z3_mk_rotate_left(
1172 c: Z3_context,
1173 i: ::core::ffi::c_uint,
1174 t1: Z3_ast,
1175 ) -> Option<Z3_ast>;
1176 /// Rotate bits of `t1` to the right `i` times.
1177 ///
1178 /// The node `t1` must have a bit-vector sort.
1179 pub fn Z3_mk_rotate_right(
1180 c: Z3_context,
1181 i: ::core::ffi::c_uint,
1182 t1: Z3_ast,
1183 ) -> Option<Z3_ast>;
1184 /// Rotate bits of `t1` to the left `t2` times.
1185 ///
1186 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1187 pub fn Z3_mk_ext_rotate_left(
1188 c: Z3_context,
1189 t1: Z3_ast,
1190 t2: Z3_ast,
1191 ) -> Option<Z3_ast>;
1192 /// Rotate bits of `t1` to the right `t2` times.
1193 ///
1194 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1195 pub fn Z3_mk_ext_rotate_right(
1196 c: Z3_context,
1197 t1: Z3_ast,
1198 t2: Z3_ast,
1199 ) -> Option<Z3_ast>;
1200 /// Create an `n` bit bit-vector from the integer argument `t1`.
1201 ///
1202 /// The resulting bit-vector has `n` bits, where the i'th bit (counting
1203 /// from 0 to `n`-1) is 1 if `(t1 div 2^i)` mod 2 is 1.
1204 ///
1205 /// The node `t1` must have integer sort.
1206 pub fn Z3_mk_int2bv(
1207 c: Z3_context,
1208 n: ::core::ffi::c_uint,
1209 t1: Z3_ast,
1210 ) -> Option<Z3_ast>;
1211 /// Create an integer from the bit-vector argument `t1`.
1212 /// If `is_signed` is false, then the bit-vector `t1` is treated as unsigned.
1213 /// So the result is non-negative
1214 /// and in the range `[0..2^N-1]`, where N are the number of bits in `t1`.
1215 /// If `is_signed` is true, `t1` is treated as a signed bit-vector.
1216 ///
1217 ///
1218 /// The node `t1` must have a bit-vector sort.
1219 pub fn Z3_mk_bv2int(c: Z3_context, t1: Z3_ast, is_signed: bool) -> Option<Z3_ast>;
1220 /// Create a predicate that checks that the bit-wise addition
1221 /// of `t1` and `t2` does not overflow.
1222 ///
1223 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1224 /// The returned node is of sort Bool.
1225 pub fn Z3_mk_bvadd_no_overflow(
1226 c: Z3_context,
1227 t1: Z3_ast,
1228 t2: Z3_ast,
1229 is_signed: bool,
1230 ) -> Option<Z3_ast>;
1231 /// Create a predicate that checks that the bit-wise signed addition
1232 /// of `t1` and `t2` does not underflow.
1233 ///
1234 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1235 /// The returned node is of sort Bool.
1236 pub fn Z3_mk_bvadd_no_underflow(
1237 c: Z3_context,
1238 t1: Z3_ast,
1239 t2: Z3_ast,
1240 ) -> Option<Z3_ast>;
1241 /// Create a predicate that checks that the bit-wise signed subtraction
1242 /// of `t1` and `t2` does not overflow.
1243 ///
1244 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1245 /// The returned node is of sort Bool.
1246 pub fn Z3_mk_bvsub_no_overflow(
1247 c: Z3_context,
1248 t1: Z3_ast,
1249 t2: Z3_ast,
1250 ) -> Option<Z3_ast>;
1251 /// Create a predicate that checks that the bit-wise subtraction
1252 /// of `t1` and `t2` does not underflow.
1253 ///
1254 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1255 /// The returned node is of sort Bool.
1256 pub fn Z3_mk_bvsub_no_underflow(
1257 c: Z3_context,
1258 t1: Z3_ast,
1259 t2: Z3_ast,
1260 is_signed: bool,
1261 ) -> Option<Z3_ast>;
1262 /// Create a predicate that checks that the bit-wise signed division
1263 /// of `t1` and `t2` does not overflow.
1264 ///
1265 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1266 /// The returned node is of sort Bool.
1267 pub fn Z3_mk_bvsdiv_no_overflow(
1268 c: Z3_context,
1269 t1: Z3_ast,
1270 t2: Z3_ast,
1271 ) -> Option<Z3_ast>;
1272 /// Check that bit-wise negation does not overflow when
1273 /// `t1` is interpreted as a signed bit-vector.
1274 ///
1275 /// The node `t1` must have bit-vector sort.
1276 /// The returned node is of sort Bool.
1277 pub fn Z3_mk_bvneg_no_overflow(c: Z3_context, t1: Z3_ast) -> Option<Z3_ast>;
1278 /// Create a predicate that checks that the bit-wise multiplication
1279 /// of `t1` and `t2` does not overflow.
1280 ///
1281 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1282 /// The returned node is of sort Bool.
1283 pub fn Z3_mk_bvmul_no_overflow(
1284 c: Z3_context,
1285 t1: Z3_ast,
1286 t2: Z3_ast,
1287 is_signed: bool,
1288 ) -> Option<Z3_ast>;
1289 /// Create a predicate that checks that the bit-wise signed multiplication
1290 /// of `t1` and `t2` does not underflow.
1291 ///
1292 /// The nodes `t1` and `t2` must have the same bit-vector sort.
1293 /// The returned node is of sort Bool.
1294 pub fn Z3_mk_bvmul_no_underflow(
1295 c: Z3_context,
1296 t1: Z3_ast,
1297 t2: Z3_ast,
1298 ) -> Option<Z3_ast>;
1299 /// Array read.
1300 /// The argument `a` is the array and `i` is the index of the array that gets read.
1301 ///
1302 /// The node `a` must have an array sort `[domain -> range]`,
1303 /// and `i` must have the sort `domain`.
1304 /// The sort of the result is `range`.
1305 ///
1306 /// # See also
1307 ///
1308 /// - [`Z3_mk_array_sort`]
1309 /// - [`Z3_mk_store`]
1310 pub fn Z3_mk_select(c: Z3_context, a: Z3_ast, i: Z3_ast) -> Option<Z3_ast>;
1311 /// n-ary Array read.
1312 /// The argument `a` is the array and `idxs` are the indices of the array that gets read.
1313 pub fn Z3_mk_select_n(
1314 c: Z3_context,
1315 a: Z3_ast,
1316 n: ::core::ffi::c_uint,
1317 idxs: *const Z3_ast,
1318 ) -> Option<Z3_ast>;
1319 /// Array update.
1320 ///
1321 /// The node `a` must have an array sort `[domain -> range]`, `i` must have sort `domain`,
1322 /// `v` must have sort range. The sort of the result is `[domain -> range]`.
1323 /// The semantics of this function is given by the theory of arrays described in the SMT-LIB
1324 /// standard. See <http://smtlib.org> for more details.
1325 /// The result of this function is an array that is equal to `a` (with respect to `select`)
1326 /// on all indices except for `i`, where it maps to `v` (and the `select` of `a` with
1327 /// respect to `i` may be a different value).
1328 ///
1329 /// # See also
1330 ///
1331 /// - [`Z3_mk_array_sort`]
1332 /// - [`Z3_mk_select`]
1333 pub fn Z3_mk_store(c: Z3_context, a: Z3_ast, i: Z3_ast, v: Z3_ast) -> Option<Z3_ast>;
1334 /// n-ary Array update.
1335 pub fn Z3_mk_store_n(
1336 c: Z3_context,
1337 a: Z3_ast,
1338 n: ::core::ffi::c_uint,
1339 idxs: *const Z3_ast,
1340 v: Z3_ast,
1341 ) -> Option<Z3_ast>;
1342 /// Create the constant array.
1343 ///
1344 /// The resulting term is an array, such that a `select` on an arbitrary index
1345 /// produces the value `v`.
1346 ///
1347 /// - `c`: logical context.
1348 /// - `domain`: domain sort for the array.
1349 /// - `v`: value that the array maps to.
1350 pub fn Z3_mk_const_array(
1351 c: Z3_context,
1352 domain: Z3_sort,
1353 v: Z3_ast,
1354 ) -> Option<Z3_ast>;
1355 /// Map f on the argument arrays.
1356 ///
1357 /// The `n` nodes `args` must be of array sorts `[domain_i -> range_i]`.
1358 /// The function declaration `f` must have type ` range_1 .. range_n -> range`.
1359 /// `v` must have sort range. The sort of the result is `[domain_i -> range]`.
1360 ///
1361 /// # See also
1362 ///
1363 /// - [`Z3_mk_array_sort`]
1364 /// - [`Z3_mk_store`]
1365 /// - [`Z3_mk_select`]
1366 pub fn Z3_mk_map(
1367 c: Z3_context,
1368 f: Z3_func_decl,
1369 n: ::core::ffi::c_uint,
1370 args: *const Z3_ast,
1371 ) -> Option<Z3_ast>;
1372 /// Access the array default value.
1373 /// Produces the default range value, for arrays that can be represented as
1374 /// finite maps with a default range value.
1375 ///
1376 /// - `c`: logical context.
1377 /// - `array`: array value whose default range value is accessed.
1378 pub fn Z3_mk_array_default(c: Z3_context, array: Z3_ast) -> Option<Z3_ast>;
1379 /// Create array with the same interpretation as a function.
1380 /// The array satisfies the property (f x) = (select (_ as-array f) x)
1381 /// for every argument x.
1382 pub fn Z3_mk_as_array(c: Z3_context, f: Z3_func_decl) -> Option<Z3_ast>;
1383 /// Create Set type.
1384 pub fn Z3_mk_set_sort(c: Z3_context, ty: Z3_sort) -> Option<Z3_sort>;
1385 /// Create the empty set.
1386 pub fn Z3_mk_empty_set(c: Z3_context, domain: Z3_sort) -> Option<Z3_ast>;
1387 /// Create the full set.
1388 pub fn Z3_mk_full_set(c: Z3_context, domain: Z3_sort) -> Option<Z3_ast>;
1389 /// Add an element to a set.
1390 ///
1391 /// The first argument must be a set, the second an element.
1392 pub fn Z3_mk_set_add(c: Z3_context, set: Z3_ast, elem: Z3_ast) -> Option<Z3_ast>;
1393 /// Remove an element to a set.
1394 ///
1395 /// The first argument must be a set, the second an element.
1396 pub fn Z3_mk_set_del(c: Z3_context, set: Z3_ast, elem: Z3_ast) -> Option<Z3_ast>;
1397 /// Take the union of a list of sets.
1398 pub fn Z3_mk_set_union(
1399 c: Z3_context,
1400 num_args: ::core::ffi::c_uint,
1401 args: *const Z3_ast,
1402 ) -> Option<Z3_ast>;
1403 /// Take the intersection of a list of sets.
1404 pub fn Z3_mk_set_intersect(
1405 c: Z3_context,
1406 num_args: ::core::ffi::c_uint,
1407 args: *const Z3_ast,
1408 ) -> Option<Z3_ast>;
1409 /// Take the set difference between two sets.
1410 pub fn Z3_mk_set_difference(
1411 c: Z3_context,
1412 arg1: Z3_ast,
1413 arg2: Z3_ast,
1414 ) -> Option<Z3_ast>;
1415 /// Take the complement of a set.
1416 pub fn Z3_mk_set_complement(c: Z3_context, arg: Z3_ast) -> Option<Z3_ast>;
1417 /// Check for set membership.
1418 ///
1419 /// The first argument should be an element type of the set.
1420 pub fn Z3_mk_set_member(c: Z3_context, elem: Z3_ast, set: Z3_ast) -> Option<Z3_ast>;
1421 /// Check for subsetness of sets.
1422 pub fn Z3_mk_set_subset(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
1423 /// Create array extensionality index given two arrays with the same sort.
1424 /// The meaning is given by the axiom:
1425 /// (=> (= (select A (array-ext A B)) (select B (array-ext A B))) (= A B))
1426 pub fn Z3_mk_array_ext(c: Z3_context, arg1: Z3_ast, arg2: Z3_ast) -> Option<Z3_ast>;
1427 /// Create a finite set sort.
1428 pub fn Z3_mk_finite_set_sort(c: Z3_context, elem_sort: Z3_sort) -> Option<Z3_sort>;
1429 /// Check if a sort is a finite set sort.
1430 pub fn Z3_is_finite_set_sort(c: Z3_context, s: Z3_sort) -> bool;
1431 /// Get the element sort of a finite set sort.
1432 pub fn Z3_get_finite_set_sort_basis(c: Z3_context, s: Z3_sort) -> Option<Z3_sort>;
1433 /// Create an empty finite set of the given sort.
1434 pub fn Z3_mk_finite_set_empty(c: Z3_context, set_sort: Z3_sort) -> Option<Z3_ast>;
1435 /// Create a singleton finite set.
1436 pub fn Z3_mk_finite_set_singleton(c: Z3_context, elem: Z3_ast) -> Option<Z3_ast>;
1437 /// Create the union of two finite sets.
1438 pub fn Z3_mk_finite_set_union(
1439 c: Z3_context,
1440 s1: Z3_ast,
1441 s2: Z3_ast,
1442 ) -> Option<Z3_ast>;
1443 /// Create the intersection of two finite sets.
1444 pub fn Z3_mk_finite_set_intersect(
1445 c: Z3_context,
1446 s1: Z3_ast,
1447 s2: Z3_ast,
1448 ) -> Option<Z3_ast>;
1449 /// Create the set difference of two finite sets.
1450 pub fn Z3_mk_finite_set_difference(
1451 c: Z3_context,
1452 s1: Z3_ast,
1453 s2: Z3_ast,
1454 ) -> Option<Z3_ast>;
1455 /// Check if an element is a member of a finite set.
1456 pub fn Z3_mk_finite_set_member(
1457 c: Z3_context,
1458 elem: Z3_ast,
1459 set: Z3_ast,
1460 ) -> Option<Z3_ast>;
1461 /// Get the size (cardinality) of a finite set.
1462 pub fn Z3_mk_finite_set_size(c: Z3_context, set: Z3_ast) -> Option<Z3_ast>;
1463 /// Check if one finite set is a subset of another.
1464 pub fn Z3_mk_finite_set_subset(
1465 c: Z3_context,
1466 s1: Z3_ast,
1467 s2: Z3_ast,
1468 ) -> Option<Z3_ast>;
1469 /// Apply a function to all elements of a finite set.
1470 pub fn Z3_mk_finite_set_map(c: Z3_context, f: Z3_ast, set: Z3_ast) -> Option<Z3_ast>;
1471 /// Filter a finite set using a predicate.
1472 pub fn Z3_mk_finite_set_filter(
1473 c: Z3_context,
1474 f: Z3_ast,
1475 set: Z3_ast,
1476 ) -> Option<Z3_ast>;
1477 /// Create a finite set of integers in the range [low, high].
1478 pub fn Z3_mk_finite_set_range(
1479 c: Z3_context,
1480 low: Z3_ast,
1481 high: Z3_ast,
1482 ) -> Option<Z3_ast>;
1483 /// Create a numeral of a given sort.
1484 ///
1485 /// - `c`: logical context.
1486 /// - `numeral`: A string representing the numeral value in decimal notation. The string may be of the form `[num]*[.[num]*][E[+|-][num]+]`.
1487 /// If the given sort is a real, then the numeral can be a rational, that is, a string of the form `[num]* / [num]*` .
1488 /// - `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.
1489 ///
1490 /// # See also
1491 ///
1492 /// - [`Z3_mk_int`]
1493 /// - [`Z3_mk_unsigned_int`]
1494 pub fn Z3_mk_numeral(
1495 c: Z3_context,
1496 numeral: Z3_string,
1497 ty: Z3_sort,
1498 ) -> Option<Z3_ast>;
1499 /// Create a real from a fraction.
1500 ///
1501 /// - `c`: logical context.
1502 /// - `num`: numerator of rational.
1503 /// - `den`: denominator of rational.
1504 ///
1505 /// # Preconditions
1506 ///
1507 /// - `den != 0`
1508 ///
1509 /// # See also
1510 ///
1511 /// - [`Z3_mk_numeral`]
1512 /// - [`Z3_mk_int`]
1513 /// - [`Z3_mk_real_int64`]
1514 /// - [`Z3_mk_unsigned_int`]
1515 pub fn Z3_mk_real(
1516 c: Z3_context,
1517 num: ::core::ffi::c_int,
1518 den: ::core::ffi::c_int,
1519 ) -> Option<Z3_ast>;
1520 /// Create a real from a fraction of int64.
1521 ///
1522 /// # See also
1523 ///
1524 /// - [`Z3_mk_real`]
1525 pub fn Z3_mk_real_int64(c: Z3_context, num: i64, den: i64) -> Option<Z3_ast>;
1526 /// Create a numeral of an int, bit-vector, or finite-domain sort.
1527 ///
1528 /// This function can be used to create numerals that fit in a machine integer.
1529 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
1530 ///
1531 /// # See also
1532 ///
1533 /// - [`Z3_mk_numeral`]
1534 pub fn Z3_mk_int(
1535 c: Z3_context,
1536 v: ::core::ffi::c_int,
1537 ty: Z3_sort,
1538 ) -> Option<Z3_ast>;
1539 /// Create a numeral of a int, bit-vector, or finite-domain sort.
1540 ///
1541 /// This function can be used to create numerals that fit in a machine unsigned integer.
1542 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
1543 ///
1544 /// # See also
1545 ///
1546 /// - [`Z3_mk_numeral`]
1547 pub fn Z3_mk_unsigned_int(
1548 c: Z3_context,
1549 v: ::core::ffi::c_uint,
1550 ty: Z3_sort,
1551 ) -> Option<Z3_ast>;
1552 /// Create a numeral of a int, bit-vector, or finite-domain sort.
1553 ///
1554 /// This function can be used to create numerals that fit in a machine `int64_t` integer.
1555 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
1556 ///
1557 /// # See also
1558 ///
1559 /// - [`Z3_mk_numeral`]
1560 pub fn Z3_mk_int64(c: Z3_context, v: i64, ty: Z3_sort) -> Option<Z3_ast>;
1561 /// Create a numeral of a int, bit-vector, or finite-domain sort.
1562 ///
1563 /// This function can be used to create numerals that fit in a machine `uint64_t` integer.
1564 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
1565 ///
1566 /// # See also
1567 ///
1568 /// - [`Z3_mk_numeral`]
1569 pub fn Z3_mk_unsigned_int64(c: Z3_context, v: u64, ty: Z3_sort) -> Option<Z3_ast>;
1570 /// create a bit-vector numeral from a vector of Booleans.
1571 ///
1572 /// # See also
1573 ///
1574 /// - [`Z3_mk_numeral`]
1575 pub fn Z3_mk_bv_numeral(
1576 c: Z3_context,
1577 sz: ::core::ffi::c_uint,
1578 bits: *const bool,
1579 ) -> Option<Z3_ast>;
1580 /// Create a sequence sort out of the sort for the elements.
1581 pub fn Z3_mk_seq_sort(c: Z3_context, s: Z3_sort) -> Option<Z3_sort>;
1582 /// Check if `s` is a sequence sort.
1583 pub fn Z3_is_seq_sort(c: Z3_context, s: Z3_sort) -> bool;
1584 /// Retrieve basis sort for sequence sort.
1585 pub fn Z3_get_seq_sort_basis(c: Z3_context, s: Z3_sort) -> Option<Z3_sort>;
1586 /// Create a regular expression sort out of a sequence sort.
1587 pub fn Z3_mk_re_sort(c: Z3_context, seq: Z3_sort) -> Option<Z3_sort>;
1588 /// Check if `s` is a regular expression sort.
1589 pub fn Z3_is_re_sort(c: Z3_context, s: Z3_sort) -> bool;
1590 /// Retrieve basis sort for regex sort.
1591 pub fn Z3_get_re_sort_basis(c: Z3_context, s: Z3_sort) -> Option<Z3_sort>;
1592 /// Create a sort for unicode strings.
1593 ///
1594 /// The sort for characters can be changed to ASCII by setting
1595 /// the global parameter `encoding` to `ascii`, or alternative
1596 /// to 16 bit characters by setting `encoding` to `bmp`.
1597 pub fn Z3_mk_string_sort(c: Z3_context) -> Option<Z3_sort>;
1598 /// Create a sort for unicode characters.
1599 ///
1600 /// The sort for characters can be changed to ASCII by setting
1601 /// the global parameter `encoding` to `ascii`, or alternative
1602 /// to 16 bit characters by setting `encoding` to `bmp`.
1603 pub fn Z3_mk_char_sort(c: Z3_context) -> Option<Z3_sort>;
1604 /// Check if `s` is a string sort.
1605 pub fn Z3_is_string_sort(c: Z3_context, s: Z3_sort) -> bool;
1606 /// Check if `s` is a character sort.
1607 pub fn Z3_is_char_sort(c: Z3_context, s: Z3_sort) -> bool;
1608 /// Create a string constant out of the string that is passed in
1609 /// The string may contain escape encoding for non-printable characters
1610 /// or characters outside of the basic printable ASCII range. For example,
1611 /// the escape encoding \\u{0} represents the character 0 and the encoding
1612 /// \\u{100} represents the character 256.
1613 pub fn Z3_mk_string(c: Z3_context, s: Z3_string) -> Option<Z3_ast>;
1614 /// Create a string constant out of the string that is passed in
1615 /// It takes the length of the string as well to take into account
1616 /// 0 characters. The string is treated as if it is unescaped so a sequence
1617 /// of characters \\u{0} is treated as 5 characters and not the character 0.
1618 pub fn Z3_mk_lstring(
1619 c: Z3_context,
1620 len: ::core::ffi::c_uint,
1621 s: Z3_string,
1622 ) -> Option<Z3_ast>;
1623 /// Create a string constant out of the string that is passed in
1624 /// It takes the length of the string as well to take into account
1625 /// 0 characters. The string is unescaped.
1626 pub fn Z3_mk_u32string(
1627 c: Z3_context,
1628 len: ::core::ffi::c_uint,
1629 chars: *const ::core::ffi::c_uint,
1630 ) -> Option<Z3_ast>;
1631 /// Determine if `s` is a string constant.
1632 pub fn Z3_is_string(c: Z3_context, s: Z3_ast) -> bool;
1633 /// Retrieve the string constant stored in `s`.
1634 /// Characters outside the basic printable ASCII range are escaped.
1635 ///
1636 /// # Preconditions
1637 ///
1638 /// - ` Z3_is_string(c, s)`
1639 pub fn Z3_get_string(c: Z3_context, s: Z3_ast) -> Z3_string;
1640 /// Retrieve the string constant stored in `s`. The string can contain escape sequences.
1641 /// Characters in the range 1 to 255 are literal.
1642 /// Characters in the range 0, and 256 above are escaped.
1643 ///
1644 /// # Preconditions
1645 ///
1646 /// - ` Z3_is_string(c, s)`
1647 pub fn Z3_get_lstring(
1648 c: Z3_context,
1649 s: Z3_ast,
1650 length: *mut ::core::ffi::c_uint,
1651 ) -> Z3_char_ptr;
1652 /// Retrieve the length of the unescaped string constant stored in `s`.
1653 ///
1654 /// # Preconditions
1655 ///
1656 /// - ` Z3_is_string(c, s)`
1657 pub fn Z3_get_string_length(c: Z3_context, s: Z3_ast) -> ::core::ffi::c_uint;
1658 /// Retrieve the unescaped string constant stored in `s`.
1659 ///
1660 /// # Preconditions
1661 ///
1662 /// - ` Z3_is_string(c, s)`
1663 /// - `length contains the number of characters in s`
1664 pub fn Z3_get_string_contents(
1665 c: Z3_context,
1666 s: Z3_ast,
1667 length: ::core::ffi::c_uint,
1668 contents: *mut ::core::ffi::c_uint,
1669 );
1670 /// Create an empty sequence of the sequence sort `seq`.
1671 ///
1672 /// # Preconditions
1673 ///
1674 /// - `s is a sequence sort.`
1675 pub fn Z3_mk_seq_empty(c: Z3_context, seq: Z3_sort) -> Option<Z3_ast>;
1676 /// Create a unit sequence of `a`.
1677 pub fn Z3_mk_seq_unit(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
1678 /// Concatenate sequences.
1679 ///
1680 /// # Preconditions
1681 ///
1682 /// - `n > 0`
1683 pub fn Z3_mk_seq_concat(
1684 c: Z3_context,
1685 n: ::core::ffi::c_uint,
1686 args: *const Z3_ast,
1687 ) -> Option<Z3_ast>;
1688 /// Check if `prefix` is a prefix of `s`.
1689 ///
1690 /// # Preconditions
1691 ///
1692 /// - `prefix and s are the same sequence sorts.`
1693 pub fn Z3_mk_seq_prefix(c: Z3_context, prefix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
1694 /// Check if `suffix` is a suffix of `s`.
1695 ///
1696 /// # Preconditions
1697 ///
1698 /// - ``suffix` and `s` are the same sequence sorts.`
1699 pub fn Z3_mk_seq_suffix(c: Z3_context, suffix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
1700 /// Check if `container` contains `containee`.
1701 ///
1702 /// # Preconditions
1703 ///
1704 /// - ``container` and `containee` are the same sequence sorts.`
1705 pub fn Z3_mk_seq_contains(
1706 c: Z3_context,
1707 container: Z3_ast,
1708 containee: Z3_ast,
1709 ) -> Option<Z3_ast>;
1710 /// Check if `s1` is lexicographically strictly less than `s2`.
1711 ///
1712 /// # Preconditions
1713 ///
1714 /// - ``s1` and `s2` are strings`
1715 pub fn Z3_mk_str_lt(c: Z3_context, prefix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
1716 /// Check if `s1` is equal or lexicographically strictly less than `s2`.
1717 ///
1718 /// # Preconditions
1719 ///
1720 /// - ``s1` and `s2` are strings`
1721 pub fn Z3_mk_str_le(c: Z3_context, prefix: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
1722 /// Extract subsequence starting at `offset` of `length`.
1723 pub fn Z3_mk_seq_extract(
1724 c: Z3_context,
1725 s: Z3_ast,
1726 offset: Z3_ast,
1727 length: Z3_ast,
1728 ) -> Option<Z3_ast>;
1729 /// Replace the first occurrence of `src` with `dst` in `s`.
1730 pub fn Z3_mk_seq_replace(
1731 c: Z3_context,
1732 s: Z3_ast,
1733 src: Z3_ast,
1734 dst: Z3_ast,
1735 ) -> Option<Z3_ast>;
1736 /// Replace all occurrences of `src` with `dst` in `s`.
1737 pub fn Z3_mk_seq_replace_all(
1738 c: Z3_context,
1739 s: Z3_ast,
1740 src: Z3_ast,
1741 dst: Z3_ast,
1742 ) -> Option<Z3_ast>;
1743 /// Replace the first occurrence of regular expression `re` with `dst` in `s`.
1744 pub fn Z3_mk_seq_replace_re(
1745 c: Z3_context,
1746 s: Z3_ast,
1747 re: Z3_ast,
1748 dst: Z3_ast,
1749 ) -> Option<Z3_ast>;
1750 /// Replace all occurrences of regular expression `re` with `dst` in `s`.
1751 pub fn Z3_mk_seq_replace_re_all(
1752 c: Z3_context,
1753 s: Z3_ast,
1754 re: Z3_ast,
1755 dst: Z3_ast,
1756 ) -> Option<Z3_ast>;
1757 /// Retrieve from `s` the unit sequence positioned at position `index`.
1758 /// The sequence is empty if the index is out of bounds.
1759 pub fn Z3_mk_seq_at(c: Z3_context, s: Z3_ast, index: Z3_ast) -> Option<Z3_ast>;
1760 /// Retrieve from `s` the element positioned at position `index`.
1761 /// The function is under-specified if the index is out of bounds.
1762 pub fn Z3_mk_seq_nth(c: Z3_context, s: Z3_ast, index: Z3_ast) -> Option<Z3_ast>;
1763 /// Create the sequence `s` concatenated `n` times with itself.
1764 /// The result is the empty sequence when `n` is not positive.
1765 pub fn Z3_mk_seq_power(c: Z3_context, s: Z3_ast, n: Z3_ast) -> Option<Z3_ast>;
1766 /// Return the length of the sequence `s`.
1767 pub fn Z3_mk_seq_length(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
1768 /// Return index of the first occurrence of `substr` in `s` starting from offset `offset`.
1769 /// 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.
1770 /// The value is -1 if `offset` is negative or larger than the length of `s`.
1771 pub fn Z3_mk_seq_index(
1772 c: Z3_context,
1773 s: Z3_ast,
1774 substr: Z3_ast,
1775 offset: Z3_ast,
1776 ) -> Option<Z3_ast>;
1777 /// Return index of the last occurrence of `substr` in `s`.
1778 /// If `s` does not contain `substr`, then the value is -1,
1779 pub fn Z3_mk_seq_last_index(
1780 c: Z3_context,
1781 s: Z3_ast,
1782 substr: Z3_ast,
1783 ) -> Option<Z3_ast>;
1784 /// Create a map of the function `f` over the sequence `s`.
1785 pub fn Z3_mk_seq_map(c: Z3_context, f: Z3_ast, s: Z3_ast) -> Option<Z3_ast>;
1786 /// Create a map of the function `f` over the sequence `s` starting at index `i`.
1787 pub fn Z3_mk_seq_mapi(
1788 c: Z3_context,
1789 f: Z3_ast,
1790 i: Z3_ast,
1791 s: Z3_ast,
1792 ) -> Option<Z3_ast>;
1793 /// Create a fold of the function `f` over the sequence `s` with accumulator a.
1794 pub fn Z3_mk_seq_foldl(
1795 c: Z3_context,
1796 f: Z3_ast,
1797 a: Z3_ast,
1798 s: Z3_ast,
1799 ) -> Option<Z3_ast>;
1800 /// Create a fold with index tracking of the function `f` over the sequence `s` with accumulator `a` starting at index `i`.
1801 pub fn Z3_mk_seq_foldli(
1802 c: Z3_context,
1803 f: Z3_ast,
1804 i: Z3_ast,
1805 a: Z3_ast,
1806 s: Z3_ast,
1807 ) -> Option<Z3_ast>;
1808 /// Convert string to integer.
1809 pub fn Z3_mk_str_to_int(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
1810 /// Integer to string conversion.
1811 pub fn Z3_mk_int_to_str(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
1812 /// String to code conversion.
1813 pub fn Z3_mk_string_to_code(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
1814 /// Code to string conversion.
1815 pub fn Z3_mk_string_from_code(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
1816 /// Unsigned bit-vector to string conversion.
1817 pub fn Z3_mk_ubv_to_str(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
1818 /// Signed bit-vector to string conversion.
1819 pub fn Z3_mk_sbv_to_str(c: Z3_context, s: Z3_ast) -> Option<Z3_ast>;
1820 /// Create a regular expression that accepts the sequence `seq`.
1821 pub fn Z3_mk_seq_to_re(c: Z3_context, seq: Z3_ast) -> Option<Z3_ast>;
1822 /// Check if `seq` is in the language generated by the regular expression `re`.
1823 pub fn Z3_mk_seq_in_re(c: Z3_context, seq: Z3_ast, re: Z3_ast) -> Option<Z3_ast>;
1824 /// Create the regular language `re`+.
1825 pub fn Z3_mk_re_plus(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
1826 /// Create the regular language `re`*.
1827 pub fn Z3_mk_re_star(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
1828 /// Create the regular language `[re]`.
1829 pub fn Z3_mk_re_option(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
1830 /// Create the union of the regular languages.
1831 ///
1832 /// # Preconditions
1833 ///
1834 /// - `n > 0`
1835 pub fn Z3_mk_re_union(
1836 c: Z3_context,
1837 n: ::core::ffi::c_uint,
1838 args: *const Z3_ast,
1839 ) -> Option<Z3_ast>;
1840 /// Create the concatenation of the regular languages.
1841 ///
1842 /// # Preconditions
1843 ///
1844 /// - `n > 0`
1845 pub fn Z3_mk_re_concat(
1846 c: Z3_context,
1847 n: ::core::ffi::c_uint,
1848 args: *const Z3_ast,
1849 ) -> Option<Z3_ast>;
1850 /// Create the range regular expression over two sequences of length 1.
1851 pub fn Z3_mk_re_range(c: Z3_context, lo: Z3_ast, hi: Z3_ast) -> Option<Z3_ast>;
1852 /// Create a regular expression that accepts all singleton sequences of the regular expression sort
1853 pub fn Z3_mk_re_allchar(c: Z3_context, regex_sort: Z3_sort) -> Option<Z3_ast>;
1854 /// Create a regular expression loop. The supplied regular expression `r` is repeated
1855 /// between `lo` and `hi` times. The `lo` should be below `hi` with one exception: when
1856 /// supplying the value `hi` as 0, the meaning is to repeat the argument `r` at least
1857 /// `lo` number of times, and with an unbounded upper bound.
1858 pub fn Z3_mk_re_loop(
1859 c: Z3_context,
1860 r: Z3_ast,
1861 lo: ::core::ffi::c_uint,
1862 hi: ::core::ffi::c_uint,
1863 ) -> Option<Z3_ast>;
1864 /// Create a power regular expression.
1865 pub fn Z3_mk_re_power(
1866 c: Z3_context,
1867 re: Z3_ast,
1868 n: ::core::ffi::c_uint,
1869 ) -> Option<Z3_ast>;
1870 /// Create the intersection of the regular languages.
1871 ///
1872 /// # Preconditions
1873 ///
1874 /// - `n > 0`
1875 pub fn Z3_mk_re_intersect(
1876 c: Z3_context,
1877 n: ::core::ffi::c_uint,
1878 args: *const Z3_ast,
1879 ) -> Option<Z3_ast>;
1880 /// Create the complement of the regular language `re`.
1881 pub fn Z3_mk_re_complement(c: Z3_context, re: Z3_ast) -> Option<Z3_ast>;
1882 /// Create the difference of regular expressions.
1883 pub fn Z3_mk_re_diff(c: Z3_context, re1: Z3_ast, re2: Z3_ast) -> Option<Z3_ast>;
1884 /// Create an empty regular expression of sort `re`.
1885 ///
1886 /// # Preconditions
1887 ///
1888 /// - `re is a regular expression sort.`
1889 pub fn Z3_mk_re_empty(c: Z3_context, re: Z3_sort) -> Option<Z3_ast>;
1890 /// Create an universal regular expression of sort `re`.
1891 ///
1892 /// # Preconditions
1893 ///
1894 /// - `re is a regular expression sort.`
1895 pub fn Z3_mk_re_full(c: Z3_context, re: Z3_sort) -> Option<Z3_ast>;
1896 /// Create a character literal
1897 pub fn Z3_mk_char(c: Z3_context, ch: ::core::ffi::c_uint) -> Option<Z3_ast>;
1898 /// Create less than or equal to between two characters.
1899 pub fn Z3_mk_char_le(c: Z3_context, ch1: Z3_ast, ch2: Z3_ast) -> Option<Z3_ast>;
1900 /// Create an integer (code point) from character.
1901 pub fn Z3_mk_char_to_int(c: Z3_context, ch: Z3_ast) -> Option<Z3_ast>;
1902 /// Create a bit-vector (code point) from character.
1903 pub fn Z3_mk_char_to_bv(c: Z3_context, ch: Z3_ast) -> Option<Z3_ast>;
1904 /// Create a character from a bit-vector (code point).
1905 pub fn Z3_mk_char_from_bv(c: Z3_context, bv: Z3_ast) -> Option<Z3_ast>;
1906 /// Create a check if the character is a digit.
1907 pub fn Z3_mk_char_is_digit(c: Z3_context, ch: Z3_ast) -> Option<Z3_ast>;
1908 /// create a linear ordering relation over signature `a`.
1909 /// The relation is identified by the index `id`.
1910 pub fn Z3_mk_linear_order(
1911 c: Z3_context,
1912 a: Z3_sort,
1913 id: ::core::ffi::c_uint,
1914 ) -> Option<Z3_func_decl>;
1915 /// create a partial ordering relation over signature `a` and index `id`.
1916 pub fn Z3_mk_partial_order(
1917 c: Z3_context,
1918 a: Z3_sort,
1919 id: ::core::ffi::c_uint,
1920 ) -> Option<Z3_func_decl>;
1921 /// create a piecewise linear ordering relation over signature `a` and index `id`.
1922 pub fn Z3_mk_piecewise_linear_order(
1923 c: Z3_context,
1924 a: Z3_sort,
1925 id: ::core::ffi::c_uint,
1926 ) -> Option<Z3_func_decl>;
1927 /// create a tree ordering relation over signature `a` identified using index `id`.
1928 pub fn Z3_mk_tree_order(
1929 c: Z3_context,
1930 a: Z3_sort,
1931 id: ::core::ffi::c_uint,
1932 ) -> Option<Z3_func_decl>;
1933 /// create transitive closure of binary relation.
1934 ///
1935 ///
1936 /// The resulting relation f+ represents the transitive closure of f.
1937 ///
1938 /// # Preconditions
1939 ///
1940 /// - `f is a binary relation, such that the two arguments have the same sorts.`
1941 pub fn Z3_mk_transitive_closure(
1942 c: Z3_context,
1943 f: Z3_func_decl,
1944 ) -> Option<Z3_func_decl>;
1945 /// Create a pattern for quantifier instantiation.
1946 ///
1947 /// Z3 uses pattern matching to instantiate quantifiers. If a
1948 /// pattern is not provided for a quantifier, then Z3 will
1949 /// automatically compute a set of patterns for it. However, for
1950 /// optimal performance, the user should provide the patterns.
1951 ///
1952 /// Patterns comprise a list of terms. The list should be
1953 /// non-empty. If the list comprises of more than one term, it is
1954 /// a called a multi-pattern.
1955 ///
1956 /// In general, one can pass in a list of (multi-)patterns in the
1957 /// quantifier constructor.
1958 ///
1959 /// # See also
1960 ///
1961 /// - [`Z3_mk_forall`]
1962 /// - [`Z3_mk_exists`]
1963 pub fn Z3_mk_pattern(
1964 c: Z3_context,
1965 num_patterns: ::core::ffi::c_uint,
1966 terms: *const Z3_ast,
1967 ) -> Option<Z3_pattern>;
1968 /// Create a variable.
1969 ///
1970 /// Variables are intended to be bound by a scope created by a quantifier. So we call them bound variables
1971 /// even if they appear as free variables in the expression produced by `Z3_mk_bound`.
1972 ///
1973 /// Bound variables are indexed by de-Bruijn indices. It is perhaps easiest to explain
1974 /// the meaning of de-Bruijn indices by indicating the compilation process from
1975 /// non-de-Bruijn formulas to de-Bruijn format.
1976 ///
1977 /// ```text
1978 /// abs(forall (x1) phi) = forall (x1) abs1(phi, x1, 0)
1979 /// abs(forall (x1, x2) phi) = abs(forall (x1) abs(forall (x2) phi))
1980 /// abs1(x, x, n) = b_n
1981 /// abs1(y, x, n) = y
1982 /// abs1(f(t1,...,tn), x, n) = f(abs1(t1,x,n), ..., abs1(tn,x,n))
1983 /// abs1(forall (x1) phi, x, n) = forall (x1) (abs1(phi, x, n+1))
1984 /// ```
1985 ///
1986 /// The last line is significant: the index of a bound variable is different depending
1987 /// on the scope in which it appears. The deeper x appears, the higher is its
1988 /// index.
1989 ///
1990 /// - `c`: logical context
1991 /// - `index`: de-Bruijn index
1992 /// - `ty`: sort of the bound variable
1993 ///
1994 /// # See also
1995 ///
1996 /// - [`Z3_mk_forall`]
1997 /// - [`Z3_mk_exists`]
1998 pub fn Z3_mk_bound(
1999 c: Z3_context,
2000 index: ::core::ffi::c_uint,
2001 ty: Z3_sort,
2002 ) -> Option<Z3_ast>;
2003 /// Create a forall formula. It takes an expression `body` that contains bound variables
2004 /// of the same sorts as the sorts listed in the array `sorts`. The bound variables are de-Bruijn indices created
2005 /// using [`Z3_mk_bound`]. The array `decl_names` contains the names that the quantified formula uses for the
2006 /// bound variables. Z3 applies the convention that the last element in the `decl_names` and `sorts` array
2007 /// refers to the variable with index 0, the second to last element of `decl_names` and `sorts` refers
2008 /// to the variable with index 1, etc.
2009 ///
2010 /// - `c`: logical context.
2011 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
2012 /// - `num_patterns`: number of patterns.
2013 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
2014 /// - `num_decls`: number of variables to be bound.
2015 /// - `sorts`: the sorts of the bound variables.
2016 /// - `decl_names`: names of the bound variables
2017 /// - `body`: the body of the quantifier.
2018 ///
2019 /// # See also
2020 ///
2021 /// - [`Z3_mk_pattern`]
2022 /// - [`Z3_mk_bound`]
2023 /// - [`Z3_mk_exists`]
2024 pub fn Z3_mk_forall(
2025 c: Z3_context,
2026 weight: ::core::ffi::c_uint,
2027 num_patterns: ::core::ffi::c_uint,
2028 patterns: *const Z3_pattern,
2029 num_decls: ::core::ffi::c_uint,
2030 sorts: *const Z3_sort,
2031 decl_names: *const Z3_symbol,
2032 body: Z3_ast,
2033 ) -> Option<Z3_ast>;
2034 /// Create an exists formula. Similar to [`Z3_mk_forall`].
2035 ///
2036 /// # See also
2037 ///
2038 /// - [`Z3_mk_pattern`]
2039 /// - [`Z3_mk_bound`]
2040 /// - [`Z3_mk_forall`]
2041 /// - [`Z3_mk_quantifier`]
2042 pub fn Z3_mk_exists(
2043 c: Z3_context,
2044 weight: ::core::ffi::c_uint,
2045 num_patterns: ::core::ffi::c_uint,
2046 patterns: *const Z3_pattern,
2047 num_decls: ::core::ffi::c_uint,
2048 sorts: *const Z3_sort,
2049 decl_names: *const Z3_symbol,
2050 body: Z3_ast,
2051 ) -> Option<Z3_ast>;
2052 /// Create a quantifier - universal or existential, with pattern hints.
2053 /// See the documentation for [`Z3_mk_forall`] for an explanation of the parameters.
2054 ///
2055 /// - `c`: logical context.
2056 /// - `is_forall`: flag to indicate if this is a universal or existential quantifier.
2057 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
2058 /// - `num_patterns`: number of patterns.
2059 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
2060 /// - `num_decls`: number of variables to be bound.
2061 /// - `sorts`: array of sorts of the bound variables.
2062 /// - `decl_names`: names of the bound variables.
2063 /// - `body`: the body of the quantifier.
2064 ///
2065 /// # See also
2066 ///
2067 /// - [`Z3_mk_pattern`]
2068 /// - [`Z3_mk_bound`]
2069 /// - [`Z3_mk_forall`]
2070 /// - [`Z3_mk_exists`]
2071 pub fn Z3_mk_quantifier(
2072 c: Z3_context,
2073 is_forall: bool,
2074 weight: ::core::ffi::c_uint,
2075 num_patterns: ::core::ffi::c_uint,
2076 patterns: *const Z3_pattern,
2077 num_decls: ::core::ffi::c_uint,
2078 sorts: *const Z3_sort,
2079 decl_names: *const Z3_symbol,
2080 body: Z3_ast,
2081 ) -> Option<Z3_ast>;
2082 /// Create a quantifier - universal or existential, with pattern hints, no patterns, and attributes
2083 ///
2084 /// - `c`: logical context.
2085 /// - `is_forall`: flag to indicate if this is a universal or existential quantifier.
2086 /// - `quantifier_id`: identifier to identify quantifier
2087 /// - `skolem_id`: identifier to identify skolem constants introduced by quantifier.
2088 /// - `weight`: quantifiers are associated with weights indicating the importance of using the quantifier during instantiation. By default, pass the weight 0.
2089 /// - `num_patterns`: number of patterns.
2090 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
2091 /// - `num_no_patterns`: number of no_patterns.
2092 /// - `no_patterns`: array containing subexpressions to be excluded from inferred patterns.
2093 /// - `num_decls`: number of variables to be bound.
2094 /// - `sorts`: array of sorts of the bound variables.
2095 /// - `decl_names`: names of the bound variables.
2096 /// - `body`: the body of the quantifier.
2097 ///
2098 /// # See also
2099 ///
2100 /// - [`Z3_mk_pattern`]
2101 /// - [`Z3_mk_bound`]
2102 /// - [`Z3_mk_forall`]
2103 /// - [`Z3_mk_exists`]
2104 pub fn Z3_mk_quantifier_ex(
2105 c: Z3_context,
2106 is_forall: bool,
2107 weight: ::core::ffi::c_uint,
2108 quantifier_id: Z3_symbol,
2109 skolem_id: Z3_symbol,
2110 num_patterns: ::core::ffi::c_uint,
2111 patterns: *const Z3_pattern,
2112 num_no_patterns: ::core::ffi::c_uint,
2113 no_patterns: *const Z3_ast,
2114 num_decls: ::core::ffi::c_uint,
2115 sorts: *const Z3_sort,
2116 decl_names: *const Z3_symbol,
2117 body: Z3_ast,
2118 ) -> Option<Z3_ast>;
2119 /// Create a universal quantifier using a list of constants that
2120 /// will form the set of bound variables.
2121 ///
2122 /// - `c`: logical context.
2123 /// - `weight`: quantifiers are associated with weights indicating the importance of using
2124 /// the quantifier during instantiation. By default, pass the weight 0.
2125 /// - `num_bound`: number of constants to be abstracted into bound variables.
2126 /// - `bound`: array of constants to be abstracted into bound variables.
2127 /// - `num_patterns`: number of patterns.
2128 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
2129 /// - `body`: the body of the quantifier.
2130 ///
2131 /// # See also
2132 ///
2133 /// - [`Z3_mk_pattern`]
2134 /// - [`Z3_mk_exists_const`]
2135 pub fn Z3_mk_forall_const(
2136 c: Z3_context,
2137 weight: ::core::ffi::c_uint,
2138 num_bound: ::core::ffi::c_uint,
2139 bound: *const Z3_app,
2140 num_patterns: ::core::ffi::c_uint,
2141 patterns: *const Z3_pattern,
2142 body: Z3_ast,
2143 ) -> Option<Z3_ast>;
2144 /// Similar to [`Z3_mk_forall_const`].
2145 ///
2146 /// Create an existential quantifier using a list of constants that
2147 /// will form the set of bound variables.
2148 ///
2149 /// - `c`: logical context.
2150 /// - `weight`: quantifiers are associated with weights indicating the importance of using
2151 /// the quantifier during instantiation. By default, pass the weight 0.
2152 /// - `num_bound`: number of constants to be abstracted into bound variables.
2153 /// - `bound`: array of constants to be abstracted into bound variables.
2154 /// - `num_patterns`: number of patterns.
2155 /// - `patterns`: array containing the patterns created using [`Z3_mk_pattern`].
2156 /// - `body`: the body of the quantifier.
2157 ///
2158 /// # See also
2159 ///
2160 /// - [`Z3_mk_pattern`]
2161 /// - [`Z3_mk_forall_const`]
2162 pub fn Z3_mk_exists_const(
2163 c: Z3_context,
2164 weight: ::core::ffi::c_uint,
2165 num_bound: ::core::ffi::c_uint,
2166 bound: *const Z3_app,
2167 num_patterns: ::core::ffi::c_uint,
2168 patterns: *const Z3_pattern,
2169 body: Z3_ast,
2170 ) -> Option<Z3_ast>;
2171 /// Create a universal or existential quantifier using a list of
2172 /// constants that will form the set of bound variables.
2173 pub fn Z3_mk_quantifier_const(
2174 c: Z3_context,
2175 is_forall: bool,
2176 weight: ::core::ffi::c_uint,
2177 num_bound: ::core::ffi::c_uint,
2178 bound: *const Z3_app,
2179 num_patterns: ::core::ffi::c_uint,
2180 patterns: *const Z3_pattern,
2181 body: Z3_ast,
2182 ) -> Option<Z3_ast>;
2183 /// Create a universal or existential quantifier using a list of
2184 /// constants that will form the set of bound variables.
2185 pub fn Z3_mk_quantifier_const_ex(
2186 c: Z3_context,
2187 is_forall: bool,
2188 weight: ::core::ffi::c_uint,
2189 quantifier_id: Z3_symbol,
2190 skolem_id: Z3_symbol,
2191 num_bound: ::core::ffi::c_uint,
2192 bound: *const Z3_app,
2193 num_patterns: ::core::ffi::c_uint,
2194 patterns: *const Z3_pattern,
2195 num_no_patterns: ::core::ffi::c_uint,
2196 no_patterns: *const Z3_ast,
2197 body: Z3_ast,
2198 ) -> Option<Z3_ast>;
2199 /// Create a lambda expression. It takes an expression `body` that contains bound variables
2200 /// of the same sorts as the sorts listed in the array `sorts`. The bound variables are de-Bruijn indices created
2201 /// using [`Z3_mk_bound`]. The array `decl_names` contains the names that the quantified formula uses for the
2202 /// bound variables. Z3 applies the convention that the last element in the `decl_names` and `sorts` array
2203 /// refers to the variable with index 0, the second to last element of `decl_names` and `sorts` refers
2204 /// to the variable with index 1, etc.
2205 /// The sort of the resulting expression is `(Array sorts range)` where `range` is the sort of `body`.
2206 /// For example, if the lambda binds two variables of sort `Int` and `Bool`, and the `body` has sort `Real`,
2207 /// the sort of the expression is `(Array Int Bool Real)`.
2208 ///
2209 /// - `c`: logical context
2210 /// - `num_decls`: number of variables to be bound.
2211 /// - `sorts`: the sorts of the bound variables.
2212 /// - `decl_names`: names of the bound variables
2213 /// - `body`: the body of the lambda expression.
2214 ///
2215 /// # See also
2216 ///
2217 /// - [`Z3_mk_bound`]
2218 /// - [`Z3_mk_forall`]
2219 /// - [`Z3_mk_lambda_const`]
2220 pub fn Z3_mk_lambda(
2221 c: Z3_context,
2222 num_decls: ::core::ffi::c_uint,
2223 sorts: *const Z3_sort,
2224 decl_names: *const Z3_symbol,
2225 body: Z3_ast,
2226 ) -> Option<Z3_ast>;
2227 /// Create a lambda expression using a list of constants that form the set
2228 /// of bound variables
2229 ///
2230 /// - `c`: logical context.
2231 /// - `num_bound`: number of constants to be abstracted into bound variables.
2232 /// - `bound`: array of constants to be abstracted into bound variables.
2233 /// - `body`: the body of the lambda expression.
2234 ///
2235 /// # See also
2236 ///
2237 /// - [`Z3_mk_bound`]
2238 /// - [`Z3_mk_forall`]
2239 /// - [`Z3_mk_lambda`]
2240 pub fn Z3_mk_lambda_const(
2241 c: Z3_context,
2242 num_bound: ::core::ffi::c_uint,
2243 bound: *const Z3_app,
2244 body: Z3_ast,
2245 ) -> Option<Z3_ast>;
2246 /// Return `Z3_INT_SYMBOL` if the symbol was constructed
2247 /// using [`Z3_mk_int_symbol`], and `Z3_STRING_SYMBOL` if the symbol
2248 /// was constructed using [`Z3_mk_string_symbol`].
2249 pub fn Z3_get_symbol_kind(c: Z3_context, s: Z3_symbol) -> Z3_symbol_kind;
2250 /// Return the symbol int value.
2251 ///
2252 /// # Preconditions
2253 ///
2254 /// - `Z3_get_symbol_kind(s) == Z3_INT_SYMBOL`
2255 ///
2256 /// # See also
2257 ///
2258 /// - [`Z3_mk_int_symbol`]
2259 pub fn Z3_get_symbol_int(c: Z3_context, s: Z3_symbol) -> ::core::ffi::c_int;
2260 /// Return the symbol name.
2261 ///
2262 ///
2263 /// \warning The returned buffer is statically allocated by Z3. It will
2264 /// be automatically deallocated when [`Z3_del_context`] is invoked.
2265 /// So, the buffer is invalidated in the next call to `Z3_get_symbol_string`.
2266 ///
2267 /// # Preconditions
2268 ///
2269 /// - `Z3_get_symbol_kind(s) == Z3_STRING_SYMBOL`
2270 ///
2271 /// # See also
2272 ///
2273 /// - [`Z3_mk_string_symbol`]
2274 pub fn Z3_get_symbol_string(c: Z3_context, s: Z3_symbol) -> Z3_string;
2275 /// Return the sort name as a symbol.
2276 pub fn Z3_get_sort_name(c: Z3_context, d: Z3_sort) -> Option<Z3_symbol>;
2277 /// Return a unique identifier for `s`.
2278 pub fn Z3_get_sort_id(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
2279 /// Convert a `Z3_sort` into `Z3_ast`. This is just type casting.
2280 pub fn Z3_sort_to_ast(c: Z3_context, s: Z3_sort) -> Option<Z3_ast>;
2281 /// compare sorts.
2282 pub fn Z3_is_eq_sort(c: Z3_context, s1: Z3_sort, s2: Z3_sort) -> bool;
2283 /// Return the sort kind (e.g., array, tuple, int, bool, etc).
2284 ///
2285 /// # See also
2286 ///
2287 /// - [`Z3_sort_kind`]
2288 pub fn Z3_get_sort_kind(c: Z3_context, t: Z3_sort) -> Z3_sort_kind;
2289 /// Return the size of the given bit-vector sort.
2290 ///
2291 /// # Preconditions
2292 ///
2293 /// - `Z3_get_sort_kind(c, t) == Z3_BV_SORT`
2294 ///
2295 /// # See also
2296 ///
2297 /// - [`Z3_mk_bv_sort`]
2298 /// - [`Z3_get_sort_kind`]
2299 pub fn Z3_get_bv_sort_size(c: Z3_context, t: Z3_sort) -> ::core::ffi::c_uint;
2300 /// Store the size of the sort in `r`. Return `false` if the call failed.
2301 /// That is, Z3_get_sort_kind(s) == Z3_FINITE_DOMAIN_SORT
2302 pub fn Z3_get_finite_domain_sort_size(
2303 c: Z3_context,
2304 s: Z3_sort,
2305 r: *mut u64,
2306 ) -> bool;
2307 /// Return the arity (number of dimensions) of the given array sort.
2308 ///
2309 /// # Preconditions
2310 ///
2311 /// - `Z3_get_sort_kind(s) == Z3_ARRAY_SORT`
2312 ///
2313 /// # See also
2314 ///
2315 /// - [`Z3_get_array_sort_domain_n`]
2316 pub fn Z3_get_array_arity(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
2317 /// Return the domain of the given array sort.
2318 /// In the case of a multi-dimensional array, this function returns the sort of the first dimension.
2319 ///
2320 /// # Preconditions
2321 ///
2322 /// - `Z3_get_sort_kind(c, t) == Z3_ARRAY_SORT`
2323 ///
2324 /// # See also
2325 ///
2326 /// - [`Z3_mk_array_sort`]
2327 /// - [`Z3_get_sort_kind`]
2328 /// - [`Z3_get_array_sort_domain_n`]
2329 pub fn Z3_get_array_sort_domain(c: Z3_context, t: Z3_sort) -> Option<Z3_sort>;
2330 /// Return the i'th domain sort of an n-dimensional array.
2331 ///
2332 /// # Preconditions
2333 ///
2334 /// - `Z3_get_sort_kind(c, t) == Z3_ARRAY_SORT`
2335 ///
2336 /// # See also
2337 ///
2338 /// - [`Z3_mk_array_sort`]
2339 /// - [`Z3_get_sort_kind`]
2340 /// - [`Z3_get_array_sort_domain`]
2341 pub fn Z3_get_array_sort_domain_n(
2342 c: Z3_context,
2343 t: Z3_sort,
2344 idx: ::core::ffi::c_uint,
2345 ) -> Option<Z3_sort>;
2346 /// Return the range of the given array sort.
2347 ///
2348 /// # Preconditions
2349 ///
2350 /// - `Z3_get_sort_kind(c, t) == Z3_ARRAY_SORT`
2351 ///
2352 /// # See also
2353 ///
2354 /// - [`Z3_mk_array_sort`]
2355 /// - [`Z3_get_sort_kind`]
2356 pub fn Z3_get_array_sort_range(c: Z3_context, t: Z3_sort) -> Option<Z3_sort>;
2357 /// Return the constructor declaration of the given tuple
2358 /// sort.
2359 ///
2360 /// # Preconditions
2361 ///
2362 /// - `Z3_get_sort_kind(c, t) == Z3_DATATYPE_SORT`
2363 ///
2364 /// # See also
2365 ///
2366 /// - [`Z3_mk_tuple_sort`]
2367 /// - [`Z3_get_sort_kind`]
2368 pub fn Z3_get_tuple_sort_mk_decl(c: Z3_context, t: Z3_sort) -> Option<Z3_func_decl>;
2369 /// Return the number of fields of the given tuple sort.
2370 ///
2371 /// # Preconditions
2372 ///
2373 /// - `Z3_get_sort_kind(c, t) == Z3_DATATYPE_SORT`
2374 ///
2375 /// # See also
2376 ///
2377 /// - [`Z3_mk_tuple_sort`]
2378 /// - [`Z3_get_sort_kind`]
2379 pub fn Z3_get_tuple_sort_num_fields(
2380 c: Z3_context,
2381 t: Z3_sort,
2382 ) -> ::core::ffi::c_uint;
2383 /// Return the i-th field declaration (i.e., projection function declaration)
2384 /// of the given tuple sort.
2385 ///
2386 /// # Preconditions
2387 ///
2388 /// - `Z3_get_sort_kind(t) == Z3_DATATYPE_SORT`
2389 /// - `i < Z3_get_tuple_sort_num_fields(c, t)`
2390 ///
2391 /// # See also
2392 ///
2393 /// - [`Z3_mk_tuple_sort`]
2394 /// - [`Z3_get_sort_kind`]
2395 pub fn Z3_get_tuple_sort_field_decl(
2396 c: Z3_context,
2397 t: Z3_sort,
2398 i: ::core::ffi::c_uint,
2399 ) -> Option<Z3_func_decl>;
2400 /// Check if `s` is a recursive datatype sort.
2401 pub fn Z3_is_recursive_datatype_sort(c: Z3_context, s: Z3_sort) -> bool;
2402 /// Return number of constructors for datatype.
2403 ///
2404 /// # Preconditions
2405 ///
2406 /// - `Z3_get_sort_kind(t) == Z3_DATATYPE_SORT`
2407 ///
2408 /// # See also
2409 ///
2410 /// - [`Z3_get_datatype_sort_constructor`]
2411 /// - [`Z3_get_datatype_sort_recognizer`]
2412 /// - [`Z3_get_datatype_sort_constructor_accessor`]
2413 pub fn Z3_get_datatype_sort_num_constructors(
2414 c: Z3_context,
2415 t: Z3_sort,
2416 ) -> ::core::ffi::c_uint;
2417 /// Return idx'th constructor.
2418 ///
2419 /// # Preconditions
2420 ///
2421 /// - `Z3_get_sort_kind(t) == Z3_DATATYPE_SORT`
2422 /// - `idx < Z3_get_datatype_sort_num_constructors(c, t)`
2423 ///
2424 /// # See also
2425 ///
2426 /// - [`Z3_get_datatype_sort_num_constructors`]
2427 /// - [`Z3_get_datatype_sort_recognizer`]
2428 /// - [`Z3_get_datatype_sort_constructor_accessor`]
2429 pub fn Z3_get_datatype_sort_constructor(
2430 c: Z3_context,
2431 t: Z3_sort,
2432 idx: ::core::ffi::c_uint,
2433 ) -> Option<Z3_func_decl>;
2434 /// Return idx'th recognizer.
2435 ///
2436 /// # Preconditions
2437 ///
2438 /// - `Z3_get_sort_kind(t) == Z3_DATATYPE_SORT`
2439 /// - `idx < Z3_get_datatype_sort_num_constructors(c, t)`
2440 ///
2441 /// # See also
2442 ///
2443 /// - [`Z3_get_datatype_sort_num_constructors`]
2444 /// - [`Z3_get_datatype_sort_constructor`]
2445 /// - [`Z3_get_datatype_sort_constructor_accessor`]
2446 pub fn Z3_get_datatype_sort_recognizer(
2447 c: Z3_context,
2448 t: Z3_sort,
2449 idx: ::core::ffi::c_uint,
2450 ) -> Option<Z3_func_decl>;
2451 /// Return idx_a'th accessor for the idx_c'th constructor.
2452 ///
2453 /// # Preconditions
2454 ///
2455 /// - `Z3_get_sort_kind(t) == Z3_DATATYPE_SORT`
2456 /// - `idx_c < Z3_get_datatype_sort_num_constructors(c, t)`
2457 /// - `idx_a < Z3_get_domain_size(c, Z3_get_datatype_sort_constructor(c, idx_c))`
2458 ///
2459 /// # See also
2460 ///
2461 /// - [`Z3_get_datatype_sort_num_constructors`]
2462 /// - [`Z3_get_datatype_sort_constructor`]
2463 /// - [`Z3_get_datatype_sort_recognizer`]
2464 pub fn Z3_get_datatype_sort_constructor_accessor(
2465 c: Z3_context,
2466 t: Z3_sort,
2467 idx_c: ::core::ffi::c_uint,
2468 idx_a: ::core::ffi::c_uint,
2469 ) -> Option<Z3_func_decl>;
2470 /// Update record field with a value.
2471 ///
2472 /// This corresponds to the 'with' construct in OCaml.
2473 /// It has the effect of updating a record field with a given value.
2474 /// The remaining fields are left unchanged. It is the record
2475 /// equivalent of an array store (see \sa Z3_mk_store).
2476 /// If the datatype has more than one constructor, then the update function
2477 /// behaves as identity if there is a mismatch between the accessor and
2478 /// constructor. For example ((_ update-field car) nil 1) is nil,
2479 /// while ((_ update-field car) (cons 2 nil) 1) is (cons 1 nil).
2480 ///
2481 /// # Preconditions
2482 ///
2483 /// - `Z3_get_sort_kind(Z3_get_sort(c, t)) == Z3_get_domain(c, field_access, 1) == Z3_DATATYPE_SORT`
2484 /// - `Z3_get_sort(c, value) == Z3_get_range(c, field_access)`
2485 pub fn Z3_datatype_update_field(
2486 c: Z3_context,
2487 field_access: Z3_func_decl,
2488 t: Z3_ast,
2489 value: Z3_ast,
2490 ) -> Option<Z3_ast>;
2491 /// Return arity of relation.
2492 ///
2493 /// # Preconditions
2494 ///
2495 /// - `Z3_get_sort_kind(s) == Z3_RELATION_SORT`
2496 ///
2497 /// # See also
2498 ///
2499 /// - [`Z3_get_relation_column`]
2500 pub fn Z3_get_relation_arity(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
2501 /// Return sort at i'th column of relation sort.
2502 ///
2503 /// # Preconditions
2504 ///
2505 /// - `Z3_get_sort_kind(c, s) == Z3_RELATION_SORT`
2506 /// - `col < Z3_get_relation_arity(c, s)`
2507 ///
2508 /// # See also
2509 ///
2510 /// - [`Z3_get_relation_arity`]
2511 pub fn Z3_get_relation_column(
2512 c: Z3_context,
2513 s: Z3_sort,
2514 col: ::core::ffi::c_uint,
2515 ) -> Option<Z3_sort>;
2516 /// Pseudo-Boolean relations.
2517 ///
2518 /// Encode p1 + p2 + ... + pn <= k
2519 pub fn Z3_mk_atmost(
2520 c: Z3_context,
2521 num_args: ::core::ffi::c_uint,
2522 args: *const Z3_ast,
2523 k: ::core::ffi::c_uint,
2524 ) -> Option<Z3_ast>;
2525 /// Pseudo-Boolean relations.
2526 ///
2527 /// Encode p1 + p2 + ... + pn >= k
2528 pub fn Z3_mk_atleast(
2529 c: Z3_context,
2530 num_args: ::core::ffi::c_uint,
2531 args: *const Z3_ast,
2532 k: ::core::ffi::c_uint,
2533 ) -> Option<Z3_ast>;
2534 /// Pseudo-Boolean relations.
2535 ///
2536 /// Encode k1*p1 + k2*p2 + ... + kn*pn <= k
2537 pub fn Z3_mk_pble(
2538 c: Z3_context,
2539 num_args: ::core::ffi::c_uint,
2540 args: *const Z3_ast,
2541 coeffs: *const ::core::ffi::c_int,
2542 k: ::core::ffi::c_int,
2543 ) -> Option<Z3_ast>;
2544 /// Pseudo-Boolean relations.
2545 ///
2546 /// Encode k1*p1 + k2*p2 + ... + kn*pn >= k
2547 pub fn Z3_mk_pbge(
2548 c: Z3_context,
2549 num_args: ::core::ffi::c_uint,
2550 args: *const Z3_ast,
2551 coeffs: *const ::core::ffi::c_int,
2552 k: ::core::ffi::c_int,
2553 ) -> Option<Z3_ast>;
2554 /// Pseudo-Boolean relations.
2555 ///
2556 /// Encode k1*p1 + k2*p2 + ... + kn*pn = k
2557 pub fn Z3_mk_pbeq(
2558 c: Z3_context,
2559 num_args: ::core::ffi::c_uint,
2560 args: *const Z3_ast,
2561 coeffs: *const ::core::ffi::c_int,
2562 k: ::core::ffi::c_int,
2563 ) -> Option<Z3_ast>;
2564 /// Convert a `Z3_func_decl` into `Z3_ast`. This is just type casting.
2565 pub fn Z3_func_decl_to_ast(c: Z3_context, f: Z3_func_decl) -> Option<Z3_ast>;
2566 /// Compare terms.
2567 pub fn Z3_is_eq_func_decl(c: Z3_context, f1: Z3_func_decl, f2: Z3_func_decl) -> bool;
2568 /// Return a unique identifier for `f`.
2569 pub fn Z3_get_func_decl_id(c: Z3_context, f: Z3_func_decl) -> ::core::ffi::c_uint;
2570 /// Return the constant declaration name as a symbol.
2571 pub fn Z3_get_decl_name(c: Z3_context, d: Z3_func_decl) -> Option<Z3_symbol>;
2572 /// Return declaration kind corresponding to declaration.
2573 pub fn Z3_get_decl_kind(c: Z3_context, d: Z3_func_decl) -> Z3_decl_kind;
2574 /// Return the number of parameters of the given declaration.
2575 ///
2576 /// # See also
2577 ///
2578 /// - [`Z3_get_arity`]
2579 pub fn Z3_get_domain_size(c: Z3_context, d: Z3_func_decl) -> ::core::ffi::c_uint;
2580 /// Alias for `Z3_get_domain_size`.
2581 ///
2582 /// # See also
2583 ///
2584 /// - [`Z3_get_domain_size`]
2585 pub fn Z3_get_arity(c: Z3_context, d: Z3_func_decl) -> ::core::ffi::c_uint;
2586 /// Return the sort of the i-th parameter of the given function declaration.
2587 ///
2588 /// # Preconditions
2589 ///
2590 /// - `i < Z3_get_domain_size(d)`
2591 ///
2592 /// # See also
2593 ///
2594 /// - [`Z3_get_domain_size`]
2595 pub fn Z3_get_domain(
2596 c: Z3_context,
2597 d: Z3_func_decl,
2598 i: ::core::ffi::c_uint,
2599 ) -> Option<Z3_sort>;
2600 /// Return the range of the given declaration.
2601 ///
2602 /// If `d` is a constant (i.e., has zero arguments), then this
2603 /// function returns the sort of the constant.
2604 pub fn Z3_get_range(c: Z3_context, d: Z3_func_decl) -> Option<Z3_sort>;
2605 /// Return the number of parameters associated with a declaration.
2606 pub fn Z3_get_decl_num_parameters(
2607 c: Z3_context,
2608 d: Z3_func_decl,
2609 ) -> ::core::ffi::c_uint;
2610 /// Return the parameter type associated with a declaration.
2611 ///
2612 /// - `c`: the context
2613 /// - `d`: the function declaration
2614 /// - `idx`: is the index of the named parameter it should be between 0 and the number of parameters.
2615 pub fn Z3_get_decl_parameter_kind(
2616 c: Z3_context,
2617 d: Z3_func_decl,
2618 idx: ::core::ffi::c_uint,
2619 ) -> Z3_parameter_kind;
2620 /// Return the integer value associated with an integer parameter.
2621 ///
2622 /// # Preconditions
2623 ///
2624 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_INT`
2625 pub fn Z3_get_decl_int_parameter(
2626 c: Z3_context,
2627 d: Z3_func_decl,
2628 idx: ::core::ffi::c_uint,
2629 ) -> ::core::ffi::c_int;
2630 /// Return the double value associated with an double parameter.
2631 ///
2632 /// # Preconditions
2633 ///
2634 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_DOUBLE`
2635 pub fn Z3_get_decl_double_parameter(
2636 c: Z3_context,
2637 d: Z3_func_decl,
2638 idx: ::core::ffi::c_uint,
2639 ) -> f64;
2640 /// Return the double value associated with an double parameter.
2641 ///
2642 /// # Preconditions
2643 ///
2644 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SYMBOL`
2645 pub fn Z3_get_decl_symbol_parameter(
2646 c: Z3_context,
2647 d: Z3_func_decl,
2648 idx: ::core::ffi::c_uint,
2649 ) -> Option<Z3_symbol>;
2650 /// Return the sort value associated with a sort parameter.
2651 ///
2652 /// # Preconditions
2653 ///
2654 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_SORT`
2655 pub fn Z3_get_decl_sort_parameter(
2656 c: Z3_context,
2657 d: Z3_func_decl,
2658 idx: ::core::ffi::c_uint,
2659 ) -> Option<Z3_sort>;
2660 /// Return the expression value associated with an expression parameter.
2661 ///
2662 /// # Preconditions
2663 ///
2664 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_AST`
2665 pub fn Z3_get_decl_ast_parameter(
2666 c: Z3_context,
2667 d: Z3_func_decl,
2668 idx: ::core::ffi::c_uint,
2669 ) -> Option<Z3_ast>;
2670 /// Return the expression value associated with an expression parameter.
2671 ///
2672 /// # Preconditions
2673 ///
2674 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_FUNC_DECL`
2675 pub fn Z3_get_decl_func_decl_parameter(
2676 c: Z3_context,
2677 d: Z3_func_decl,
2678 idx: ::core::ffi::c_uint,
2679 ) -> Option<Z3_func_decl>;
2680 /// Return the rational value, as a string, associated with a rational parameter.
2681 ///
2682 /// # Preconditions
2683 ///
2684 /// - `Z3_get_decl_parameter_kind(c, d, idx) == Z3_PARAMETER_RATIONAL`
2685 pub fn Z3_get_decl_rational_parameter(
2686 c: Z3_context,
2687 d: Z3_func_decl,
2688 idx: ::core::ffi::c_uint,
2689 ) -> Z3_string;
2690 /// Convert a `Z3_app` into `Z3_ast`. This is just type casting.
2691 pub fn Z3_app_to_ast(c: Z3_context, a: Z3_app) -> Option<Z3_ast>;
2692 /// Return the declaration of a constant or function application.
2693 pub fn Z3_get_app_decl(c: Z3_context, a: Z3_app) -> Option<Z3_func_decl>;
2694 /// Return the number of argument of an application. If `t`
2695 /// is an constant, then the number of arguments is 0.
2696 ///
2697 /// # See also
2698 ///
2699 /// - [`Z3_get_app_arg`]
2700 pub fn Z3_get_app_num_args(c: Z3_context, a: Z3_app) -> ::core::ffi::c_uint;
2701 /// Return the i-th argument of the given application.
2702 ///
2703 /// # Preconditions
2704 ///
2705 /// - `i < Z3_get_app_num_args(c, a)`
2706 ///
2707 /// # See also
2708 ///
2709 /// - [`Z3_get_app_num_args`]
2710 pub fn Z3_get_app_arg(
2711 c: Z3_context,
2712 a: Z3_app,
2713 i: ::core::ffi::c_uint,
2714 ) -> Option<Z3_ast>;
2715 /// Compare terms.
2716 pub fn Z3_is_eq_ast(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> bool;
2717 /// Return a unique identifier for `t`.
2718 /// The identifier is unique up to structural equality. Thus, two ast nodes
2719 /// created by the same context and having the same children and same function symbols
2720 /// have the same identifiers. Ast nodes created in the same context, but having
2721 /// different children or different functions have different identifiers.
2722 /// Variables and quantifiers are also assigned different identifiers according to
2723 /// their structure.
2724 pub fn Z3_get_ast_id(c: Z3_context, t: Z3_ast) -> ::core::ffi::c_uint;
2725 /// Return a hash code for the given AST.
2726 /// The hash code is structural but two different AST objects can map to the same hash.
2727 /// The result of `Z3_get_ast_id` returns an identifier that is unique over the
2728 /// set of live AST objects.
2729 pub fn Z3_get_ast_hash(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
2730 /// Return the sort of an AST node.
2731 ///
2732 /// The AST node must be a constant, application, numeral, bound variable, or quantifier.
2733 pub fn Z3_get_sort(c: Z3_context, a: Z3_ast) -> Option<Z3_sort>;
2734 /// Return `true` if the given expression `t` is well sorted.
2735 pub fn Z3_is_well_sorted(c: Z3_context, t: Z3_ast) -> bool;
2736 /// Return `Z3_L_TRUE` if `a` is true, `Z3_L_FALSE` if it is false, and `Z3_L_UNDEF` otherwise.
2737 pub fn Z3_get_bool_value(c: Z3_context, a: Z3_ast) -> Z3_lbool;
2738 /// Return the kind of the given AST.
2739 pub fn Z3_get_ast_kind(c: Z3_context, a: Z3_ast) -> Z3_ast_kind;
2740 pub fn Z3_is_app(c: Z3_context, a: Z3_ast) -> bool;
2741 pub fn Z3_is_ground(c: Z3_context, a: Z3_ast) -> bool;
2742 pub fn Z3_get_depth(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
2743 pub fn Z3_is_numeral_ast(c: Z3_context, a: Z3_ast) -> bool;
2744 /// Return `true` if the given AST is a real algebraic number.
2745 pub fn Z3_is_algebraic_number(c: Z3_context, a: Z3_ast) -> bool;
2746 /// Convert an `ast` into an `APP_AST`. This is just type casting.
2747 ///
2748 /// # Preconditions
2749 ///
2750 /// - ``Z3_get_ast_kind(c, a) == `Z3_APP_AST```
2751 pub fn Z3_to_app(c: Z3_context, a: Z3_ast) -> Option<Z3_app>;
2752 /// Convert an AST into a FUNC_DECL_AST. This is just type casting.
2753 ///
2754 /// # Preconditions
2755 ///
2756 /// - ``Z3_get_ast_kind(c, a) == Z3_FUNC_DECL_AST``
2757 pub fn Z3_to_func_decl(c: Z3_context, a: Z3_ast) -> Option<Z3_func_decl>;
2758 /// Return numeral value, as a decimal string of a numeric constant term
2759 ///
2760 /// # Preconditions
2761 ///
2762 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST`
2763 pub fn Z3_get_numeral_string(c: Z3_context, a: Z3_ast) -> Z3_string;
2764 /// Return numeral value, as a binary string of a numeric constant term
2765 ///
2766 /// # Preconditions
2767 ///
2768 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST`
2769 /// - `a represents a non-negative integer`
2770 pub fn Z3_get_numeral_binary_string(c: Z3_context, a: Z3_ast) -> Z3_string;
2771 /// Return numeral as a string in decimal notation.
2772 /// The result has at most `precision` decimal places.
2773 ///
2774 /// # Preconditions
2775 ///
2776 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST || Z3_is_algebraic_number(c, a)`
2777 pub fn Z3_get_numeral_decimal_string(
2778 c: Z3_context,
2779 a: Z3_ast,
2780 precision: ::core::ffi::c_uint,
2781 ) -> Z3_string;
2782 /// Return numeral as a double.
2783 ///
2784 /// # Preconditions
2785 ///
2786 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST || Z3_is_algebraic_number(c, a)`
2787 pub fn Z3_get_numeral_double(c: Z3_context, a: Z3_ast) -> f64;
2788 /// Return the numerator (as a numeral AST) of a numeral AST of sort Real.
2789 ///
2790 /// # Preconditions
2791 ///
2792 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST`
2793 pub fn Z3_get_numerator(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
2794 /// Return the denominator (as a numeral AST) of a numeral AST of sort Real.
2795 ///
2796 /// # Preconditions
2797 ///
2798 /// - `Z3_get_ast_kind(c, a) == Z3_NUMERAL_AST`
2799 pub fn Z3_get_denominator(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
2800 /// Return numeral value, as a pair of 64 bit numbers if the representation fits.
2801 ///
2802 /// - `c`: logical context.
2803 /// - `a`: term.
2804 /// - `num`: numerator.
2805 /// - `den`: denominator.
2806 ///
2807 /// Return `true` if the numeral value fits in 64 bit numerals, `false` otherwise.
2808 ///
2809 /// Equivalent to `Z3_get_numeral_rational_int64` except that for unsupported expression arguments `Z3_get_numeral_small` signals an error while `Z3_get_numeral_rational_int64` returns `false`.
2810 ///
2811 /// # Preconditions
2812 ///
2813 /// - `Z3_get_ast_kind(a) == Z3_NUMERAL_AST`
2814 pub fn Z3_get_numeral_small(
2815 c: Z3_context,
2816 a: Z3_ast,
2817 num: *mut i64,
2818 den: *mut i64,
2819 ) -> bool;
2820 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
2821 /// the value can fit in a machine int. Return `true` if the call succeeded.
2822 ///
2823 /// # Preconditions
2824 ///
2825 /// - `Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST`
2826 ///
2827 /// # See also
2828 ///
2829 /// - [`Z3_get_numeral_string`]
2830 pub fn Z3_get_numeral_int(
2831 c: Z3_context,
2832 v: Z3_ast,
2833 i: *mut ::core::ffi::c_int,
2834 ) -> bool;
2835 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
2836 /// the value can fit in a machine unsigned int. Return `true` if the call succeeded.
2837 ///
2838 /// # Preconditions
2839 ///
2840 /// - `Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST`
2841 ///
2842 /// # See also
2843 ///
2844 /// - [`Z3_get_numeral_string`]
2845 pub fn Z3_get_numeral_uint(
2846 c: Z3_context,
2847 v: Z3_ast,
2848 u: *mut ::core::ffi::c_uint,
2849 ) -> bool;
2850 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
2851 /// the value can fit in a machine `uint64_t` int. Return `true` if the call succeeded.
2852 ///
2853 /// # Preconditions
2854 ///
2855 /// - `Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST`
2856 ///
2857 /// # See also
2858 ///
2859 /// - [`Z3_get_numeral_string`]
2860 pub fn Z3_get_numeral_uint64(c: Z3_context, v: Z3_ast, u: *mut u64) -> bool;
2861 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
2862 /// the value can fit in a machine `int64_t` int. Return `true` if the call succeeded.
2863 ///
2864 /// # Preconditions
2865 ///
2866 /// - `Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST`
2867 ///
2868 /// # See also
2869 ///
2870 /// - [`Z3_get_numeral_string`]
2871 pub fn Z3_get_numeral_int64(c: Z3_context, v: Z3_ast, i: *mut i64) -> bool;
2872 /// Similar to [`Z3_get_numeral_string`], but only succeeds if
2873 /// the value can fit as a rational number as machine `int64_t` int. Return `true` if the call succeeded.
2874 ///
2875 /// # Preconditions
2876 ///
2877 /// - `Z3_get_ast_kind(c, v) == Z3_NUMERAL_AST`
2878 ///
2879 /// # See also
2880 ///
2881 /// - [`Z3_get_numeral_string`]
2882 pub fn Z3_get_numeral_rational_int64(
2883 c: Z3_context,
2884 v: Z3_ast,
2885 num: *mut i64,
2886 den: *mut i64,
2887 ) -> bool;
2888 /// Return a lower bound for the given real algebraic number.
2889 /// The interval isolating the number is smaller than 1/10^precision.
2890 /// The result is a numeral AST of sort Real.
2891 ///
2892 /// # Preconditions
2893 ///
2894 /// - `Z3_is_algebraic_number(c, a)`
2895 pub fn Z3_get_algebraic_number_lower(
2896 c: Z3_context,
2897 a: Z3_ast,
2898 precision: ::core::ffi::c_uint,
2899 ) -> Option<Z3_ast>;
2900 /// Return a upper bound for the given real algebraic number.
2901 /// The interval isolating the number is smaller than 1/10^precision.
2902 /// The result is a numeral AST of sort Real.
2903 ///
2904 /// # Preconditions
2905 ///
2906 /// - `Z3_is_algebraic_number(c, a)`
2907 pub fn Z3_get_algebraic_number_upper(
2908 c: Z3_context,
2909 a: Z3_ast,
2910 precision: ::core::ffi::c_uint,
2911 ) -> Option<Z3_ast>;
2912 /// Convert a Z3_pattern into Z3_ast. This is just type casting.
2913 pub fn Z3_pattern_to_ast(c: Z3_context, p: Z3_pattern) -> Option<Z3_ast>;
2914 /// Return number of terms in pattern.
2915 pub fn Z3_get_pattern_num_terms(c: Z3_context, p: Z3_pattern) -> ::core::ffi::c_uint;
2916 /// Return i'th ast in pattern.
2917 pub fn Z3_get_pattern(
2918 c: Z3_context,
2919 p: Z3_pattern,
2920 idx: ::core::ffi::c_uint,
2921 ) -> Option<Z3_ast>;
2922 /// Return index of de-Bruijn bound variable.
2923 ///
2924 /// # Preconditions
2925 ///
2926 /// - `Z3_get_ast_kind(a) == Z3_VAR_AST`
2927 pub fn Z3_get_index_value(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
2928 /// Determine if an ast is a universal quantifier.
2929 pub fn Z3_is_quantifier_forall(c: Z3_context, a: Z3_ast) -> bool;
2930 /// Determine if ast is an existential quantifier.
2931 pub fn Z3_is_quantifier_exists(c: Z3_context, a: Z3_ast) -> bool;
2932 /// Determine if ast is a lambda expression.
2933 ///
2934 /// # Preconditions
2935 ///
2936 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2937 pub fn Z3_is_lambda(c: Z3_context, a: Z3_ast) -> bool;
2938 /// Obtain weight of quantifier.
2939 ///
2940 /// # Preconditions
2941 ///
2942 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2943 pub fn Z3_get_quantifier_weight(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
2944 /// Obtain skolem id of quantifier.
2945 ///
2946 /// # Preconditions
2947 ///
2948 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2949 pub fn Z3_get_quantifier_skolem_id(c: Z3_context, a: Z3_ast) -> Option<Z3_symbol>;
2950 /// Obtain id of quantifier.
2951 ///
2952 /// # Preconditions
2953 ///
2954 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2955 pub fn Z3_get_quantifier_id(c: Z3_context, a: Z3_ast) -> Option<Z3_symbol>;
2956 /// Return number of patterns used in quantifier.
2957 ///
2958 /// # Preconditions
2959 ///
2960 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2961 pub fn Z3_get_quantifier_num_patterns(
2962 c: Z3_context,
2963 a: Z3_ast,
2964 ) -> ::core::ffi::c_uint;
2965 /// Return i'th pattern.
2966 ///
2967 /// # Preconditions
2968 ///
2969 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2970 pub fn Z3_get_quantifier_pattern_ast(
2971 c: Z3_context,
2972 a: Z3_ast,
2973 i: ::core::ffi::c_uint,
2974 ) -> Option<Z3_pattern>;
2975 /// Return number of no_patterns used in quantifier.
2976 ///
2977 /// # Preconditions
2978 ///
2979 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2980 pub fn Z3_get_quantifier_num_no_patterns(
2981 c: Z3_context,
2982 a: Z3_ast,
2983 ) -> ::core::ffi::c_uint;
2984 /// Return i'th no_pattern.
2985 ///
2986 /// # Preconditions
2987 ///
2988 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2989 pub fn Z3_get_quantifier_no_pattern_ast(
2990 c: Z3_context,
2991 a: Z3_ast,
2992 i: ::core::ffi::c_uint,
2993 ) -> Option<Z3_ast>;
2994 /// Return number of bound variables of quantifier.
2995 ///
2996 /// # Preconditions
2997 ///
2998 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
2999 pub fn Z3_get_quantifier_num_bound(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
3000 /// Return symbol of the i'th bound variable.
3001 ///
3002 /// # Preconditions
3003 ///
3004 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
3005 pub fn Z3_get_quantifier_bound_name(
3006 c: Z3_context,
3007 a: Z3_ast,
3008 i: ::core::ffi::c_uint,
3009 ) -> Option<Z3_symbol>;
3010 /// Return sort of the i'th bound variable.
3011 ///
3012 /// # Preconditions
3013 ///
3014 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
3015 pub fn Z3_get_quantifier_bound_sort(
3016 c: Z3_context,
3017 a: Z3_ast,
3018 i: ::core::ffi::c_uint,
3019 ) -> Option<Z3_sort>;
3020 /// Return body of quantifier.
3021 ///
3022 /// # Preconditions
3023 ///
3024 /// - `Z3_get_ast_kind(a) == Z3_QUANTIFIER_AST`
3025 pub fn Z3_get_quantifier_body(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
3026 /// Interface to simplifier.
3027 ///
3028 /// Provides an interface to the AST simplifier used by Z3.
3029 /// It returns an AST object which is equal to the argument.
3030 /// The returned AST is simplified using algebraic simplification rules,
3031 /// such as constant propagation (propagating true/false over logical connectives).
3032 ///
3033 /// # See also
3034 ///
3035 /// - [`Z3_simplify_ex`]
3036 pub fn Z3_simplify(c: Z3_context, a: Z3_ast) -> Option<Z3_ast>;
3037 /// Interface to simplifier.
3038 ///
3039 /// Provides an interface to the AST simplifier used by Z3.
3040 /// This procedure is similar to [`Z3_simplify`], but the behavior of the simplifier
3041 /// can be configured using the given parameter set.
3042 ///
3043 /// # See also
3044 ///
3045 /// - [`Z3_simplify`]
3046 /// - [`Z3_simplify_get_help`]
3047 /// - [`Z3_simplify_get_param_descrs`]
3048 pub fn Z3_simplify_ex(c: Z3_context, a: Z3_ast, p: Z3_params) -> Option<Z3_ast>;
3049 /// Return a string describing all available parameters.
3050 ///
3051 /// # See also
3052 ///
3053 /// - [`Z3_simplify_ex`]
3054 /// - [`Z3_simplify_get_param_descrs`]
3055 pub fn Z3_simplify_get_help(c: Z3_context) -> Z3_string;
3056 /// Return the parameter description set for the simplify procedure.
3057 ///
3058 /// # See also
3059 ///
3060 /// - [`Z3_simplify_ex`]
3061 /// - [`Z3_simplify_get_help`]
3062 pub fn Z3_simplify_get_param_descrs(c: Z3_context) -> Option<Z3_param_descrs>;
3063 /// Update the arguments of term `a` using the arguments `args`.
3064 /// The number of arguments `num_args` should coincide
3065 /// with the number of arguments to `a`.
3066 /// If `a` is a quantifier, then num_args has to be 1.
3067 pub fn Z3_update_term(
3068 c: Z3_context,
3069 a: Z3_ast,
3070 num_args: ::core::ffi::c_uint,
3071 args: *const Z3_ast,
3072 ) -> Option<Z3_ast>;
3073 /// Substitute every occurrence of `from[i]` in `a` with `to[i]`, for `i` smaller than `num_exprs`.
3074 /// The result is the new AST. The arrays `from` and `to` must have size `num_exprs`.
3075 /// For every `i` smaller than `num_exprs`, we must have that sort of `from[i]` must be equal to sort of `to[i]`.
3076 pub fn Z3_substitute(
3077 c: Z3_context,
3078 a: Z3_ast,
3079 num_exprs: ::core::ffi::c_uint,
3080 from: *const Z3_ast,
3081 to: *const Z3_ast,
3082 ) -> Option<Z3_ast>;
3083 /// Substitute the variables in `a` with the expressions in `to`.
3084 /// For every `i` smaller than `num_exprs`, the variable with de-Bruijn index `i` is replaced with term `to[i]`.
3085 /// Note that a variable is created using the function \ref Z3_mk_bound.
3086 pub fn Z3_substitute_vars(
3087 c: Z3_context,
3088 a: Z3_ast,
3089 num_exprs: ::core::ffi::c_uint,
3090 to: *const Z3_ast,
3091 ) -> Option<Z3_ast>;
3092 /// Substitute functions in `from` with new expressions in `to`.
3093 ///
3094 /// The expressions in `to` can have free variables. The free variable in `to` at index 0
3095 /// refers to the first argument of `from`, the free variable at index 1 corresponds to the second argument.
3096 pub fn Z3_substitute_funs(
3097 c: Z3_context,
3098 a: Z3_ast,
3099 num_funs: ::core::ffi::c_uint,
3100 from: *const Z3_func_decl,
3101 to: *const Z3_ast,
3102 ) -> Option<Z3_ast>;
3103 /// Translate/Copy the AST `a` from context `source` to context `target`.
3104 /// AST `a` must have been created using context `source`.
3105 ///
3106 /// # Preconditions
3107 ///
3108 /// - `source != target`
3109 pub fn Z3_translate(
3110 source: Z3_context,
3111 a: Z3_ast,
3112 target: Z3_context,
3113 ) -> Option<Z3_ast>;
3114 /// Create a fresh model object. It has reference count 0.
3115 pub fn Z3_mk_model(c: Z3_context) -> Option<Z3_model>;
3116 /// Increment the reference counter of the given model.
3117 pub fn Z3_model_inc_ref(c: Z3_context, m: Z3_model);
3118 /// Decrement the reference counter of the given model.
3119 pub fn Z3_model_dec_ref(c: Z3_context, m: Z3_model);
3120 /// Evaluate the AST node `t` in the given model.
3121 /// Return `true` if succeeded, and store the result in `v`.
3122 ///
3123 /// If `model_completion` is `true`, then Z3 will assign an interpretation for any constant or function that does
3124 /// not have an interpretation in `m`. These constants and functions were essentially don't cares.
3125 ///
3126 /// If `model_completion` is `false`, then Z3 will not assign interpretations to constants for functions that do
3127 /// not have interpretations in `m`. Evaluation behaves as the identify function in this case.
3128 ///
3129 /// The evaluation may fail for the following reasons:
3130 ///
3131 /// - `t` contains a quantifier.
3132 ///
3133 /// - the model `m` is partial, that is, it doesn't have a complete interpretation for uninterpreted functions.
3134 /// That is, the option `MODEL_PARTIAL=true` was used.
3135 ///
3136 /// - `t` is type incorrect.
3137 ///
3138 /// - `Z3_interrupt` was invoked during evaluation.
3139 pub fn Z3_model_eval(
3140 c: Z3_context,
3141 m: Z3_model,
3142 t: Z3_ast,
3143 model_completion: bool,
3144 v: *mut Z3_ast,
3145 ) -> bool;
3146 /// Return the interpretation (i.e., assignment) of constant `a` in the model `m`.
3147 /// Return `NULL`, if the model does not assign an interpretation for `a`.
3148 /// That should be interpreted as: the value of `a` does not matter.
3149 ///
3150 /// # Preconditions
3151 ///
3152 /// - `Z3_get_arity(c, a) == 0`
3153 pub fn Z3_model_get_const_interp(
3154 c: Z3_context,
3155 m: Z3_model,
3156 a: Z3_func_decl,
3157 ) -> Option<Z3_ast>;
3158 /// Test if there exists an interpretation (i.e., assignment) for `a` in the model `m`.
3159 pub fn Z3_model_has_interp(c: Z3_context, m: Z3_model, a: Z3_func_decl) -> bool;
3160 /// Return the interpretation of the function `f` in the model `m`.
3161 /// Return `NULL`, if the model does not assign an interpretation for `f`.
3162 /// That should be interpreted as: the `f` does not matter.
3163 ///
3164 ///
3165 /// **Remark:** Reference counting must be used to manage Z3_func_interp objects, even when the Z3_context was
3166 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
3167 ///
3168 /// # Preconditions
3169 ///
3170 /// - `Z3_get_arity(c, f) > 0`
3171 pub fn Z3_model_get_func_interp(
3172 c: Z3_context,
3173 m: Z3_model,
3174 f: Z3_func_decl,
3175 ) -> Option<Z3_func_interp>;
3176 /// Return the number of constants assigned by the given model.
3177 ///
3178 /// # See also
3179 ///
3180 /// - [`Z3_model_get_const_decl`]
3181 pub fn Z3_model_get_num_consts(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
3182 /// Return the i-th constant in the given model.
3183 ///
3184 /// # Preconditions
3185 ///
3186 /// - `i < Z3_model_get_num_consts(c, m)`
3187 ///
3188 /// # See also
3189 ///
3190 /// - [`Z3_model_eval`]
3191 /// - [`Z3_model_get_num_consts`]
3192 pub fn Z3_model_get_const_decl(
3193 c: Z3_context,
3194 m: Z3_model,
3195 i: ::core::ffi::c_uint,
3196 ) -> Option<Z3_func_decl>;
3197 /// Return the number of function interpretations in the given model.
3198 ///
3199 /// A function interpretation is represented as a finite map and an 'else' value.
3200 /// Each entry in the finite map represents the value of a function given a set of arguments.
3201 ///
3202 /// # See also
3203 ///
3204 /// - [`Z3_model_get_func_decl`]
3205 pub fn Z3_model_get_num_funcs(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
3206 /// Return the declaration of the i-th function in the given model.
3207 ///
3208 /// # Preconditions
3209 ///
3210 /// - `i < Z3_model_get_num_funcs(c, m)`
3211 ///
3212 /// # See also
3213 ///
3214 /// - [`Z3_model_get_num_funcs`]
3215 pub fn Z3_model_get_func_decl(
3216 c: Z3_context,
3217 m: Z3_model,
3218 i: ::core::ffi::c_uint,
3219 ) -> Option<Z3_func_decl>;
3220 /// Return the number of uninterpreted sorts that `m` assigns an interpretation to.
3221 ///
3222 /// Z3 also provides an interpretation for uninterpreted sorts used in a formula.
3223 /// The interpretation for a sort `s` is a finite set of distinct values. We say this finite set is
3224 /// the "universe" of `s`.
3225 ///
3226 /// # See also
3227 ///
3228 /// - [`Z3_model_get_sort`]
3229 /// - [`Z3_model_get_sort_universe`]
3230 pub fn Z3_model_get_num_sorts(c: Z3_context, m: Z3_model) -> ::core::ffi::c_uint;
3231 /// Return a uninterpreted sort that `m` assigns an interpretation.
3232 ///
3233 /// # Preconditions
3234 ///
3235 /// - `i < Z3_model_get_num_sorts(c, m)`
3236 ///
3237 /// # See also
3238 ///
3239 /// - [`Z3_model_get_num_sorts`]
3240 /// - [`Z3_model_get_sort_universe`]
3241 pub fn Z3_model_get_sort(
3242 c: Z3_context,
3243 m: Z3_model,
3244 i: ::core::ffi::c_uint,
3245 ) -> Option<Z3_sort>;
3246 /// Return the finite set of distinct values that represent the interpretation for sort `s`.
3247 ///
3248 /// # See also
3249 ///
3250 /// - [`Z3_model_get_num_sorts`]
3251 /// - [`Z3_model_get_sort`]
3252 pub fn Z3_model_get_sort_universe(
3253 c: Z3_context,
3254 m: Z3_model,
3255 s: Z3_sort,
3256 ) -> Option<Z3_ast_vector>;
3257 /// translate model from context `c` to context `dst`.
3258 ///
3259 /// **Remark:** Use this method for cloning state between contexts. Note that
3260 /// operations on contexts are not thread safe and therefore all operations
3261 /// that related to a given context have to be synchronized (or run in the same thread).
3262 pub fn Z3_model_translate(
3263 c: Z3_context,
3264 m: Z3_model,
3265 dst: Z3_context,
3266 ) -> Option<Z3_model>;
3267 /// The `(_ as-array f)` AST node is a construct for assigning interpretations for arrays in Z3.
3268 /// It is the array such that forall indices `i` we have that `(select (_ as-array f) i)` is equal to `(f i)`.
3269 /// This procedure returns `true` if the `a` is an `as`-array AST node.
3270 ///
3271 /// Z3 current solvers have minimal support for `as_array` nodes.
3272 ///
3273 /// # See also
3274 ///
3275 /// - [`Z3_get_as_array_func_decl`]
3276 pub fn Z3_is_as_array(c: Z3_context, a: Z3_ast) -> bool;
3277 /// Return the function declaration `f` associated with a `(_ as_array f)` node.
3278 ///
3279 /// # See also
3280 ///
3281 /// - [`Z3_is_as_array`]
3282 pub fn Z3_get_as_array_func_decl(c: Z3_context, a: Z3_ast) -> Option<Z3_func_decl>;
3283 /// Create a fresh func_interp object, add it to a model for a specified function.
3284 /// It has reference count 0.
3285 ///
3286 /// - `c`: context
3287 /// - `m`: model
3288 /// - `f`: function declaration
3289 /// - `default_value`: default value for function interpretation
3290 pub fn Z3_add_func_interp(
3291 c: Z3_context,
3292 m: Z3_model,
3293 f: Z3_func_decl,
3294 default_value: Z3_ast,
3295 ) -> Option<Z3_func_interp>;
3296 /// Add a constant interpretation.
3297 pub fn Z3_add_const_interp(c: Z3_context, m: Z3_model, f: Z3_func_decl, a: Z3_ast);
3298 /// Increment the reference counter of the given `Z3_func_interp` object.
3299 pub fn Z3_func_interp_inc_ref(c: Z3_context, f: Z3_func_interp);
3300 /// Decrement the reference counter of the given `Z3_func_interp` object.
3301 pub fn Z3_func_interp_dec_ref(c: Z3_context, f: Z3_func_interp);
3302 /// Return the number of entries in the given function interpretation.
3303 ///
3304 /// A function interpretation is represented as a finite map and an 'else' value.
3305 /// Each entry in the finite map represents the value of a function given a set of arguments.
3306 /// This procedure return the number of element in the finite map of `f`.
3307 ///
3308 /// # See also
3309 ///
3310 /// - [`Z3_func_interp_get_entry`]
3311 pub fn Z3_func_interp_get_num_entries(
3312 c: Z3_context,
3313 f: Z3_func_interp,
3314 ) -> ::core::ffi::c_uint;
3315 /// Return a "point" of the given function interpretation. It represents the
3316 /// value of `f` in a particular point.
3317 ///
3318 /// # Preconditions
3319 ///
3320 /// - `i < Z3_func_interp_get_num_entries(c, f)`
3321 ///
3322 /// # See also
3323 ///
3324 /// - [`Z3_func_interp_get_num_entries`]
3325 pub fn Z3_func_interp_get_entry(
3326 c: Z3_context,
3327 f: Z3_func_interp,
3328 i: ::core::ffi::c_uint,
3329 ) -> Option<Z3_func_entry>;
3330 /// Return the 'else' value of the given function interpretation.
3331 ///
3332 /// A function interpretation is represented as a finite map and an 'else' value.
3333 /// This procedure returns the 'else' value.
3334 pub fn Z3_func_interp_get_else(c: Z3_context, f: Z3_func_interp) -> Option<Z3_ast>;
3335 /// Return the 'else' value of the given function interpretation.
3336 ///
3337 /// A function interpretation is represented as a finite map and an 'else' value.
3338 /// This procedure can be used to update the 'else' value.
3339 pub fn Z3_func_interp_set_else(c: Z3_context, f: Z3_func_interp, else_value: Z3_ast);
3340 /// Return the arity (number of arguments) of the given function interpretation.
3341 pub fn Z3_func_interp_get_arity(
3342 c: Z3_context,
3343 f: Z3_func_interp,
3344 ) -> ::core::ffi::c_uint;
3345 /// add a function entry to a function interpretation.
3346 ///
3347 /// - `c`: logical context
3348 /// - `fi`: a function interpretation to be updated.
3349 /// - `args`: list of arguments. They should be constant values (such as integers) and be of the same types as the domain of the function.
3350 /// - `value`: value of the function when the parameters match args.
3351 ///
3352 /// It is assumed that entries added to a function cover disjoint arguments.
3353 /// If an two entries are added with the same arguments, only the second insertion survives and the
3354 /// first inserted entry is removed.
3355 pub fn Z3_func_interp_add_entry(
3356 c: Z3_context,
3357 fi: Z3_func_interp,
3358 args: Z3_ast_vector,
3359 value: Z3_ast,
3360 );
3361 /// Increment the reference counter of the given `Z3_func_entry` object.
3362 pub fn Z3_func_entry_inc_ref(c: Z3_context, e: Z3_func_entry);
3363 /// Decrement the reference counter of the given `Z3_func_entry` object.
3364 pub fn Z3_func_entry_dec_ref(c: Z3_context, e: Z3_func_entry);
3365 /// Return the value of this point.
3366 ///
3367 /// A `Z3_func_entry` object represents an element in the finite map used to encode
3368 /// a function interpretation.
3369 ///
3370 /// # See also
3371 ///
3372 /// - [`Z3_func_interp_get_entry`]
3373 pub fn Z3_func_entry_get_value(c: Z3_context, e: Z3_func_entry) -> Option<Z3_ast>;
3374 /// Return the number of arguments in a `Z3_func_entry` object.
3375 ///
3376 /// # See also
3377 ///
3378 /// - [`Z3_func_entry_get_arg`]
3379 /// - [`Z3_func_interp_get_entry`]
3380 pub fn Z3_func_entry_get_num_args(
3381 c: Z3_context,
3382 e: Z3_func_entry,
3383 ) -> ::core::ffi::c_uint;
3384 /// Return an argument of a `Z3_func_entry` object.
3385 ///
3386 /// # Preconditions
3387 ///
3388 /// - `i < Z3_func_entry_get_num_args(c, e)`
3389 ///
3390 /// # See also
3391 ///
3392 /// - [`Z3_func_entry_get_num_args`]
3393 /// - [`Z3_func_interp_get_entry`]
3394 pub fn Z3_func_entry_get_arg(
3395 c: Z3_context,
3396 e: Z3_func_entry,
3397 i: ::core::ffi::c_uint,
3398 ) -> Option<Z3_ast>;
3399 /// Log interaction to a file.
3400 ///
3401 ///
3402 /// extra_API('Z3_open_log', BOOL, (_in(STRING),))
3403 ///
3404 /// # See also
3405 ///
3406 /// - [`Z3_append_log`]
3407 /// - [`Z3_close_log`]
3408 pub fn Z3_open_log(filename: Z3_string) -> bool;
3409 /// Append user-defined string to interaction log.
3410 ///
3411 /// The interaction log is opened using [`Z3_open_log`].
3412 /// It contains the formulas that are checked using Z3.
3413 /// You can use this command to append comments, for instance.
3414 ///
3415 ///
3416 /// extra_API('Z3_append_log', VOID, (_in(STRING),))
3417 ///
3418 /// # See also
3419 ///
3420 /// - [`Z3_open_log`]
3421 /// - [`Z3_close_log`]
3422 pub fn Z3_append_log(string: Z3_string);
3423 /// Close interaction log.
3424 ///
3425 ///
3426 /// extra_API('Z3_close_log', VOID, ())
3427 ///
3428 /// # See also
3429 ///
3430 /// - [`Z3_open_log`]
3431 /// - [`Z3_append_log`]
3432 pub fn Z3_close_log();
3433 /// Enable/disable printing warning messages to the console.
3434 ///
3435 /// Warnings are printed after passing `true`, warning messages are
3436 /// suppressed after calling this method with `false`.
3437 pub fn Z3_toggle_warning_messages(enabled: bool);
3438 /// Select mode for the format used for pretty-printing AST nodes.
3439 ///
3440 /// The default mode for pretty printing AST nodes is to produce
3441 /// SMT-LIB style output where common subexpressions are printed
3442 /// at each occurrence. The mode is called `Z3_PRINT_SMTLIB_FULL`.
3443 /// To print shared common subexpressions only once,
3444 /// use the `Z3_PRINT_LOW_LEVEL` mode.
3445 /// To print in way that conforms to SMT-LIB standards and uses let
3446 /// expressions to share common sub-expressions use `Z3_PRINT_SMTLIB2_COMPLIANT`.
3447 ///
3448 /// # See also
3449 ///
3450 /// - [`Z3_ast_to_string`]
3451 /// - [`Z3_pattern_to_string`]
3452 /// - [`Z3_func_decl_to_string`]
3453 pub fn Z3_set_ast_print_mode(c: Z3_context, mode: Z3_ast_print_mode);
3454 /// Convert the given AST node into a string.
3455 ///
3456 /// \warning The result buffer is statically allocated by Z3. It will
3457 /// be automatically deallocated when [`Z3_del_context`] is invoked.
3458 /// So, the buffer is invalidated in the next call to `Z3_ast_to_string`.
3459 ///
3460 /// # See also
3461 ///
3462 /// - [`Z3_pattern_to_string`]
3463 /// - [`Z3_sort_to_string`]
3464 pub fn Z3_ast_to_string(c: Z3_context, a: Z3_ast) -> Z3_string;
3465 pub fn Z3_pattern_to_string(c: Z3_context, p: Z3_pattern) -> Z3_string;
3466 pub fn Z3_sort_to_string(c: Z3_context, s: Z3_sort) -> Z3_string;
3467 pub fn Z3_func_decl_to_string(c: Z3_context, d: Z3_func_decl) -> Z3_string;
3468 /// Convert the given model into a string.
3469 ///
3470 /// \warning The result buffer is statically allocated by Z3. It will
3471 /// be automatically deallocated when [`Z3_del_context`] is invoked.
3472 /// So, the buffer is invalidated in the next call to `Z3_model_to_string`.
3473 pub fn Z3_model_to_string(c: Z3_context, m: Z3_model) -> Z3_string;
3474 /// Convert the given benchmark into SMT-LIB formatted string.
3475 ///
3476 /// \warning The result buffer is statically allocated by Z3. It will
3477 /// be automatically deallocated when [`Z3_del_context`] is invoked.
3478 /// So, the buffer is invalidated in the next call to `Z3_benchmark_to_smtlib_string`.
3479 ///
3480 /// - `c`: - context.
3481 /// - `name`: - name of benchmark. The argument is optional.
3482 /// - `logic`: - the benchmark logic.
3483 /// - `status`: - the status string (sat, unsat, or unknown)
3484 /// - `attributes`: - other attributes, such as source, difficulty or category.
3485 /// - `num_assumptions`: - number of assumptions.
3486 /// - `assumptions`: - auxiliary assumptions.
3487 /// - `formula`: - formula to be checked for consistency in conjunction with assumptions.
3488 pub fn Z3_benchmark_to_smtlib_string(
3489 c: Z3_context,
3490 name: Z3_string,
3491 logic: Z3_string,
3492 status: Z3_string,
3493 attributes: Z3_string,
3494 num_assumptions: ::core::ffi::c_uint,
3495 assumptions: *const Z3_ast,
3496 formula: Z3_ast,
3497 ) -> Z3_string;
3498 /// Parse the given string using the SMT-LIB2 parser.
3499 ///
3500 /// It returns a formula comprising of the conjunction of assertions in the scope
3501 /// (up to push/pop) at the end of the string.
3502 pub fn Z3_parse_smtlib2_string(
3503 c: Z3_context,
3504 str_: Z3_string,
3505 num_sorts: ::core::ffi::c_uint,
3506 sort_names: *const Z3_symbol,
3507 sorts: *const Z3_sort,
3508 num_decls: ::core::ffi::c_uint,
3509 decl_names: *const Z3_symbol,
3510 decls: *const Z3_func_decl,
3511 ) -> Option<Z3_ast_vector>;
3512 /// Similar to [`Z3_parse_smtlib2_string`], but reads the benchmark from a file.
3513 pub fn Z3_parse_smtlib2_file(
3514 c: Z3_context,
3515 file_name: Z3_string,
3516 num_sorts: ::core::ffi::c_uint,
3517 sort_names: *const Z3_symbol,
3518 sorts: *const Z3_sort,
3519 num_decls: ::core::ffi::c_uint,
3520 decl_names: *const Z3_symbol,
3521 decls: *const Z3_func_decl,
3522 ) -> Option<Z3_ast_vector>;
3523 /// Parse and evaluate and SMT-LIB2 command sequence. The state from a previous call is saved so the next
3524 /// evaluation builds on top of the previous call.
3525 ///
3526 ///
3527 /// **Returns:** output generated from processing commands.
3528 pub fn Z3_eval_smtlib2_string(c: Z3_context, str_: Z3_string) -> Z3_string;
3529 /// Create a parser context.
3530 ///
3531 /// A parser context maintains state between calls to `Z3_parser_context_parse_string`
3532 /// where the caller can pass in a set of SMTLIB2 commands.
3533 /// It maintains all the declarations from previous calls together with
3534 /// of sorts and function declarations (including 0-ary) that are added directly to the context.
3535 pub fn Z3_mk_parser_context(c: Z3_context) -> Option<Z3_parser_context>;
3536 /// Increment the reference counter of the given `Z3_parser_context` object.
3537 pub fn Z3_parser_context_inc_ref(c: Z3_context, pc: Z3_parser_context);
3538 /// Decrement the reference counter of the given `Z3_parser_context` object.
3539 pub fn Z3_parser_context_dec_ref(c: Z3_context, pc: Z3_parser_context);
3540 /// Add a sort declaration.
3541 pub fn Z3_parser_context_add_sort(c: Z3_context, pc: Z3_parser_context, s: Z3_sort);
3542 /// Add a function declaration.
3543 pub fn Z3_parser_context_add_decl(
3544 c: Z3_context,
3545 pc: Z3_parser_context,
3546 f: Z3_func_decl,
3547 );
3548 /// Parse a string of SMTLIB2 commands. Return assertions.
3549 pub fn Z3_parser_context_from_string(
3550 c: Z3_context,
3551 pc: Z3_parser_context,
3552 s: Z3_string,
3553 ) -> Option<Z3_ast_vector>;
3554 /// Return the error code for the last API call.
3555 ///
3556 /// A call to a Z3 function may return a non Z3_OK error code,
3557 /// when it is not used correctly.
3558 ///
3559 /// # See also
3560 ///
3561 /// - [`Z3_set_error_handler`]
3562 pub fn Z3_get_error_code(c: Z3_context) -> Z3_error_code;
3563 /// Register a Z3 error handler.
3564 ///
3565 /// A call to a Z3 function may return a non `Z3_OK` error code, when
3566 /// it is not used correctly. An error handler can be registered
3567 /// and will be called in this case. To disable the use of the
3568 /// error handler, simply register with `h`=NULL.
3569 ///
3570 /// By default, newly created contexts install an internal default error
3571 /// handler that prints the error message and terminates the process via
3572 /// `exit`(1). While suitable for standalone CLI programs, calling
3573 /// raw `exit`() is unsafe when Z3 is invoked from within a managed
3574 /// runtime environment (such as Java/JNI under Android ART or the JVM,
3575 /// or .NET/CLR) or multi-threaded embedders: process termination can race
3576 /// with background runtime threads (e.g., JIT compilation or GC threads),
3577 /// producing crashes (SIGSEGV) in unrelated runtime threads. Embedders
3578 /// in managed runtimes should always register their own error handler or
3579 /// disable it by passing `h`=NULL and inspecting [`Z3_get_error_code`].
3580 ///
3581 /// \warning Log files, created using [`Z3_open_log`], may be potentially incomplete/incorrect if error handlers are used.
3582 ///
3583 /// # See also
3584 ///
3585 /// - [`Z3_get_error_code`]
3586 /// - [`Z3_mk_context`]
3587 /// - [`Z3_mk_context_rc`]
3588 pub fn Z3_set_error_handler(c: Z3_context, h: Z3_error_handler);
3589 /// Set an error.
3590 pub fn Z3_set_error(c: Z3_context, e: Z3_error_code);
3591 /// Return a string describing the given error code.
3592 pub fn Z3_get_error_msg(c: Z3_context, err: Z3_error_code) -> Z3_string;
3593 /// Return Z3 version number information.
3594 ///
3595 /// # See also
3596 ///
3597 /// - [`Z3_get_full_version`]
3598 pub fn Z3_get_version(
3599 major: *mut ::core::ffi::c_uint,
3600 minor: *mut ::core::ffi::c_uint,
3601 build_number: *mut ::core::ffi::c_uint,
3602 revision_number: *mut ::core::ffi::c_uint,
3603 );
3604 /// Return a string that fully describes the version of Z3 in use.
3605 ///
3606 /// # See also
3607 ///
3608 /// - [`Z3_get_version`]
3609 pub fn Z3_get_full_version() -> Z3_string;
3610 /// Enable tracing messages tagged as `tag` when Z3 is compiled in debug mode.
3611 /// It is a NOOP otherwise
3612 ///
3613 /// # See also
3614 ///
3615 /// - [`Z3_disable_trace`]
3616 pub fn Z3_enable_trace(tag: Z3_string);
3617 /// Disable tracing messages tagged as `tag` when Z3 is compiled in debug mode.
3618 /// It is a NOOP otherwise
3619 ///
3620 /// # See also
3621 ///
3622 /// - [`Z3_enable_trace`]
3623 pub fn Z3_disable_trace(tag: Z3_string);
3624 /// Reset all allocated resources.
3625 ///
3626 /// Use this facility on out-of memory errors.
3627 /// It allows discharging the previous state and resuming afresh.
3628 /// Any pointers previously returned by the API
3629 /// become invalid.
3630 pub fn Z3_reset_memory();
3631 /// Destroy all allocated resources.
3632 ///
3633 /// Any pointers previously returned by the API become invalid.
3634 /// Can be used for memory leak detection.
3635 pub fn Z3_finalize_memory();
3636 /// Create a goal (aka problem). A goal is essentially a set
3637 /// of formulas, that can be solved and/or transformed using
3638 /// tactics and solvers.
3639 ///
3640 /// If `models` is `true`, then model generation is enabled for the new goal.
3641 ///
3642 /// If `unsat_cores` is `true`, then unsat core generation is enabled for the new goal.
3643 ///
3644 /// If `proofs` is `true`, then proof generation is enabled for the new goal. Remark, the
3645 /// Z3 context `c` must have been created with proof generation support.
3646 ///
3647 /// **Remark:** Reference counting must be used to manage goals, even when the `Z3_context` was
3648 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
3649 pub fn Z3_mk_goal(
3650 c: Z3_context,
3651 models: bool,
3652 unsat_cores: bool,
3653 proofs: bool,
3654 ) -> Option<Z3_goal>;
3655 /// Increment the reference counter of the given goal.
3656 pub fn Z3_goal_inc_ref(c: Z3_context, g: Z3_goal);
3657 /// Decrement the reference counter of the given goal.
3658 pub fn Z3_goal_dec_ref(c: Z3_context, g: Z3_goal);
3659 /// Return the "precision" of the given goal. Goals can be transformed using over and under approximations.
3660 /// A under approximation is applied when the objective is to find a model for a given goal.
3661 /// An over approximation is applied when the objective is to find a proof for a given goal.
3662 pub fn Z3_goal_precision(c: Z3_context, g: Z3_goal) -> Z3_goal_prec;
3663 /// Add a new formula `a` to the given goal.
3664 /// The formula is split according to the following procedure that is applied
3665 /// until a fixed-point:
3666 /// Conjunctions are split into separate formulas.
3667 /// Negations are distributed over disjunctions, resulting in separate formulas.
3668 /// If the goal is `false`, adding new formulas is a no-op.
3669 /// If the formula `a` is `true`, then nothing is added.
3670 /// If the formula `a` is `false`, then the entire goal is replaced by the formula `false`.
3671 pub fn Z3_goal_assert(c: Z3_context, g: Z3_goal, a: Z3_ast);
3672 /// Return `true` if the given goal contains the formula `false`.
3673 pub fn Z3_goal_inconsistent(c: Z3_context, g: Z3_goal) -> bool;
3674 /// Return the depth of the given goal. It tracks how many transformations were applied to it.
3675 pub fn Z3_goal_depth(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
3676 /// Erase all formulas from the given goal.
3677 pub fn Z3_goal_reset(c: Z3_context, g: Z3_goal);
3678 /// Return the number of formulas in the given goal.
3679 pub fn Z3_goal_size(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
3680 /// Return a formula from the given goal.
3681 ///
3682 /// # Preconditions
3683 ///
3684 /// - `idx < Z3_goal_size(c, g)`
3685 pub fn Z3_goal_formula(
3686 c: Z3_context,
3687 g: Z3_goal,
3688 idx: ::core::ffi::c_uint,
3689 ) -> Option<Z3_ast>;
3690 /// Return the number of formulas, subformulas and terms in the given goal.
3691 pub fn Z3_goal_num_exprs(c: Z3_context, g: Z3_goal) -> ::core::ffi::c_uint;
3692 /// Return `true` if the goal is empty, and it is precise or the product of a under approximation.
3693 pub fn Z3_goal_is_decided_sat(c: Z3_context, g: Z3_goal) -> bool;
3694 /// Return `true` if the goal contains false, and it is precise or the product of an over approximation.
3695 pub fn Z3_goal_is_decided_unsat(c: Z3_context, g: Z3_goal) -> bool;
3696 /// Copy a goal `g` from the context `source` to the context `target`.
3697 pub fn Z3_goal_translate(
3698 source: Z3_context,
3699 g: Z3_goal,
3700 target: Z3_context,
3701 ) -> Option<Z3_goal>;
3702 /// Convert a model of the formulas of a goal to a model of an original goal.
3703 /// The model may be null, in which case the returned model is valid if the goal was
3704 /// established satisfiable.
3705 ///
3706 /// When using this feature it is advisable to set the parameter `model`.compact to `false`.
3707 /// It is by default true, which erases variables created by the solver from models.
3708 /// Without access to model values for intermediary variables, values of other variables
3709 /// may end up having the wrong values.
3710 pub fn Z3_goal_convert_model(
3711 c: Z3_context,
3712 g: Z3_goal,
3713 m: Z3_model,
3714 ) -> Option<Z3_model>;
3715 /// Convert a goal into a string.
3716 pub fn Z3_goal_to_string(c: Z3_context, g: Z3_goal) -> Z3_string;
3717 /// Convert a goal into a DIMACS formatted string.
3718 /// The goal must be in CNF. You can convert a goal to CNF
3719 /// by applying the tseitin-cnf tactic. Bit-vectors are not automatically
3720 /// converted to Booleans either, so if the caller intends to
3721 /// preserve satisfiability, it should apply bit-blasting tactics.
3722 /// Quantifiers and theory atoms will not be encoded.
3723 pub fn Z3_goal_to_dimacs_string(
3724 c: Z3_context,
3725 g: Z3_goal,
3726 include_names: bool,
3727 ) -> Z3_string;
3728 /// Return a tactic associated with the given name.
3729 /// The complete list of tactics may be obtained using the procedures [`Z3_get_num_tactics`] and [`Z3_get_tactic_name`].
3730 /// It may also be obtained using the command `(help-tactic)` in the SMT 2.0 front-end.
3731 ///
3732 /// Tactics are the basic building block for creating custom solvers for specific problem domains.
3733 pub fn Z3_mk_tactic(c: Z3_context, name: Z3_string) -> Option<Z3_tactic>;
3734 /// Increment the reference counter of the given tactic.
3735 pub fn Z3_tactic_inc_ref(c: Z3_context, t: Z3_tactic);
3736 /// Decrement the reference counter of the given tactic.
3737 pub fn Z3_tactic_dec_ref(c: Z3_context, g: Z3_tactic);
3738 /// Return a probe associated with the given name.
3739 /// The complete list of probes may be obtained using the procedures [`Z3_get_num_probes`] and [`Z3_get_probe_name`].
3740 /// It may also be obtained using the command `(help-tactic)` in the SMT 2.0 front-end.
3741 ///
3742 /// Probes are used to inspect a goal (aka problem) and collect information that may be used to decide
3743 /// which solver and/or preprocessing step will be used.
3744 pub fn Z3_mk_probe(c: Z3_context, name: Z3_string) -> Option<Z3_probe>;
3745 /// Increment the reference counter of the given probe.
3746 pub fn Z3_probe_inc_ref(c: Z3_context, p: Z3_probe);
3747 /// Decrement the reference counter of the given probe.
3748 pub fn Z3_probe_dec_ref(c: Z3_context, p: Z3_probe);
3749 /// Return a tactic that applies `t1` to a given goal and `t2`
3750 /// to every subgoal produced by `t1`.
3751 pub fn Z3_tactic_and_then(
3752 c: Z3_context,
3753 t1: Z3_tactic,
3754 t2: Z3_tactic,
3755 ) -> Option<Z3_tactic>;
3756 /// Return a tactic that first applies `t1` to a given goal,
3757 /// if it fails then returns the result of `t2` applied to the given goal.
3758 pub fn Z3_tactic_or_else(
3759 c: Z3_context,
3760 t1: Z3_tactic,
3761 t2: Z3_tactic,
3762 ) -> Option<Z3_tactic>;
3763 /// Return a tactic that applies the given tactics in parallel.
3764 pub fn Z3_tactic_par_or(
3765 c: Z3_context,
3766 num: ::core::ffi::c_uint,
3767 ts: *const Z3_tactic,
3768 ) -> Option<Z3_tactic>;
3769 /// Return a tactic that applies `t1` to a given goal and then `t2`
3770 /// to every subgoal produced by `t1`. The subgoals are processed in parallel.
3771 pub fn Z3_tactic_par_and_then(
3772 c: Z3_context,
3773 t1: Z3_tactic,
3774 t2: Z3_tactic,
3775 ) -> Option<Z3_tactic>;
3776 /// Return a tactic that applies `t` to a given goal for `ms` milliseconds.
3777 /// If `t` does not terminate in `ms` milliseconds, then it fails.
3778 pub fn Z3_tactic_try_for(
3779 c: Z3_context,
3780 t: Z3_tactic,
3781 ms: ::core::ffi::c_uint,
3782 ) -> Option<Z3_tactic>;
3783 /// Return a tactic that applies `t` to a given goal is the probe `p` evaluates to true.
3784 /// If `p` evaluates to false, then the new tactic behaves like the skip tactic.
3785 pub fn Z3_tactic_when(c: Z3_context, p: Z3_probe, t: Z3_tactic) -> Option<Z3_tactic>;
3786 /// Return a tactic that applies `t1` to a given goal if the probe `p` evaluates to true,
3787 /// and `t2` if `p` evaluates to false.
3788 pub fn Z3_tactic_cond(
3789 c: Z3_context,
3790 p: Z3_probe,
3791 t1: Z3_tactic,
3792 t2: Z3_tactic,
3793 ) -> Option<Z3_tactic>;
3794 /// Return a tactic that keeps applying `t` until the goal is not modified anymore or the maximum
3795 /// number of iterations `max` is reached.
3796 pub fn Z3_tactic_repeat(
3797 c: Z3_context,
3798 t: Z3_tactic,
3799 max: ::core::ffi::c_uint,
3800 ) -> Option<Z3_tactic>;
3801 /// Return a tactic that just return the given goal.
3802 pub fn Z3_tactic_skip(c: Z3_context) -> Option<Z3_tactic>;
3803 /// Return a tactic that always fails.
3804 pub fn Z3_tactic_fail(c: Z3_context) -> Option<Z3_tactic>;
3805 /// Return a tactic that fails if the probe `p` evaluates to false.
3806 pub fn Z3_tactic_fail_if(c: Z3_context, p: Z3_probe) -> Option<Z3_tactic>;
3807 /// Return a tactic that fails if the goal is not trivially satisfiable (i.e., empty) or
3808 /// trivially unsatisfiable (i.e., contains false).
3809 pub fn Z3_tactic_fail_if_not_decided(c: Z3_context) -> Option<Z3_tactic>;
3810 /// Return a tactic that applies `t` using the given set of parameters.
3811 pub fn Z3_tactic_using_params(
3812 c: Z3_context,
3813 t: Z3_tactic,
3814 p: Z3_params,
3815 ) -> Option<Z3_tactic>;
3816 /// Return a simplifier associated with the given name.
3817 /// The complete list of simplifiers may be obtained using the procedures [`Z3_get_num_simplifiers`] and [`Z3_get_simplifier_name`].
3818 /// It may also be obtained using the command `(help-simplifier)` in the SMT 2.0 front-end.
3819 ///
3820 /// Simplifiers are the basic building block for creating custom solvers for specific problem domains.
3821 pub fn Z3_mk_simplifier(c: Z3_context, name: Z3_string) -> Option<Z3_simplifier>;
3822 /// Increment the reference counter of the given simplifier.
3823 pub fn Z3_simplifier_inc_ref(c: Z3_context, t: Z3_simplifier);
3824 /// Decrement the reference counter of the given simplifier.
3825 pub fn Z3_simplifier_dec_ref(c: Z3_context, g: Z3_simplifier);
3826 /// Attach simplifier to a solver. The solver will use the simplifier for incremental pre-processing.
3827 pub fn Z3_solver_add_simplifier(
3828 c: Z3_context,
3829 solver: Z3_solver,
3830 simplifier: Z3_simplifier,
3831 ) -> Option<Z3_solver>;
3832 /// Return a simplifier that applies `t1` to a given goal and `t2`
3833 /// to every subgoal produced by `t1`.
3834 pub fn Z3_simplifier_and_then(
3835 c: Z3_context,
3836 t1: Z3_simplifier,
3837 t2: Z3_simplifier,
3838 ) -> Option<Z3_simplifier>;
3839 /// Return a simplifier that applies `t` using the given set of parameters.
3840 pub fn Z3_simplifier_using_params(
3841 c: Z3_context,
3842 t: Z3_simplifier,
3843 p: Z3_params,
3844 ) -> Option<Z3_simplifier>;
3845 /// Return the number of builtin simplifiers available in Z3.
3846 ///
3847 /// # See also
3848 ///
3849 /// - [`Z3_get_simplifier_name`]
3850 pub fn Z3_get_num_simplifiers(c: Z3_context) -> ::core::ffi::c_uint;
3851 /// Return the name of the idx simplifier.
3852 ///
3853 /// # Preconditions
3854 ///
3855 /// - `i < Z3_get_num_simplifiers(c)`
3856 ///
3857 /// # See also
3858 ///
3859 /// - [`Z3_get_num_simplifiers`]
3860 pub fn Z3_get_simplifier_name(c: Z3_context, i: ::core::ffi::c_uint) -> Z3_string;
3861 /// Return a string containing a description of parameters accepted by the given simplifier.
3862 pub fn Z3_simplifier_get_help(c: Z3_context, t: Z3_simplifier) -> Z3_string;
3863 /// Return the parameter description set for the given simplifier object.
3864 pub fn Z3_simplifier_get_param_descrs(
3865 c: Z3_context,
3866 t: Z3_simplifier,
3867 ) -> Option<Z3_param_descrs>;
3868 /// Return a string containing a description of the simplifier with the given name.
3869 pub fn Z3_simplifier_get_descr(c: Z3_context, name: Z3_string) -> Z3_string;
3870 /// Return a probe that always evaluates to val.
3871 pub fn Z3_probe_const(x: Z3_context, val: f64) -> Option<Z3_probe>;
3872 /// Return a probe that evaluates to "true" when the value returned by `p1` is less than the value returned by `p2`.
3873 ///
3874 /// **Remark:** For probes, "true" is any value different from 0.0.
3875 pub fn Z3_probe_lt(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3876 /// Return a probe that evaluates to "true" when the value returned by `p1` is greater than the value returned by `p2`.
3877 ///
3878 /// **Remark:** For probes, "true" is any value different from 0.0.
3879 pub fn Z3_probe_gt(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3880 /// Return a probe that evaluates to "true" when the value returned by `p1` is less than or equal to the value returned by `p2`.
3881 ///
3882 /// **Remark:** For probes, "true" is any value different from 0.0.
3883 pub fn Z3_probe_le(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3884 /// Return a probe that evaluates to "true" when the value returned by `p1` is greater than or equal to the value returned by `p2`.
3885 ///
3886 /// **Remark:** For probes, "true" is any value different from 0.0.
3887 pub fn Z3_probe_ge(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3888 /// Return a probe that evaluates to "true" when the value returned by `p1` is equal to the value returned by `p2`.
3889 ///
3890 /// **Remark:** For probes, "true" is any value different from 0.0.
3891 pub fn Z3_probe_eq(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3892 /// Return a probe that evaluates to "true" when `p1` and `p2` evaluates to true.
3893 ///
3894 /// **Remark:** For probes, "true" is any value different from 0.0.
3895 pub fn Z3_probe_and(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3896 /// Return a probe that evaluates to "true" when `p1` or `p2` evaluates to true.
3897 ///
3898 /// **Remark:** For probes, "true" is any value different from 0.0.
3899 pub fn Z3_probe_or(x: Z3_context, p1: Z3_probe, p2: Z3_probe) -> Option<Z3_probe>;
3900 /// Return a probe that evaluates to "true" when `p` does not evaluate to true.
3901 ///
3902 /// **Remark:** For probes, "true" is any value different from 0.0.
3903 pub fn Z3_probe_not(x: Z3_context, p: Z3_probe) -> Option<Z3_probe>;
3904 /// Return the number of builtin tactics available in Z3.
3905 ///
3906 /// # See also
3907 ///
3908 /// - [`Z3_get_tactic_name`]
3909 pub fn Z3_get_num_tactics(c: Z3_context) -> ::core::ffi::c_uint;
3910 /// Return the name of the idx tactic.
3911 ///
3912 /// # Preconditions
3913 ///
3914 /// - `i < Z3_get_num_tactics(c)`
3915 ///
3916 /// # See also
3917 ///
3918 /// - [`Z3_get_num_tactics`]
3919 pub fn Z3_get_tactic_name(c: Z3_context, i: ::core::ffi::c_uint) -> Z3_string;
3920 /// Return the number of builtin probes available in Z3.
3921 ///
3922 /// # See also
3923 ///
3924 /// - [`Z3_get_probe_name`]
3925 pub fn Z3_get_num_probes(c: Z3_context) -> ::core::ffi::c_uint;
3926 /// Return the name of the `i` probe.
3927 ///
3928 /// # Preconditions
3929 ///
3930 /// - `i < Z3_get_num_probes(c)`
3931 ///
3932 /// # See also
3933 ///
3934 /// - [`Z3_get_num_probes`]
3935 pub fn Z3_get_probe_name(c: Z3_context, i: ::core::ffi::c_uint) -> Z3_string;
3936 /// Return a string containing a description of parameters accepted by the given tactic.
3937 pub fn Z3_tactic_get_help(c: Z3_context, t: Z3_tactic) -> Z3_string;
3938 /// Return the parameter description set for the given tactic object.
3939 pub fn Z3_tactic_get_param_descrs(
3940 c: Z3_context,
3941 t: Z3_tactic,
3942 ) -> Option<Z3_param_descrs>;
3943 /// Return a string containing a description of the tactic with the given name.
3944 pub fn Z3_tactic_get_descr(c: Z3_context, name: Z3_string) -> Z3_string;
3945 /// Return a string containing a description of the probe with the given name.
3946 pub fn Z3_probe_get_descr(c: Z3_context, name: Z3_string) -> Z3_string;
3947 /// Execute the probe over the goal. The probe always produce a double value.
3948 /// "Boolean" probes return 0.0 for false, and a value different from 0.0 for true.
3949 pub fn Z3_probe_apply(c: Z3_context, p: Z3_probe, g: Z3_goal) -> f64;
3950 /// Apply tactic `t` to the goal `g`.
3951 ///
3952 /// # See also
3953 ///
3954 /// - [`Z3_tactic_apply_ex`]
3955 pub fn Z3_tactic_apply(
3956 c: Z3_context,
3957 t: Z3_tactic,
3958 g: Z3_goal,
3959 ) -> Option<Z3_apply_result>;
3960 /// Apply tactic `t` to the goal `g` using the parameter set `p`.
3961 ///
3962 /// # See also
3963 ///
3964 /// - [`Z3_tactic_apply`]
3965 pub fn Z3_tactic_apply_ex(
3966 c: Z3_context,
3967 t: Z3_tactic,
3968 g: Z3_goal,
3969 p: Z3_params,
3970 ) -> Option<Z3_apply_result>;
3971 /// Increment the reference counter of the given `Z3_apply_result` object.
3972 pub fn Z3_apply_result_inc_ref(c: Z3_context, r: Z3_apply_result);
3973 /// Decrement the reference counter of the given `Z3_apply_result` object.
3974 pub fn Z3_apply_result_dec_ref(c: Z3_context, r: Z3_apply_result);
3975 /// Convert the `Z3_apply_result` object returned by [`Z3_tactic_apply`] into a string.
3976 pub fn Z3_apply_result_to_string(c: Z3_context, r: Z3_apply_result) -> Z3_string;
3977 /// Return the number of subgoals in the `Z3_apply_result` object returned by [`Z3_tactic_apply`].
3978 ///
3979 /// # See also
3980 ///
3981 /// - [`Z3_apply_result_get_subgoal`]
3982 pub fn Z3_apply_result_get_num_subgoals(
3983 c: Z3_context,
3984 r: Z3_apply_result,
3985 ) -> ::core::ffi::c_uint;
3986 /// Return one of the subgoals in the `Z3_apply_result` object returned by [`Z3_tactic_apply`].
3987 ///
3988 /// # Preconditions
3989 ///
3990 /// - `i < Z3_apply_result_get_num_subgoals(c, r)`
3991 ///
3992 /// # See also
3993 ///
3994 /// - [`Z3_apply_result_get_num_subgoals`]
3995 pub fn Z3_apply_result_get_subgoal(
3996 c: Z3_context,
3997 r: Z3_apply_result,
3998 i: ::core::ffi::c_uint,
3999 ) -> Option<Z3_goal>;
4000 /// Create a new solver. This solver is a "combined solver" (see
4001 /// combined_solver module) that internally uses a non-incremental (solver1) and an
4002 /// incremental solver (solver2). This combined solver changes its behaviour based
4003 /// on how it is used and how its parameters are set.
4004 ///
4005 /// If the solver is used in a non incremental way (i.e. no calls to
4006 /// [`Z3_solver_push`] or [`Z3_solver_pop`], and no calls to
4007 /// [`Z3_solver_assert`] or [`Z3_solver_assert_and_track`] after checking
4008 /// satisfiability without an intervening [`Z3_solver_reset`]) then solver1
4009 /// will be used. This solver will apply Z3's "default" tactic.
4010 ///
4011 /// The "default" tactic will attempt to probe the logic used by the
4012 /// assertions and will apply a specialized tactic if one is supported.
4013 /// Otherwise the general `(and-then simplify smt)` tactic will be used.
4014 ///
4015 /// If the solver is used in an incremental way then the combined solver
4016 /// will switch to using solver2 (which behaves similarly to the general
4017 /// "smt" tactic).
4018 ///
4019 /// Note however it is possible to set the `solver2_timeout`,
4020 /// `solver2_unknown`, and `ignore_solver1` parameters of the combined
4021 /// solver to change its behaviour.
4022 ///
4023 /// The function [`Z3_solver_get_model`] retrieves a model if the
4024 /// assertions is satisfiable (i.e., the result is `Z3_L_TRUE`) and model construction is enabled.
4025 /// The function [`Z3_solver_get_model`] can also be used even
4026 /// if the result is `Z3_L_UNDEF`, but the returned model
4027 /// is not guaranteed to satisfy quantified assertions.
4028 ///
4029 /// **Remark:** User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
4030 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4031 ///
4032 /// # See also
4033 ///
4034 /// - [`Z3_mk_simple_solver`]
4035 /// - [`Z3_mk_solver_for_logic`]
4036 /// - [`Z3_mk_solver_from_tactic`]
4037 pub fn Z3_mk_solver(c: Z3_context) -> Option<Z3_solver>;
4038 /// Create a new incremental solver.
4039 ///
4040 /// This is equivalent to applying the "smt" tactic.
4041 ///
4042 /// Unlike [`Z3_mk_solver`] this solver
4043 /// - Does not attempt to apply any logic specific tactics.
4044 /// - Does not change its behaviour based on whether it used
4045 /// incrementally/non-incrementally.
4046 ///
4047 /// Note that these differences can result in very different performance
4048 /// compared to [`Z3_mk_solver`].
4049 ///
4050 /// The function [`Z3_solver_get_model`] retrieves a model if the
4051 /// assertions is satisfiable (i.e., the result is `Z3_L_TRUE`) and model construction is enabled.
4052 /// The function [`Z3_solver_get_model`] can also be used even
4053 /// if the result is `Z3_L_UNDEF`, but the returned model
4054 /// is not guaranteed to satisfy quantified assertions.
4055 ///
4056 /// **Remark:** User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
4057 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4058 ///
4059 /// # See also
4060 ///
4061 /// - [`Z3_mk_solver`]
4062 /// - [`Z3_mk_solver_for_logic`]
4063 /// - [`Z3_mk_solver_from_tactic`]
4064 pub fn Z3_mk_simple_solver(c: Z3_context) -> Option<Z3_solver>;
4065 /// Create a new solver customized for the given logic.
4066 /// It behaves like [`Z3_mk_solver`] if the logic is unknown or unsupported.
4067 ///
4068 /// **Remark:** User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
4069 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4070 ///
4071 /// # See also
4072 ///
4073 /// - [`Z3_mk_solver`]
4074 /// - [`Z3_mk_simple_solver`]
4075 /// - [`Z3_mk_solver_from_tactic`]
4076 pub fn Z3_mk_solver_for_logic(c: Z3_context, logic: Z3_symbol) -> Option<Z3_solver>;
4077 /// Create a new solver that is implemented using the given tactic.
4078 /// The solver supports the commands [`Z3_solver_push`] and [`Z3_solver_pop`], but it
4079 /// will always solve each [`Z3_solver_check`] from scratch.
4080 ///
4081 /// **Remark:** User must use [`Z3_solver_inc_ref`] and [`Z3_solver_dec_ref`] to manage solver objects.
4082 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4083 ///
4084 /// # See also
4085 ///
4086 /// - [`Z3_mk_solver`]
4087 /// - [`Z3_mk_simple_solver`]
4088 /// - [`Z3_mk_solver_for_logic`]
4089 pub fn Z3_mk_solver_from_tactic(c: Z3_context, t: Z3_tactic) -> Option<Z3_solver>;
4090 /// Copy a solver `s` from the context `source` to the context `target`.
4091 pub fn Z3_solver_translate(
4092 source: Z3_context,
4093 s: Z3_solver,
4094 target: Z3_context,
4095 ) -> Option<Z3_solver>;
4096 /// Ad-hoc method for importing model conversion from solver.
4097 ///
4098 /// This method is used for scenarios where `src` has been used to solve a set
4099 /// of formulas and was interrupted. The `dst` solver may be a strengthening of `src`
4100 /// obtained from cubing (assigning a subset of literals or adding constraints over the
4101 /// assertions available in `src`). If `dst` ends up being satisfiable, the model for `dst`
4102 /// may not correspond to a model of the original formula due to inprocessing in `src`.
4103 /// This method is used to take the side-effect of inprocessing into account when returning
4104 /// a model for `dst`.
4105 pub fn Z3_solver_import_model_converter(
4106 ctx: Z3_context,
4107 src: Z3_solver,
4108 dst: Z3_solver,
4109 );
4110 /// Return a string describing all solver available parameters.
4111 ///
4112 /// # See also
4113 ///
4114 /// - [`Z3_solver_get_param_descrs`]
4115 /// - [`Z3_solver_set_params`]
4116 pub fn Z3_solver_get_help(c: Z3_context, s: Z3_solver) -> Z3_string;
4117 /// Return the parameter description set for the given solver object.
4118 ///
4119 /// # See also
4120 ///
4121 /// - [`Z3_solver_get_help`]
4122 /// - [`Z3_solver_set_params`]
4123 pub fn Z3_solver_get_param_descrs(
4124 c: Z3_context,
4125 s: Z3_solver,
4126 ) -> Option<Z3_param_descrs>;
4127 /// Set the given solver using the given parameters.
4128 ///
4129 /// # See also
4130 ///
4131 /// - [`Z3_solver_get_help`]
4132 /// - [`Z3_solver_get_param_descrs`]
4133 pub fn Z3_solver_set_params(c: Z3_context, s: Z3_solver, p: Z3_params);
4134 /// Increment the reference counter of the given solver.
4135 pub fn Z3_solver_inc_ref(c: Z3_context, s: Z3_solver);
4136 /// Decrement the reference counter of the given solver.
4137 pub fn Z3_solver_dec_ref(c: Z3_context, s: Z3_solver);
4138 /// Solver local interrupt.
4139 /// Normally you should use Z3_interrupt to cancel solvers because only
4140 /// one solver is enabled concurrently per context.
4141 /// However, per GitHub issue #1006, there are use cases where
4142 /// it is more convenient to cancel a specific solver. Solvers
4143 /// that are not selected for interrupts are left alone.
4144 pub fn Z3_solver_interrupt(c: Z3_context, s: Z3_solver);
4145 /// Create a backtracking point.
4146 ///
4147 /// The solver contains a stack of assertions.
4148 ///
4149 /// # See also
4150 ///
4151 /// - [`Z3_solver_get_num_scopes`]
4152 /// - [`Z3_solver_pop`]
4153 pub fn Z3_solver_push(c: Z3_context, s: Z3_solver);
4154 /// Backtrack `n` backtracking points.
4155 ///
4156 /// # Preconditions
4157 ///
4158 /// - `n <= Z3_solver_get_num_scopes(c, s)`
4159 ///
4160 /// # See also
4161 ///
4162 /// - [`Z3_solver_get_num_scopes`]
4163 /// - [`Z3_solver_push`]
4164 pub fn Z3_solver_pop(c: Z3_context, s: Z3_solver, n: ::core::ffi::c_uint);
4165 /// Remove all assertions from the solver.
4166 ///
4167 /// # See also
4168 ///
4169 /// - [`Z3_solver_assert`]
4170 /// - [`Z3_solver_assert_and_track`]
4171 pub fn Z3_solver_reset(c: Z3_context, s: Z3_solver);
4172 /// Return the number of backtracking points.
4173 ///
4174 /// # See also
4175 ///
4176 /// - [`Z3_solver_push`]
4177 /// - [`Z3_solver_pop`]
4178 pub fn Z3_solver_get_num_scopes(c: Z3_context, s: Z3_solver) -> ::core::ffi::c_uint;
4179 /// Assert a constraint into the solver.
4180 ///
4181 /// The functions [`Z3_solver_check`] and [`Z3_solver_check_assumptions`] should be
4182 /// used to check whether the logical context is consistent or not.
4183 ///
4184 /// # See also
4185 ///
4186 /// - [`Z3_solver_assert_and_track`]
4187 /// - [`Z3_solver_reset`]
4188 pub fn Z3_solver_assert(c: Z3_context, s: Z3_solver, a: Z3_ast);
4189 /// Assert a constraint `a` into the solver, and track it (in the unsat) core using
4190 /// the Boolean constant `p`.
4191 ///
4192 /// This API is an alternative to [`Z3_solver_check_assumptions`] for extracting unsat cores.
4193 /// Both APIs can be used in the same solver. The unsat core will contain a combination
4194 /// of the Boolean variables provided using Z3_solver_assert_and_track and the Boolean literals
4195 /// provided using [`Z3_solver_check_assumptions`].
4196 ///
4197 /// # Preconditions
4198 ///
4199 /// - ``a` must be a Boolean expression`
4200 /// - ``p` must be a Boolean constant (aka variable).`
4201 ///
4202 /// # See also
4203 ///
4204 /// - [`Z3_solver_assert`]
4205 /// - [`Z3_solver_reset`]
4206 pub fn Z3_solver_assert_and_track(c: Z3_context, s: Z3_solver, a: Z3_ast, p: Z3_ast);
4207 /// load solver assertions from a file.
4208 ///
4209 /// # See also
4210 ///
4211 /// - [`Z3_solver_from_string`]
4212 /// - [`Z3_solver_to_string`]
4213 pub fn Z3_solver_from_file(c: Z3_context, s: Z3_solver, file_name: Z3_string);
4214 /// load solver assertions from a string.
4215 ///
4216 /// # See also
4217 ///
4218 /// - [`Z3_solver_from_file`]
4219 /// - [`Z3_solver_to_string`]
4220 pub fn Z3_solver_from_string(c: Z3_context, s: Z3_solver, str_: Z3_string);
4221 /// Return the set of asserted formulas on the solver.
4222 pub fn Z3_solver_get_assertions(
4223 c: Z3_context,
4224 s: Z3_solver,
4225 ) -> Option<Z3_ast_vector>;
4226 /// Return the set of units modulo model conversion.
4227 pub fn Z3_solver_get_units(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
4228 /// Return the trail modulo model conversion, in order of decision level
4229 /// The decision level can be retrieved using `Z3_solver_get_level` based on the trail.
4230 pub fn Z3_solver_get_trail(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
4231 /// Return the set of non units in the solver state.
4232 pub fn Z3_solver_get_non_units(c: Z3_context, s: Z3_solver) -> Option<Z3_ast_vector>;
4233 /// retrieve the decision depth of Boolean literals (variables or their negations).
4234 /// Assumes a check-sat call and no other calls (to extract models) have been invoked.
4235 pub fn Z3_solver_get_levels(
4236 c: Z3_context,
4237 s: Z3_solver,
4238 literals: Z3_ast_vector,
4239 sz: ::core::ffi::c_uint,
4240 levels: *mut ::core::ffi::c_uint,
4241 );
4242 /// retrieve the congruence closure root of an expression.
4243 /// The root is retrieved relative to the state where the solver was in when it completed.
4244 /// If it completed during a set of case splits, the congruence roots are relative to these case splits.
4245 /// That is, the congruences are not consequences but they are true under the current state.
4246 pub fn Z3_solver_congruence_root(
4247 c: Z3_context,
4248 s: Z3_solver,
4249 a: Z3_ast,
4250 ) -> Option<Z3_ast>;
4251 /// retrieve the next expression in the congruence class. The set of congruent siblings form a cyclic list.
4252 /// Repeated calls on the siblings will result in returning to the original expression.
4253 pub fn Z3_solver_congruence_next(
4254 c: Z3_context,
4255 s: Z3_solver,
4256 a: Z3_ast,
4257 ) -> Option<Z3_ast>;
4258 /// retrieve explanation for congruence.
4259 ///
4260 /// # Preconditions
4261 ///
4262 /// - `root(a) = root(b)`
4263 pub fn Z3_solver_congruence_explain(
4264 c: Z3_context,
4265 s: Z3_solver,
4266 a: Z3_ast,
4267 b: Z3_ast,
4268 ) -> Option<Z3_ast>;
4269 /// retrieve a 'solution' for `variables` as defined by equalities in maintained by solvers.
4270 /// At this point, only linear solution are supported.
4271 /// The solution to `variables` may be presented in triangular form, such that
4272 /// variables used in solutions themselves have solutions.
4273 pub fn Z3_solver_solve_for(
4274 c: Z3_context,
4275 s: Z3_solver,
4276 variables: Z3_ast_vector,
4277 terms: Z3_ast_vector,
4278 guards: Z3_ast_vector,
4279 );
4280 /// register a callback to that retrieves assumed, inferred and deleted clauses during search.
4281 ///
4282 /// - `c`: - context.
4283 /// - `s`: - solver object.
4284 /// - `user_context`: - a context used to maintain state for callbacks.
4285 /// - `on_clause_eh`: - a callback that is invoked by when a clause is
4286 /// - asserted to the CDCL engine (corresponding to an input clause after pre-processing)
4287 /// - inferred by CDCL(T) using either a SAT or theory conflict/propagation
4288 /// - deleted by the CDCL(T) engine
4289 pub fn Z3_solver_register_on_clause(
4290 c: Z3_context,
4291 s: Z3_solver,
4292 user_context: *mut ::core::ffi::c_void,
4293 on_clause_eh: Z3_on_clause_eh,
4294 );
4295 /// register a user-propagator with the solver.
4296 ///
4297 /// - `c`: - context.
4298 /// - `s`: - solver object.
4299 /// - `user_context`: - a context used to maintain state for callbacks.
4300 /// - `push_eh`: - a callback invoked when scopes are pushed
4301 /// - `pop_eh`: - a callback invoked when scopes are popped
4302 /// - `fresh_eh`: - a solver may spawn new solvers internally. This callback is used to produce a fresh user_context to be associated with fresh solvers.
4303 pub fn Z3_solver_propagate_init(
4304 c: Z3_context,
4305 s: Z3_solver,
4306 user_context: *mut ::core::ffi::c_void,
4307 push_eh: Z3_push_eh,
4308 pop_eh: Z3_pop_eh,
4309 fresh_eh: Z3_fresh_eh,
4310 );
4311 /// register a callback for when an expression is bound to a fixed value.
4312 /// The supported expression types are
4313 /// - Booleans
4314 /// - Bit-vectors
4315 pub fn Z3_solver_propagate_fixed(c: Z3_context, s: Z3_solver, fixed_eh: Z3_fixed_eh);
4316 /// register a callback on final check.
4317 /// This provides freedom to the propagator to delay actions or implement a branch-and bound solver.
4318 /// The final check is invoked when all decision variables have been assigned by the solver.
4319 ///
4320 /// The `final_eh` callback takes as argument the original user_context that was used
4321 /// when calling `Z3_solver_propagate_init`, and it takes a callback context with the
4322 /// opaque type `Z3_solver_callback`.
4323 /// The callback context is passed as argument to invoke the `Z3_solver_propagate_consequence` function.
4324 /// The callback context can only be accessed (for propagation and for dynamically registering expressions) within a callback.
4325 /// If the callback context gets used for propagation or conflicts, those propagations take effect and
4326 /// may trigger new decision variables to be set.
4327 pub fn Z3_solver_propagate_final(c: Z3_context, s: Z3_solver, final_eh: Z3_final_eh);
4328 /// register a callback on expression equalities.
4329 pub fn Z3_solver_propagate_eq(c: Z3_context, s: Z3_solver, eq_eh: Z3_eq_eh);
4330 /// register a callback on expression dis-equalities.
4331 pub fn Z3_solver_propagate_diseq(c: Z3_context, s: Z3_solver, eq_eh: Z3_eq_eh);
4332 /// register a callback when a new expression with a registered function is used by the solver
4333 /// The registered function appears at the top level and is created using \ref Z3_solver_propagate_declare.
4334 pub fn Z3_solver_propagate_created(
4335 c: Z3_context,
4336 s: Z3_solver,
4337 created_eh: Z3_created_eh,
4338 );
4339 /// register a callback when the solver decides to split on a registered expression.
4340 /// The callback may change the arguments by providing other values by calling \ref Z3_solver_next_split
4341 pub fn Z3_solver_propagate_decide(
4342 c: Z3_context,
4343 s: Z3_solver,
4344 decide_eh: Z3_decide_eh,
4345 );
4346 /// register a callback when the solver instantiates a quantifier.
4347 /// If the callback returns false, the actual instantiation of the quantifier is blocked.
4348 /// This allows the user propagator selectively prioritize instantiations without relying on default
4349 /// or configured weights.
4350 pub fn Z3_solver_propagate_on_binding(
4351 c: Z3_context,
4352 s: Z3_solver,
4353 on_binding_eh: Z3_on_binding_eh,
4354 );
4355 /// Sets the next (registered) expression to split on.
4356 /// The function returns false and ignores the given expression in case the expression is already assigned internally
4357 /// (due to relevancy propagation, this assignments might not have been reported yet by the fixed callback).
4358 /// In case the function is called in the decide callback, it overrides the currently selected variable and phase.
4359 pub fn Z3_solver_next_split(
4360 c: Z3_context,
4361 cb: Z3_solver_callback,
4362 t: Z3_ast,
4363 idx: ::core::ffi::c_uint,
4364 phase: Z3_lbool,
4365 ) -> bool;
4366 /// Create uninterpreted function declaration for the user propagator.
4367 /// When expressions using the function are created by the solver invoke a callback
4368 /// to \ref Z3_solver_propagate_created with arguments
4369 /// 1. context and callback solve
4370 /// 2. declared_expr: expression using function that was used as the top-level symbol
4371 /// 3. declared_id: a unique identifier (unique within the current scope) to track the expression.
4372 pub fn Z3_solver_propagate_declare(
4373 c: Z3_context,
4374 name: Z3_symbol,
4375 n: ::core::ffi::c_uint,
4376 domain: *mut Z3_sort,
4377 range: Z3_sort,
4378 ) -> Option<Z3_func_decl>;
4379 /// register an expression to propagate on with the solver.
4380 /// Only expressions of type Bool and type Bit-Vector can be registered for propagation.
4381 pub fn Z3_solver_propagate_register(c: Z3_context, s: Z3_solver, e: Z3_ast);
4382 /// register an expression to propagate on with the solver.
4383 /// Only expressions of type Bool and type Bit-Vector can be registered for propagation.
4384 /// Unlike \ref Z3_solver_propagate_register, this function takes a solver callback context
4385 /// as argument. It can be invoked during a callback to register new expressions.
4386 pub fn Z3_solver_propagate_register_cb(
4387 c: Z3_context,
4388 cb: Z3_solver_callback,
4389 e: Z3_ast,
4390 );
4391 /// propagate a consequence based on fixed values and equalities.
4392 /// A client may invoke it during the `propagate_fixed`, `propagate_eq`, `propagate_diseq`, and `propagate_final` callbacks.
4393 /// The callback adds a propagation consequence based on the fixed values passed `ids` and equalities `eqs` based on parameters `lhs`, `rhs`.
4394 ///
4395 /// The solver might discard the propagation in case it is true in the current state.
4396 /// The function returns false in this case; otw. the function returns true.
4397 /// At least one propagation in the final callback has to return true in order to
4398 /// prevent the solver from finishing.
4399 ///
4400 /// Assume the callback has the signature: `propagate_consequence_eh`(context, solver_cb, num_ids, ids, num_eqs, lhs, rhs, consequence).
4401 /// - `c`: - context
4402 /// - `solver_cb`: - solver callback
4403 /// - `num_ids`: - number of fixed terms used as premise to propagation
4404 /// - `ids`: - array of length `num_ids` containing terms that are fixed in the current scope
4405 /// - `num_eqs`: - number of equalities used as premise to propagation
4406 /// - `lhs`: - left side of equalities
4407 /// - `rhs`: - right side of equalities
4408 /// - `consequence`: - consequence to propagate. It is typically an atomic formula, but it can be an arbitrary formula.
4409 pub fn Z3_solver_propagate_consequence(
4410 c: Z3_context,
4411 cb: Z3_solver_callback,
4412 num_fixed: ::core::ffi::c_uint,
4413 fixed: *const Z3_ast,
4414 num_eqs: ::core::ffi::c_uint,
4415 eq_lhs: *const Z3_ast,
4416 eq_rhs: *const Z3_ast,
4417 conseq: Z3_ast,
4418 ) -> bool;
4419 /// provide an initialization hint to the solver. The initialization hint is used to calibrate an initial value of the expression that
4420 /// represents a variable. If the variable is Boolean, the initial phase is set according to `value`. If the variable is an integer or real,
4421 /// the initial Simplex tableau is recalibrated to attempt to follow the value assignment.
4422 pub fn Z3_solver_set_initial_value(
4423 c: Z3_context,
4424 s: Z3_solver,
4425 v: Z3_ast,
4426 val: Z3_ast,
4427 );
4428 /// Check whether the assertions in a given solver are consistent or not.
4429 ///
4430 /// The function [`Z3_solver_get_model`] retrieves a model if the
4431 /// assertions is satisfiable (i.e., the result is `Z3_L_TRUE`) and model construction is enabled.
4432 /// Note that if the call returns `Z3_L_UNDEF`, Z3 does not
4433 /// ensure that calls to [`Z3_solver_get_model`] succeed and any models
4434 /// produced in this case are not guaranteed to satisfy the assertions.
4435 ///
4436 /// The function [`Z3_solver_get_proof`] retrieves a proof if proof
4437 /// generation was enabled when the context was created, and the
4438 /// assertions are unsatisfiable (i.e., the result is `Z3_L_FALSE`).
4439 ///
4440 /// # See also
4441 ///
4442 /// - [`Z3_solver_check_assumptions`]
4443 pub fn Z3_solver_check(c: Z3_context, s: Z3_solver) -> Z3_lbool;
4444 /// Check whether the assertions in the given solver and
4445 /// optional assumptions are consistent or not.
4446 ///
4447 /// The function [`Z3_solver_get_unsat_core`] retrieves the subset of the
4448 /// assumptions used in the unsatisfiability proof produced by Z3.
4449 ///
4450 /// # See also
4451 ///
4452 /// - [`Z3_solver_check`]
4453 pub fn Z3_solver_check_assumptions(
4454 c: Z3_context,
4455 s: Z3_solver,
4456 num_assumptions: ::core::ffi::c_uint,
4457 assumptions: *const Z3_ast,
4458 ) -> Z3_lbool;
4459 /// Retrieve congruence class representatives for terms.
4460 ///
4461 /// The function can be used for relying on Z3 to identify equal terms under the current
4462 /// set of assumptions. The array of terms and array of class identifiers should have
4463 /// the same length. The class identifiers are numerals that are assigned to the same
4464 /// value for their corresponding terms if the current context forces the terms to be
4465 /// equal. You cannot deduce that terms corresponding to different numerals must be all different,
4466 /// (especially when using non-convex theories).
4467 /// All implied equalities are returned by this call.
4468 /// This means that two terms map to the same class identifier if and only if
4469 /// the current context implies that they are equal.
4470 ///
4471 /// A side-effect of the function is a satisfiability check on the assertions on the solver that is passed in.
4472 /// The function return `Z3_L_FALSE` if the current assertions are not satisfiable.
4473 pub fn Z3_get_implied_equalities(
4474 c: Z3_context,
4475 s: Z3_solver,
4476 num_terms: ::core::ffi::c_uint,
4477 terms: *const Z3_ast,
4478 class_ids: *mut ::core::ffi::c_uint,
4479 ) -> Z3_lbool;
4480 /// retrieve consequences from solver that determine values of the supplied function symbols.
4481 pub fn Z3_solver_get_consequences(
4482 c: Z3_context,
4483 s: Z3_solver,
4484 assumptions: Z3_ast_vector,
4485 variables: Z3_ast_vector,
4486 consequences: Z3_ast_vector,
4487 ) -> Z3_lbool;
4488 /// extract a next cube for a solver. The last cube is the constant `true` or `false`.
4489 /// The number of (non-constant) cubes is by default 1. For the sat solver cubing is controlled
4490 /// using parameters sat.lookahead.cube.cutoff and sat.lookahead.cube.fraction.
4491 ///
4492 /// The third argument is a vector of variables that may be used for cubing.
4493 /// The contents of the vector is only used in the first call. The initial list of variables
4494 /// is used in subsequent calls until it returns the unsatisfiable cube.
4495 /// The vector is modified to contain a set of Autarky variables that occur in clauses that
4496 /// are affected by the (last literal in the) cube. These variables could be used by a different
4497 /// cuber (on a different solver object) for further recursive cubing.
4498 ///
4499 /// The last argument is a backtracking level. It instructs the cube process to backtrack below
4500 /// the indicated level for the next cube.
4501 pub fn Z3_solver_cube(
4502 c: Z3_context,
4503 s: Z3_solver,
4504 vars: Z3_ast_vector,
4505 backtrack_level: ::core::ffi::c_uint,
4506 ) -> Option<Z3_ast_vector>;
4507 /// Retrieve the model for the last [`Z3_solver_check`] or [`Z3_solver_check_assumptions`]
4508 ///
4509 /// The error handler is invoked if a model is not available because
4510 /// the commands above were not invoked for the given solver, or if the result was `Z3_L_FALSE`.
4511 pub fn Z3_solver_get_model(c: Z3_context, s: Z3_solver) -> Option<Z3_model>;
4512 /// Retrieve the proof for the last [`Z3_solver_check`] or [`Z3_solver_check_assumptions`]
4513 ///
4514 /// The error handler is invoked if proof generation is not enabled,
4515 /// or if the commands above were not invoked for the given solver,
4516 /// or if the result was different from `Z3_L_FALSE`.
4517 pub fn Z3_solver_get_proof(c: Z3_context, s: Z3_solver) -> Option<Z3_ast>;
4518 /// Retrieve the unsat core for the last [`Z3_solver_check_assumptions`]
4519 /// The unsat core is a subset of the assumptions `a`.
4520 ///
4521 /// By default, the unsat core will not be minimized. Generation of a minimized
4522 /// unsat core can be enabled via the `"sat.core.minimize"` and `"smt.core.minimize"`
4523 /// settings for SAT and SMT cores respectively. Generation of minimized unsat cores
4524 /// will be more expensive.
4525 pub fn Z3_solver_get_unsat_core(
4526 c: Z3_context,
4527 s: Z3_solver,
4528 ) -> Option<Z3_ast_vector>;
4529 /// Return a brief justification for an "unknown" result (i.e., `Z3_L_UNDEF`) for
4530 /// the commands [`Z3_solver_check`] and [`Z3_solver_check_assumptions`]
4531 pub fn Z3_solver_get_reason_unknown(c: Z3_context, s: Z3_solver) -> Z3_string;
4532 /// Return statistics for the given solver.
4533 ///
4534 /// **Remark:** User must use [`Z3_stats_inc_ref`] and [`Z3_stats_dec_ref`] to manage Z3_stats objects.
4535 pub fn Z3_solver_get_statistics(c: Z3_context, s: Z3_solver) -> Option<Z3_stats>;
4536 /// Convert a solver into a string.
4537 ///
4538 /// # See also
4539 ///
4540 /// - [`Z3_solver_from_file`]
4541 /// - [`Z3_solver_from_string`]
4542 pub fn Z3_solver_to_string(c: Z3_context, s: Z3_solver) -> Z3_string;
4543 /// Convert a solver into a DIMACS formatted string.
4544 ///
4545 /// # See also
4546 ///
4547 /// - [`Z3_goal_to_dimacs_string`]
4548 pub fn Z3_solver_to_dimacs_string(
4549 c: Z3_context,
4550 s: Z3_solver,
4551 include_names: bool,
4552 ) -> Z3_string;
4553 /// Convert a statistics into a string.
4554 pub fn Z3_stats_to_string(c: Z3_context, s: Z3_stats) -> Z3_string;
4555 /// Increment the reference counter of the given statistics object.
4556 pub fn Z3_stats_inc_ref(c: Z3_context, s: Z3_stats);
4557 /// Decrement the reference counter of the given statistics object.
4558 pub fn Z3_stats_dec_ref(c: Z3_context, s: Z3_stats);
4559 /// Return the number of statistical data in `s`.
4560 pub fn Z3_stats_size(c: Z3_context, s: Z3_stats) -> ::core::ffi::c_uint;
4561 /// Return the key (a string) for a particular statistical data.
4562 ///
4563 /// # Preconditions
4564 ///
4565 /// - `idx < Z3_stats_size(c, s)`
4566 pub fn Z3_stats_get_key(
4567 c: Z3_context,
4568 s: Z3_stats,
4569 idx: ::core::ffi::c_uint,
4570 ) -> Z3_string;
4571 /// Return `true` if the given statistical data is a unsigned integer.
4572 ///
4573 /// # Preconditions
4574 ///
4575 /// - `idx < Z3_stats_size(c, s)`
4576 pub fn Z3_stats_is_uint(
4577 c: Z3_context,
4578 s: Z3_stats,
4579 idx: ::core::ffi::c_uint,
4580 ) -> bool;
4581 /// Return `true` if the given statistical data is a double.
4582 ///
4583 /// # Preconditions
4584 ///
4585 /// - `idx < Z3_stats_size(c, s)`
4586 pub fn Z3_stats_is_double(
4587 c: Z3_context,
4588 s: Z3_stats,
4589 idx: ::core::ffi::c_uint,
4590 ) -> bool;
4591 /// Return the unsigned value of the given statistical data.
4592 ///
4593 /// # Preconditions
4594 ///
4595 /// - `idx < Z3_stats_size(c, s) && Z3_stats_is_uint(c, s)`
4596 pub fn Z3_stats_get_uint_value(
4597 c: Z3_context,
4598 s: Z3_stats,
4599 idx: ::core::ffi::c_uint,
4600 ) -> ::core::ffi::c_uint;
4601 /// Return the double value of the given statistical data.
4602 ///
4603 /// # Preconditions
4604 ///
4605 /// - `idx < Z3_stats_size(c, s) && Z3_stats_is_double(c, s)`
4606 pub fn Z3_stats_get_double_value(
4607 c: Z3_context,
4608 s: Z3_stats,
4609 idx: ::core::ffi::c_uint,
4610 ) -> f64;
4611 /// Return the estimated allocated memory in bytes.
4612 pub fn Z3_get_estimated_alloc_size() -> u64;
4613 /// Return an empty AST vector.
4614 ///
4615 /// **Remark:** Reference counting must be used to manage AST vectors, even when the Z3_context was
4616 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4617 pub fn Z3_mk_ast_vector(c: Z3_context) -> Option<Z3_ast_vector>;
4618 /// Increment the reference counter of the given AST vector.
4619 pub fn Z3_ast_vector_inc_ref(c: Z3_context, v: Z3_ast_vector);
4620 /// Decrement the reference counter of the given AST vector.
4621 pub fn Z3_ast_vector_dec_ref(c: Z3_context, v: Z3_ast_vector);
4622 /// Return the size of the given AST vector.
4623 pub fn Z3_ast_vector_size(c: Z3_context, v: Z3_ast_vector) -> ::core::ffi::c_uint;
4624 /// Return the AST at position `i` in the AST vector `v`.
4625 ///
4626 /// # Preconditions
4627 ///
4628 /// - `i < Z3_ast_vector_size(c, v)`
4629 pub fn Z3_ast_vector_get(
4630 c: Z3_context,
4631 v: Z3_ast_vector,
4632 i: ::core::ffi::c_uint,
4633 ) -> Option<Z3_ast>;
4634 /// Update position `i` of the AST vector `v` with the AST `a`.
4635 ///
4636 /// # Preconditions
4637 ///
4638 /// - `i < Z3_ast_vector_size(c, v)`
4639 pub fn Z3_ast_vector_set(
4640 c: Z3_context,
4641 v: Z3_ast_vector,
4642 i: ::core::ffi::c_uint,
4643 a: Z3_ast,
4644 );
4645 /// Resize the AST vector `v`.
4646 pub fn Z3_ast_vector_resize(c: Z3_context, v: Z3_ast_vector, n: ::core::ffi::c_uint);
4647 /// Add the AST `a` in the end of the AST vector `v`. The size of `v` is increased by one.
4648 pub fn Z3_ast_vector_push(c: Z3_context, v: Z3_ast_vector, a: Z3_ast);
4649 /// Translate the AST vector `v` from context `s` into an AST vector in context `t`.
4650 pub fn Z3_ast_vector_translate(
4651 s: Z3_context,
4652 v: Z3_ast_vector,
4653 t: Z3_context,
4654 ) -> Option<Z3_ast_vector>;
4655 /// Convert AST vector into a string.
4656 pub fn Z3_ast_vector_to_string(c: Z3_context, v: Z3_ast_vector) -> Z3_string;
4657 /// Return an empty mapping from AST to AST
4658 ///
4659 /// **Remark:** Reference counting must be used to manage AST maps, even when the Z3_context was
4660 /// created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
4661 pub fn Z3_mk_ast_map(c: Z3_context) -> Option<Z3_ast_map>;
4662 /// Increment the reference counter of the given AST map.
4663 pub fn Z3_ast_map_inc_ref(c: Z3_context, m: Z3_ast_map);
4664 /// Decrement the reference counter of the given AST map.
4665 pub fn Z3_ast_map_dec_ref(c: Z3_context, m: Z3_ast_map);
4666 /// Return true if the map `m` contains the AST key `k`.
4667 pub fn Z3_ast_map_contains(c: Z3_context, m: Z3_ast_map, k: Z3_ast) -> bool;
4668 /// Return the value associated with the key `k`.
4669 ///
4670 /// The procedure invokes the error handler if `k` is not in the map.
4671 pub fn Z3_ast_map_find(c: Z3_context, m: Z3_ast_map, k: Z3_ast) -> Option<Z3_ast>;
4672 /// Store/Replace a new key, value pair in the given map.
4673 pub fn Z3_ast_map_insert(c: Z3_context, m: Z3_ast_map, k: Z3_ast, v: Z3_ast);
4674 /// Erase a key from the map.
4675 pub fn Z3_ast_map_erase(c: Z3_context, m: Z3_ast_map, k: Z3_ast);
4676 /// Remove all keys from the given map.
4677 pub fn Z3_ast_map_reset(c: Z3_context, m: Z3_ast_map);
4678 /// Return the size of the given map.
4679 pub fn Z3_ast_map_size(c: Z3_context, m: Z3_ast_map) -> ::core::ffi::c_uint;
4680 /// Return the keys stored in the given map.
4681 pub fn Z3_ast_map_keys(c: Z3_context, m: Z3_ast_map) -> Option<Z3_ast_vector>;
4682 /// Convert the given map into a string.
4683 pub fn Z3_ast_map_to_string(c: Z3_context, m: Z3_ast_map) -> Z3_string;
4684 /// Return `true` if `a` can be used as value in the Z3 real algebraic
4685 /// number package.
4686 pub fn Z3_algebraic_is_value(c: Z3_context, a: Z3_ast) -> bool;
4687 /// Return `true` if `a` is positive, and `false` otherwise.
4688 ///
4689 /// # Preconditions
4690 ///
4691 /// - `Z3_algebraic_is_value(c, a)`
4692 pub fn Z3_algebraic_is_pos(c: Z3_context, a: Z3_ast) -> bool;
4693 /// Return `true` if `a` is negative, and `false` otherwise.
4694 ///
4695 /// # Preconditions
4696 ///
4697 /// - `Z3_algebraic_is_value(c, a)`
4698 pub fn Z3_algebraic_is_neg(c: Z3_context, a: Z3_ast) -> bool;
4699 /// Return `true` if `a` is zero, and `false` otherwise.
4700 ///
4701 /// # Preconditions
4702 ///
4703 /// - `Z3_algebraic_is_value(c, a)`
4704 pub fn Z3_algebraic_is_zero(c: Z3_context, a: Z3_ast) -> bool;
4705 /// Return 1 if `a` is positive, 0 if `a` is zero, and -1 if `a` is negative.
4706 ///
4707 /// # Preconditions
4708 ///
4709 /// - `Z3_algebraic_is_value(c, a)`
4710 pub fn Z3_algebraic_sign(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_int;
4711 /// Return the value a + b.
4712 ///
4713 /// \post Z3_algebraic_is_value(c, result)
4714 ///
4715 /// # Preconditions
4716 ///
4717 /// - `Z3_algebraic_is_value(c, a)`
4718 /// - `Z3_algebraic_is_value(c, b)`
4719 pub fn Z3_algebraic_add(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
4720 /// Return the value a - b.
4721 ///
4722 /// \post Z3_algebraic_is_value(c, result)
4723 ///
4724 /// # Preconditions
4725 ///
4726 /// - `Z3_algebraic_is_value(c, a)`
4727 /// - `Z3_algebraic_is_value(c, b)`
4728 pub fn Z3_algebraic_sub(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
4729 /// Return the value a * b.
4730 ///
4731 /// \post Z3_algebraic_is_value(c, result)
4732 ///
4733 /// # Preconditions
4734 ///
4735 /// - `Z3_algebraic_is_value(c, a)`
4736 /// - `Z3_algebraic_is_value(c, b)`
4737 pub fn Z3_algebraic_mul(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
4738 /// Return the value a / b.
4739 ///
4740 /// \post Z3_algebraic_is_value(c, result)
4741 ///
4742 /// # Preconditions
4743 ///
4744 /// - `Z3_algebraic_is_value(c, a)`
4745 /// - `Z3_algebraic_is_value(c, b)`
4746 /// - `!Z3_algebraic_is_zero(c, b)`
4747 pub fn Z3_algebraic_div(c: Z3_context, a: Z3_ast, b: Z3_ast) -> Option<Z3_ast>;
4748 /// Return the a^(1/k)
4749 ///
4750 /// \post Z3_algebraic_is_value(c, result)
4751 ///
4752 /// # Preconditions
4753 ///
4754 /// - `Z3_algebraic_is_value(c, a)`
4755 /// - `k is even => !Z3_algebraic_is_neg(c, a)`
4756 pub fn Z3_algebraic_root(
4757 c: Z3_context,
4758 a: Z3_ast,
4759 k: ::core::ffi::c_uint,
4760 ) -> Option<Z3_ast>;
4761 /// Return the a^k
4762 ///
4763 /// \post Z3_algebraic_is_value(c, result)
4764 ///
4765 /// # Preconditions
4766 ///
4767 /// - `Z3_algebraic_is_value(c, a)`
4768 pub fn Z3_algebraic_power(
4769 c: Z3_context,
4770 a: Z3_ast,
4771 k: ::core::ffi::c_uint,
4772 ) -> Option<Z3_ast>;
4773 /// Return `true` if a < b, and `false` otherwise.
4774 ///
4775 /// # Preconditions
4776 ///
4777 /// - `Z3_algebraic_is_value(c, a)`
4778 /// - `Z3_algebraic_is_value(c, b)`
4779 pub fn Z3_algebraic_lt(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4780 /// Return `true` if a > b, and `false` otherwise.
4781 ///
4782 /// # Preconditions
4783 ///
4784 /// - `Z3_algebraic_is_value(c, a)`
4785 /// - `Z3_algebraic_is_value(c, b)`
4786 pub fn Z3_algebraic_gt(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4787 /// Return `true` if a <= b, and `false` otherwise.
4788 ///
4789 /// # Preconditions
4790 ///
4791 /// - `Z3_algebraic_is_value(c, a)`
4792 /// - `Z3_algebraic_is_value(c, b)`
4793 pub fn Z3_algebraic_le(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4794 /// Return `true` if a >= b, and `false` otherwise.
4795 ///
4796 /// # Preconditions
4797 ///
4798 /// - `Z3_algebraic_is_value(c, a)`
4799 /// - `Z3_algebraic_is_value(c, b)`
4800 pub fn Z3_algebraic_ge(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4801 /// Return `true` if a == b, and `false` otherwise.
4802 ///
4803 /// # Preconditions
4804 ///
4805 /// - `Z3_algebraic_is_value(c, a)`
4806 /// - `Z3_algebraic_is_value(c, b)`
4807 pub fn Z3_algebraic_eq(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4808 /// Return `true` if a != b, and `false` otherwise.
4809 ///
4810 /// # Preconditions
4811 ///
4812 /// - `Z3_algebraic_is_value(c, a)`
4813 /// - `Z3_algebraic_is_value(c, b)`
4814 pub fn Z3_algebraic_neq(c: Z3_context, a: Z3_ast, b: Z3_ast) -> bool;
4815 /// Given a multivariate polynomial p(x_0, ..., x_{n-1}, x_n), returns the
4816 /// roots of the univariate polynomial p(a\[0], ..., a\[n-1], x_n).
4817 ///
4818 /// \post forall r in result Z3_algebraic_is_value(c, result)
4819 ///
4820 /// # Preconditions
4821 ///
4822 /// - `p is a Z3 expression that contains only arithmetic terms and free variables.`
4823 /// - `forall i in [0, n) Z3_algebraic_is_value(c, a\[i])`
4824 pub fn Z3_algebraic_roots(
4825 c: Z3_context,
4826 p: Z3_ast,
4827 n: ::core::ffi::c_uint,
4828 a: *mut Z3_ast,
4829 ) -> Option<Z3_ast_vector>;
4830 /// Given a multivariate polynomial p(x_0, ..., x_{n-1}), return the
4831 /// sign of p(a\[0], ..., a\[n-1]).
4832 ///
4833 /// # Preconditions
4834 ///
4835 /// - `p is a Z3 expression that contains only arithmetic terms and free variables.`
4836 /// - `forall i in [0, n) Z3_algebraic_is_value(c, a\[i])`
4837 pub fn Z3_algebraic_eval(
4838 c: Z3_context,
4839 p: Z3_ast,
4840 n: ::core::ffi::c_uint,
4841 a: *mut Z3_ast,
4842 ) -> ::core::ffi::c_int;
4843 /// Return the coefficients of the defining polynomial.
4844 ///
4845 /// # Preconditions
4846 ///
4847 /// - `Z3_is_algebraic_number(c, a)`
4848 pub fn Z3_algebraic_get_poly(c: Z3_context, a: Z3_ast) -> Option<Z3_ast_vector>;
4849 /// Return which root of the polynomial the algebraic number represents.
4850 ///
4851 /// # Preconditions
4852 ///
4853 /// - `Z3_is_algebraic_number(c, a)`
4854 pub fn Z3_algebraic_get_i(c: Z3_context, a: Z3_ast) -> ::core::ffi::c_uint;
4855 /// Return the nonzero subresultants of `p` and `q` with respect to the "variable" `x`.
4856 ///
4857 /// Note that, any subterm that cannot be viewed as a polynomial is assumed to be a variable.
4858 /// Example: `f(a)` is a considered to be a variable in the polynomial \ccode{
4859 /// f(a)*f(a) + 2*f(a) + 1}
4860 ///
4861 /// # Preconditions
4862 ///
4863 /// - ``p`, `q` and `x` are Z3 expressions where `p` and `q` are arithmetic terms.`
4864 pub fn Z3_polynomial_subresultants(
4865 c: Z3_context,
4866 p: Z3_ast,
4867 q: Z3_ast,
4868 x: Z3_ast,
4869 ) -> Option<Z3_ast_vector>;
4870 /// Delete a RCF numeral created using the RCF API.
4871 pub fn Z3_rcf_del(c: Z3_context, a: Z3_rcf_num);
4872 /// Return a RCF rational using the given string.
4873 pub fn Z3_rcf_mk_rational(c: Z3_context, val: Z3_string) -> Option<Z3_rcf_num>;
4874 /// Return a RCF small integer.
4875 pub fn Z3_rcf_mk_small_int(
4876 c: Z3_context,
4877 val: ::core::ffi::c_int,
4878 ) -> Option<Z3_rcf_num>;
4879 /// Return Pi
4880 pub fn Z3_rcf_mk_pi(c: Z3_context) -> Option<Z3_rcf_num>;
4881 /// Return e (Euler's constant)
4882 pub fn Z3_rcf_mk_e(c: Z3_context) -> Option<Z3_rcf_num>;
4883 /// Return a new infinitesimal that is smaller than all elements in the Z3 field.
4884 pub fn Z3_rcf_mk_infinitesimal(c: Z3_context) -> Option<Z3_rcf_num>;
4885 /// Store in roots the roots of the polynomial `a[n-1]*x^{n-1` + ... + a\[0]}.
4886 /// The output vector `roots` must have size `n`.
4887 /// It returns the number of roots of the polynomial.
4888 ///
4889 /// # Preconditions
4890 ///
4891 /// - `The input polynomial is not the zero polynomial.`
4892 pub fn Z3_rcf_mk_roots(
4893 c: Z3_context,
4894 n: ::core::ffi::c_uint,
4895 a: *const Z3_rcf_num,
4896 roots: *mut Z3_rcf_num,
4897 ) -> ::core::ffi::c_uint;
4898 /// Return the value `a + b`.
4899 pub fn Z3_rcf_add(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
4900 /// Return the value `a - b`.
4901 pub fn Z3_rcf_sub(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
4902 /// Return the value `a * b`.
4903 pub fn Z3_rcf_mul(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
4904 /// Return the value `a / b`.
4905 pub fn Z3_rcf_div(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> Option<Z3_rcf_num>;
4906 /// Return the value `-a`.
4907 pub fn Z3_rcf_neg(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_rcf_num>;
4908 /// Return the value `1/a`.
4909 pub fn Z3_rcf_inv(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_rcf_num>;
4910 /// Return the value `a^k`.
4911 pub fn Z3_rcf_power(
4912 c: Z3_context,
4913 a: Z3_rcf_num,
4914 k: ::core::ffi::c_uint,
4915 ) -> Option<Z3_rcf_num>;
4916 /// Return `true` if `a < b`.
4917 pub fn Z3_rcf_lt(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4918 /// Return `true` if `a > b`.
4919 pub fn Z3_rcf_gt(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4920 /// Return `true` if `a <= b`.
4921 pub fn Z3_rcf_le(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4922 /// Return `true` if `a >= b`.
4923 pub fn Z3_rcf_ge(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4924 /// Return `true` if `a == b`.
4925 pub fn Z3_rcf_eq(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4926 /// Return `true` if `a != b`.
4927 pub fn Z3_rcf_neq(c: Z3_context, a: Z3_rcf_num, b: Z3_rcf_num) -> bool;
4928 /// Convert the RCF numeral into a string.
4929 pub fn Z3_rcf_num_to_string(
4930 c: Z3_context,
4931 a: Z3_rcf_num,
4932 compact: bool,
4933 html: bool,
4934 ) -> Z3_string;
4935 /// Convert the RCF numeral into a string in decimal notation.
4936 pub fn Z3_rcf_num_to_decimal_string(
4937 c: Z3_context,
4938 a: Z3_rcf_num,
4939 prec: ::core::ffi::c_uint,
4940 ) -> Z3_string;
4941 /// Extract the "numerator" and "denominator" of the given RCF numeral.
4942 /// We have that `a = n/d`, moreover `n` and `d` are not represented using rational functions.
4943 pub fn Z3_rcf_get_numerator_denominator(
4944 c: Z3_context,
4945 a: Z3_rcf_num,
4946 n: *mut Z3_rcf_num,
4947 d: *mut Z3_rcf_num,
4948 );
4949 /// Return `true` if `a` represents a rational number.
4950 pub fn Z3_rcf_is_rational(c: Z3_context, a: Z3_rcf_num) -> bool;
4951 /// Return `true` if `a` represents an algebraic number.
4952 pub fn Z3_rcf_is_algebraic(c: Z3_context, a: Z3_rcf_num) -> bool;
4953 /// Return `true` if `a` represents an infinitesimal.
4954 pub fn Z3_rcf_is_infinitesimal(c: Z3_context, a: Z3_rcf_num) -> bool;
4955 /// Return `true` if `a` represents a transcendental number.
4956 pub fn Z3_rcf_is_transcendental(c: Z3_context, a: Z3_rcf_num) -> bool;
4957 /// Return the index of a field extension.
4958 pub fn Z3_rcf_extension_index(c: Z3_context, a: Z3_rcf_num) -> ::core::ffi::c_uint;
4959 /// Return the name of a transcendental.
4960 ///
4961 /// # Preconditions
4962 ///
4963 /// - `Z3_rcf_is_transcendtal(ctx, a);`
4964 pub fn Z3_rcf_transcendental_name(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_symbol>;
4965 /// Return the name of an infinitesimal.
4966 ///
4967 /// # Preconditions
4968 ///
4969 /// - `Z3_rcf_is_infinitesimal(ctx, a);`
4970 pub fn Z3_rcf_infinitesimal_name(c: Z3_context, a: Z3_rcf_num) -> Option<Z3_symbol>;
4971 /// Return the number of coefficients in an algebraic number.
4972 ///
4973 /// # Preconditions
4974 ///
4975 /// - `Z3_rcf_is_algebraic(ctx, a);`
4976 pub fn Z3_rcf_num_coefficients(c: Z3_context, a: Z3_rcf_num) -> ::core::ffi::c_uint;
4977 /// Extract a coefficient from an algebraic number.
4978 ///
4979 /// # Preconditions
4980 ///
4981 /// - `Z3_rcf_is_algebraic(ctx, a);`
4982 pub fn Z3_rcf_coefficient(
4983 c: Z3_context,
4984 a: Z3_rcf_num,
4985 i: ::core::ffi::c_uint,
4986 ) -> Option<Z3_rcf_num>;
4987 /// Extract an interval from an algebraic number.
4988 ///
4989 /// # Preconditions
4990 ///
4991 /// - `Z3_rcf_is_algebraic(ctx, a);`
4992 pub fn Z3_rcf_interval(
4993 c: Z3_context,
4994 a: Z3_rcf_num,
4995 lower_is_inf: *mut bool,
4996 lower_is_open: *mut bool,
4997 lower: *mut Z3_rcf_num,
4998 upper_is_inf: *mut bool,
4999 upper_is_open: *mut bool,
5000 upper: *mut Z3_rcf_num,
5001 ) -> ::core::ffi::c_int;
5002 /// Return the number of sign conditions of an algebraic number.
5003 ///
5004 /// # Preconditions
5005 ///
5006 /// - `Z3_rcf_is_algebraic(ctx, a);`
5007 pub fn Z3_rcf_num_sign_conditions(
5008 c: Z3_context,
5009 a: Z3_rcf_num,
5010 ) -> ::core::ffi::c_uint;
5011 /// Extract the sign of a sign condition from an algebraic number.
5012 ///
5013 /// # Preconditions
5014 ///
5015 /// - `Z3_rcf_is_algebraic(ctx, a);`
5016 pub fn Z3_rcf_sign_condition_sign(
5017 c: Z3_context,
5018 a: Z3_rcf_num,
5019 i: ::core::ffi::c_uint,
5020 ) -> ::core::ffi::c_int;
5021 /// Return the number of sign condition polynomial coefficients of an algebraic number.
5022 ///
5023 /// # Preconditions
5024 ///
5025 /// - `Z3_rcf_is_algebraic(ctx, a);`
5026 pub fn Z3_rcf_num_sign_condition_coefficients(
5027 c: Z3_context,
5028 a: Z3_rcf_num,
5029 i: ::core::ffi::c_uint,
5030 ) -> ::core::ffi::c_uint;
5031 /// Extract the j-th polynomial coefficient of the i-th sign condition.
5032 ///
5033 /// # Preconditions
5034 ///
5035 /// - `Z3_rcf_is_algebraic(ctx, a);`
5036 pub fn Z3_rcf_sign_condition_coefficient(
5037 c: Z3_context,
5038 a: Z3_rcf_num,
5039 i: ::core::ffi::c_uint,
5040 j: ::core::ffi::c_uint,
5041 ) -> Option<Z3_rcf_num>;
5042 /// Create a new fixedpoint context.
5043 ///
5044 /// **Remark:** User must use [`Z3_fixedpoint_inc_ref`] and [`Z3_fixedpoint_dec_ref`] to manage fixedpoint objects.
5045 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5046 pub fn Z3_mk_fixedpoint(c: Z3_context) -> Option<Z3_fixedpoint>;
5047 /// Increment the reference counter of the given fixedpoint context
5048 pub fn Z3_fixedpoint_inc_ref(c: Z3_context, d: Z3_fixedpoint);
5049 /// Decrement the reference counter of the given fixedpoint context.
5050 pub fn Z3_fixedpoint_dec_ref(c: Z3_context, d: Z3_fixedpoint);
5051 /// Add a Database fact.
5052 ///
5053 /// - `c`: - context
5054 /// - `d`: - fixed point context
5055 /// - `r`: - relation signature for the row.
5056 /// - `num_args`: - number of columns for the given row.
5057 /// - `args`: - array of the row elements.
5058 ///
5059 /// The number of arguments `num_args` should be equal to the number
5060 /// of sorts in the domain of `r`. Each sort in the domain should be an integral
5061 /// (bit-vector, Boolean or or finite domain sort).
5062 ///
5063 /// The call has the same effect as adding a rule where `r` is applied to the arguments.
5064 pub fn Z3_fixedpoint_add_fact(
5065 c: Z3_context,
5066 d: Z3_fixedpoint,
5067 r: Z3_func_decl,
5068 num_args: ::core::ffi::c_uint,
5069 args: *mut ::core::ffi::c_uint,
5070 );
5071 /// Assert a constraint to the fixedpoint context.
5072 ///
5073 /// The constraints are used as background axioms when the fixedpoint engine uses the PDR mode.
5074 /// They are ignored for standard Datalog mode.
5075 pub fn Z3_fixedpoint_assert(c: Z3_context, d: Z3_fixedpoint, axiom: Z3_ast);
5076 /// Pose a query against the asserted rules.
5077 ///
5078 /// ```c
5079 /// query ::= (exists (bound-vars) query)
5080 /// | literals
5081 /// ```
5082 ///
5083 /// query returns
5084 /// - `Z3_L_FALSE` if the query is unsatisfiable.
5085 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by calling [`Z3_fixedpoint_get_answer`].
5086 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
5087 pub fn Z3_fixedpoint_query(
5088 c: Z3_context,
5089 d: Z3_fixedpoint,
5090 query: Z3_ast,
5091 ) -> Z3_lbool;
5092 /// Pose multiple queries against the asserted rules.
5093 ///
5094 /// The queries are encoded as relations (function declarations).
5095 ///
5096 /// query returns
5097 /// - `Z3_L_FALSE` if the query is unsatisfiable.
5098 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by calling [`Z3_fixedpoint_get_answer`].
5099 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
5100 pub fn Z3_fixedpoint_query_relations(
5101 c: Z3_context,
5102 d: Z3_fixedpoint,
5103 num_relations: ::core::ffi::c_uint,
5104 relations: *const Z3_func_decl,
5105 ) -> Z3_lbool;
5106 /// Retrieve a formula that encodes satisfying answers to the query.
5107 ///
5108 ///
5109 /// When used in Datalog mode, the returned answer is a disjunction of conjuncts.
5110 /// Each conjunct encodes values of the bound variables of the query that are satisfied.
5111 /// In PDR mode, the returned answer is a single conjunction.
5112 ///
5113 /// When used in Datalog mode the previous call to [`Z3_fixedpoint_query`] must have returned `Z3_L_TRUE`.
5114 /// When used with the PDR engine, the previous call must have been either `Z3_L_TRUE` or `Z3_L_FALSE`.
5115 pub fn Z3_fixedpoint_get_answer(c: Z3_context, d: Z3_fixedpoint) -> Option<Z3_ast>;
5116 /// Retrieve a string that describes the last status returned by [`Z3_fixedpoint_query`].
5117 ///
5118 /// Use this method when [`Z3_fixedpoint_query`] returns `Z3_L_UNDEF`.
5119 pub fn Z3_fixedpoint_get_reason_unknown(
5120 c: Z3_context,
5121 d: Z3_fixedpoint,
5122 ) -> Z3_string;
5123 /// Update a named rule.
5124 /// A rule with the same name must have been previously created.
5125 pub fn Z3_fixedpoint_update_rule(
5126 c: Z3_context,
5127 d: Z3_fixedpoint,
5128 a: Z3_ast,
5129 name: Z3_symbol,
5130 );
5131 /// Query the PDR engine for the maximal levels properties are known about predicate.
5132 ///
5133 /// This call retrieves the maximal number of relevant unfoldings
5134 /// of `pred` with respect to the current exploration state.
5135 /// Note: this functionality is PDR specific.
5136 pub fn Z3_fixedpoint_get_num_levels(
5137 c: Z3_context,
5138 d: Z3_fixedpoint,
5139 pred: Z3_func_decl,
5140 ) -> ::core::ffi::c_uint;
5141 /// Retrieve the current cover of `pred` up to `level` unfoldings.
5142 /// Return just the delta that is known at `level`. To
5143 /// obtain the full set of properties of `pred` one should query
5144 /// at `level`+1 , `level`+2 etc, and include `level`=-1.
5145 ///
5146 /// Note: this functionality is PDR specific.
5147 pub fn Z3_fixedpoint_get_cover_delta(
5148 c: Z3_context,
5149 d: Z3_fixedpoint,
5150 level: ::core::ffi::c_int,
5151 pred: Z3_func_decl,
5152 ) -> Option<Z3_ast>;
5153 /// Add property about the predicate `pred`.
5154 /// Add a property of predicate `pred` at `level`.
5155 /// It gets pushed forward when possible.
5156 ///
5157 /// Note: level = -1 is treated as the fixedpoint. So passing -1 for the `level`
5158 /// means that the property is true of the fixed-point unfolding with respect to `pred`.
5159 ///
5160 /// Note: this functionality is PDR specific.
5161 pub fn Z3_fixedpoint_add_cover(
5162 c: Z3_context,
5163 d: Z3_fixedpoint,
5164 level: ::core::ffi::c_int,
5165 pred: Z3_func_decl,
5166 property: Z3_ast,
5167 );
5168 /// Retrieve statistics information from the last call to [`Z3_fixedpoint_query`].
5169 pub fn Z3_fixedpoint_get_statistics(
5170 c: Z3_context,
5171 d: Z3_fixedpoint,
5172 ) -> Option<Z3_stats>;
5173 /// Register relation as Fixedpoint defined.
5174 /// Fixedpoint defined relations have least-fixedpoint semantics.
5175 /// For example, the relation is empty if it does not occur
5176 /// in a head or a fact.
5177 pub fn Z3_fixedpoint_register_relation(
5178 c: Z3_context,
5179 d: Z3_fixedpoint,
5180 f: Z3_func_decl,
5181 );
5182 /// Configure the predicate representation.
5183 ///
5184 /// It sets the predicate to use a set of domains given by the list of symbols.
5185 /// The domains given by the list of symbols must belong to a set
5186 /// of built-in domains.
5187 pub fn Z3_fixedpoint_set_predicate_representation(
5188 c: Z3_context,
5189 d: Z3_fixedpoint,
5190 f: Z3_func_decl,
5191 num_relations: ::core::ffi::c_uint,
5192 relation_kinds: *const Z3_symbol,
5193 );
5194 /// Retrieve set of rules from fixedpoint context.
5195 pub fn Z3_fixedpoint_get_rules(
5196 c: Z3_context,
5197 f: Z3_fixedpoint,
5198 ) -> Option<Z3_ast_vector>;
5199 /// Retrieve set of background assertions from fixedpoint context.
5200 pub fn Z3_fixedpoint_get_assertions(
5201 c: Z3_context,
5202 f: Z3_fixedpoint,
5203 ) -> Option<Z3_ast_vector>;
5204 /// Set parameters on fixedpoint context.
5205 ///
5206 /// # See also
5207 ///
5208 /// - [`Z3_fixedpoint_get_help`]
5209 /// - [`Z3_fixedpoint_get_param_descrs`]
5210 pub fn Z3_fixedpoint_set_params(c: Z3_context, f: Z3_fixedpoint, p: Z3_params);
5211 /// Return a string describing all fixedpoint available parameters.
5212 ///
5213 /// # See also
5214 ///
5215 /// - [`Z3_fixedpoint_get_param_descrs`]
5216 /// - [`Z3_fixedpoint_set_params`]
5217 pub fn Z3_fixedpoint_get_help(c: Z3_context, f: Z3_fixedpoint) -> Z3_string;
5218 /// Return the parameter description set for the given fixedpoint object.
5219 ///
5220 /// # See also
5221 ///
5222 /// - [`Z3_fixedpoint_get_help`]
5223 /// - [`Z3_fixedpoint_set_params`]
5224 pub fn Z3_fixedpoint_get_param_descrs(
5225 c: Z3_context,
5226 f: Z3_fixedpoint,
5227 ) -> Option<Z3_param_descrs>;
5228 /// Print the current rules and background axioms as a string.
5229 /// - `c`: - context.
5230 /// - `f`: - fixedpoint context.
5231 /// - `num_queries`: - number of additional queries to print.
5232 /// - `queries`: - additional queries.
5233 ///
5234 /// # See also
5235 ///
5236 /// - [`Z3_fixedpoint_from_file`]
5237 /// - [`Z3_fixedpoint_from_string`]
5238 pub fn Z3_fixedpoint_to_string(
5239 c: Z3_context,
5240 f: Z3_fixedpoint,
5241 num_queries: ::core::ffi::c_uint,
5242 queries: *mut Z3_ast,
5243 ) -> Z3_string;
5244 /// Parse an SMT-LIB2 string with fixedpoint rules.
5245 /// Add the rules to the current fixedpoint context.
5246 /// Return the set of queries in the string.
5247 ///
5248 /// - `c`: - context.
5249 /// - `f`: - fixedpoint context.
5250 /// - `s`: - string containing SMT2 specification.
5251 ///
5252 /// # See also
5253 ///
5254 /// - [`Z3_fixedpoint_from_file`]
5255 /// - [`Z3_fixedpoint_to_string`]
5256 pub fn Z3_fixedpoint_from_string(
5257 c: Z3_context,
5258 f: Z3_fixedpoint,
5259 s: Z3_string,
5260 ) -> Option<Z3_ast_vector>;
5261 /// Parse an SMT-LIB2 file with fixedpoint rules.
5262 /// Add the rules to the current fixedpoint context.
5263 /// Return the set of queries in the file.
5264 ///
5265 /// - `c`: - context.
5266 /// - `f`: - fixedpoint context.
5267 /// - `s`: - path to file containing SMT2 specification.
5268 ///
5269 /// # See also
5270 ///
5271 /// - [`Z3_fixedpoint_from_string`]
5272 /// - [`Z3_fixedpoint_to_string`]
5273 pub fn Z3_fixedpoint_from_file(
5274 c: Z3_context,
5275 f: Z3_fixedpoint,
5276 s: Z3_string,
5277 ) -> Option<Z3_ast_vector>;
5278 /// Initialize the context with a user-defined state.
5279 pub fn Z3_fixedpoint_init(
5280 c: Z3_context,
5281 d: Z3_fixedpoint,
5282 state: *mut ::core::ffi::c_void,
5283 );
5284 /// Register a callback to destructive updates.
5285 ///
5286 /// Registers are identified with terms encoded as fresh constants,
5287 pub fn Z3_fixedpoint_set_reduce_assign_callback(
5288 c: Z3_context,
5289 d: Z3_fixedpoint,
5290 cb: Z3_fixedpoint_reduce_assign_callback_fptr,
5291 );
5292 /// Register a callback for building terms based on the relational operators.
5293 pub fn Z3_fixedpoint_set_reduce_app_callback(
5294 c: Z3_context,
5295 d: Z3_fixedpoint,
5296 cb: Z3_fixedpoint_reduce_app_callback_fptr,
5297 );
5298 /// set export callback for lemmas
5299 pub fn Z3_fixedpoint_add_callback(
5300 ctx: Z3_context,
5301 f: Z3_fixedpoint,
5302 state: *mut ::core::ffi::c_void,
5303 new_lemma_eh: Z3_fixedpoint_new_lemma_eh,
5304 predecessor_eh: Z3_fixedpoint_predecessor_eh,
5305 unfold_eh: Z3_fixedpoint_unfold_eh,
5306 );
5307 pub fn Z3_fixedpoint_add_constraint(
5308 c: Z3_context,
5309 d: Z3_fixedpoint,
5310 e: Z3_ast,
5311 lvl: ::core::ffi::c_uint,
5312 );
5313 /// Create a new optimize context.
5314 ///
5315 /// **Remark:** User must use [`Z3_optimize_inc_ref`] and [`Z3_optimize_dec_ref`] to manage optimize objects.
5316 /// Even if the context was created using [`Z3_mk_context`] instead of [`Z3_mk_context_rc`].
5317 pub fn Z3_mk_optimize(c: Z3_context) -> Option<Z3_optimize>;
5318 /// Increment the reference counter of the given optimize context
5319 pub fn Z3_optimize_inc_ref(c: Z3_context, d: Z3_optimize);
5320 /// Decrement the reference counter of the given optimize context.
5321 pub fn Z3_optimize_dec_ref(c: Z3_context, d: Z3_optimize);
5322 /// Assert hard constraint to the optimization context.
5323 ///
5324 /// # See also
5325 ///
5326 /// - [`Z3_optimize_assert_soft`]
5327 /// - [`Z3_optimize_assert_and_track`]
5328 pub fn Z3_optimize_assert(c: Z3_context, o: Z3_optimize, a: Z3_ast);
5329 /// Assert tracked hard constraint to the optimization context.
5330 ///
5331 /// # See also
5332 ///
5333 /// - [`Z3_optimize_assert`]
5334 /// - [`Z3_optimize_assert_soft`]
5335 pub fn Z3_optimize_assert_and_track(
5336 c: Z3_context,
5337 o: Z3_optimize,
5338 a: Z3_ast,
5339 t: Z3_ast,
5340 );
5341 /// Add a maximization constraint.
5342 /// - `c`: - context
5343 /// - `o`: - optimization context
5344 /// - `t`: - arithmetical term
5345 ///
5346 /// # See also
5347 ///
5348 /// - [`Z3_optimize_minimize`]
5349 pub fn Z3_optimize_maximize(
5350 c: Z3_context,
5351 o: Z3_optimize,
5352 t: Z3_ast,
5353 ) -> ::core::ffi::c_uint;
5354 /// Add a minimization constraint.
5355 /// - `c`: - context
5356 /// - `o`: - optimization context
5357 /// - `t`: - arithmetical term
5358 ///
5359 /// # See also
5360 ///
5361 /// - [`Z3_optimize_maximize`]
5362 pub fn Z3_optimize_minimize(
5363 c: Z3_context,
5364 o: Z3_optimize,
5365 t: Z3_ast,
5366 ) -> ::core::ffi::c_uint;
5367 /// Create a backtracking point.
5368 ///
5369 /// The optimize solver contains a set of rules, added facts and assertions.
5370 /// The set of rules, facts and assertions are restored upon calling [`Z3_optimize_pop`].
5371 ///
5372 /// # See also
5373 ///
5374 /// - [`Z3_optimize_pop`]
5375 pub fn Z3_optimize_push(c: Z3_context, d: Z3_optimize);
5376 /// Backtrack one level.
5377 ///
5378 /// # Preconditions
5379 ///
5380 /// - `The number of calls to pop cannot exceed calls to push.`
5381 ///
5382 /// # See also
5383 ///
5384 /// - [`Z3_optimize_push`]
5385 pub fn Z3_optimize_pop(c: Z3_context, d: Z3_optimize);
5386 /// provide an initialization hint to the solver.
5387 /// The initialization hint is used to calibrate an initial value of the expression that
5388 /// represents a variable. If the variable is Boolean, the initial phase is set
5389 /// according to `value`. If the variable is an integer or real,
5390 /// the initial Simplex tableau is recalibrated to attempt to follow the value assignment.
5391 pub fn Z3_optimize_set_initial_value(
5392 c: Z3_context,
5393 o: Z3_optimize,
5394 v: Z3_ast,
5395 val: Z3_ast,
5396 );
5397 /// Check consistency and produce optimal values.
5398 /// - `c`: - context
5399 /// - `o`: - optimization context
5400 /// - `num_assumptions`: - number of additional assumptions
5401 /// - `assumptions`: - the additional assumptions
5402 ///
5403 /// # See also
5404 ///
5405 /// - [`Z3_optimize_get_reason_unknown`]
5406 /// - [`Z3_optimize_get_model`]
5407 /// - [`Z3_optimize_get_statistics`]
5408 /// - [`Z3_optimize_get_unsat_core`]
5409 pub fn Z3_optimize_check(
5410 c: Z3_context,
5411 o: Z3_optimize,
5412 num_assumptions: ::core::ffi::c_uint,
5413 assumptions: *const Z3_ast,
5414 ) -> Z3_lbool;
5415 /// Retrieve a string that describes the last status returned by [`Z3_optimize_check`].
5416 ///
5417 /// Use this method when [`Z3_optimize_check`] returns `Z3_L_UNDEF`.
5418 pub fn Z3_optimize_get_reason_unknown(c: Z3_context, d: Z3_optimize) -> Z3_string;
5419 /// Retrieve the model for the last [`Z3_optimize_check`]
5420 ///
5421 /// The error handler is invoked if a model is not available because
5422 /// the commands above were not invoked for the given optimization
5423 /// solver, or if the result was `Z3_L_FALSE`.
5424 pub fn Z3_optimize_get_model(c: Z3_context, o: Z3_optimize) -> Option<Z3_model>;
5425 /// Retrieve the unsat core for the last [`Z3_optimize_check`]
5426 /// The unsat core is a subset of the assumptions `a`.
5427 pub fn Z3_optimize_get_unsat_core(
5428 c: Z3_context,
5429 o: Z3_optimize,
5430 ) -> Option<Z3_ast_vector>;
5431 /// Set parameters on optimization context, including parameters for
5432 /// the underlying SMT solver.
5433 ///
5434 /// - `c`: - context
5435 /// - `o`: - optimization context
5436 /// - `p`: - parameters
5437 ///
5438 /// # See also
5439 ///
5440 /// - [`Z3_optimize_get_help`]
5441 /// - [`Z3_optimize_get_param_descrs`]
5442 pub fn Z3_optimize_set_params(c: Z3_context, o: Z3_optimize, p: Z3_params);
5443 /// Return the parameter description set for the given optimize object.
5444 ///
5445 /// - `c`: - context
5446 /// - `o`: - optimization context
5447 ///
5448 /// # See also
5449 ///
5450 /// - [`Z3_optimize_get_help`]
5451 /// - [`Z3_optimize_set_params`]
5452 pub fn Z3_optimize_get_param_descrs(
5453 c: Z3_context,
5454 o: Z3_optimize,
5455 ) -> Option<Z3_param_descrs>;
5456 /// Retrieve lower bound value or approximation for the i'th optimization objective.
5457 ///
5458 /// An attained, certified irrational algebraic optimum is returned as an
5459 /// exact algebraic numeral by both [`Z3_optimize_get_lower`] and
5460 /// [`Z3_optimize_get_upper`]. Use [`Z3_get_algebraic_number_lower`] and
5461 /// [`Z3_get_algebraic_number_upper`] to obtain rational approximations.
5462 ///
5463 /// A certified finite limit that is not attained includes an infinitesimal
5464 /// term: for example, `sqrt(2) - epsilon` for a supremum. The finite
5465 /// part can be algebraic even though the whole expression is not an
5466 /// algebraic numeral. Use [`Z3_optimize_get_lower_as_vector`] to inspect
5467 /// the finite part and the infinitesimal coefficient separately.
5468 ///
5469 /// - `c`: - context
5470 /// - `o`: - optimization context
5471 /// - `idx`: - index of optimization objective
5472 ///
5473 /// # See also
5474 ///
5475 /// - [`Z3_optimize_get_upper`]
5476 /// - [`Z3_optimize_get_lower_as_vector`]
5477 /// - [`Z3_optimize_get_upper_as_vector`]
5478 pub fn Z3_optimize_get_lower(
5479 c: Z3_context,
5480 o: Z3_optimize,
5481 idx: ::core::ffi::c_uint,
5482 ) -> Option<Z3_ast>;
5483 /// Retrieve upper bound value or approximation for the i'th optimization objective.
5484 ///
5485 /// Certified algebraic optima and finite open limits are returned
5486 /// as described for [`Z3_optimize_get_lower`].
5487 ///
5488 /// - `c`: - context
5489 /// - `o`: - optimization context
5490 /// - `idx`: - index of optimization objective
5491 ///
5492 /// # See also
5493 ///
5494 /// - [`Z3_optimize_get_lower`]
5495 /// - [`Z3_optimize_get_lower_as_vector`]
5496 /// - [`Z3_optimize_get_upper_as_vector`]
5497 pub fn Z3_optimize_get_upper(
5498 c: Z3_context,
5499 o: Z3_optimize,
5500 idx: ::core::ffi::c_uint,
5501 ) -> Option<Z3_ast>;
5502 /// Retrieve lower bound value or approximation for the i'th optimization objective.
5503 /// The returned vector is of length 3.
5504 /// Its entries are coefficients `a`, `b`, `c` and encode the result of
5505 /// [`Z3_optimize_get_lower`] `a * infinity + b + c * epsilon`.
5506 /// The coefficients `a` and `c` are rational numerals. The finite
5507 /// part `b` is a rational numeral or an exact irrational algebraic
5508 /// numeral when such a bound has been certified.
5509 /// For a finite attained optimum, `a` and `c` are zero. A finite
5510 /// open limit has `a` equal to zero and a nonzero infinitesimal
5511 /// coefficient `c`, even when `b` is algebraic.
5512 ///
5513 /// - `c`: - context
5514 /// - `o`: - optimization context
5515 /// - `idx`: - index of optimization objective
5516 ///
5517 /// # See also
5518 ///
5519 /// - [`Z3_optimize_get_lower`]
5520 /// - [`Z3_optimize_get_upper`]
5521 /// - [`Z3_optimize_get_upper_as_vector`]
5522 pub fn Z3_optimize_get_lower_as_vector(
5523 c: Z3_context,
5524 o: Z3_optimize,
5525 idx: ::core::ffi::c_uint,
5526 ) -> Option<Z3_ast_vector>;
5527 /// Retrieve upper bound value or approximation for the i'th optimization objective.
5528 ///
5529 /// The returned vector has the same coefficient and algebraic-value
5530 /// semantics as [`Z3_optimize_get_lower_as_vector`], and encodes the result
5531 /// of [`Z3_optimize_get_upper`].
5532 ///
5533 /// - `c`: - context
5534 /// - `o`: - optimization context
5535 /// - `idx`: - index of optimization objective
5536 ///
5537 /// # See also
5538 ///
5539 /// - [`Z3_optimize_get_lower`]
5540 /// - [`Z3_optimize_get_upper`]
5541 /// - [`Z3_optimize_get_lower_as_vector`]
5542 pub fn Z3_optimize_get_upper_as_vector(
5543 c: Z3_context,
5544 o: Z3_optimize,
5545 idx: ::core::ffi::c_uint,
5546 ) -> Option<Z3_ast_vector>;
5547 /// Print the current context as a string.
5548 /// - `c`: - context.
5549 /// - `o`: - optimization context.
5550 ///
5551 /// # See also
5552 ///
5553 /// - [`Z3_optimize_from_file`]
5554 /// - [`Z3_optimize_from_string`]
5555 pub fn Z3_optimize_to_string(c: Z3_context, o: Z3_optimize) -> Z3_string;
5556 /// Parse an SMT-LIB2 string with assertions,
5557 /// soft constraints and optimization objectives.
5558 /// Add the parsed constraints and objectives to the optimization context.
5559 ///
5560 /// - `c`: - context.
5561 /// - `o`: - optimize context.
5562 /// - `s`: - string containing SMT2 specification.
5563 ///
5564 /// # See also
5565 ///
5566 /// - [`Z3_optimize_from_file`]
5567 /// - [`Z3_optimize_to_string`]
5568 pub fn Z3_optimize_from_string(c: Z3_context, o: Z3_optimize, s: Z3_string);
5569 /// Parse an SMT-LIB2 file with assertions,
5570 /// soft constraints and optimization objectives.
5571 /// Add the parsed constraints and objectives to the optimization context.
5572 ///
5573 /// - `c`: - context.
5574 /// - `o`: - optimize context.
5575 /// - `s`: - path to file containing SMT2 specification.
5576 ///
5577 /// # See also
5578 ///
5579 /// - [`Z3_optimize_from_string`]
5580 /// - [`Z3_optimize_to_string`]
5581 pub fn Z3_optimize_from_file(c: Z3_context, o: Z3_optimize, s: Z3_string);
5582 /// Return a string containing a description of parameters accepted by optimize.
5583 ///
5584 /// # See also
5585 ///
5586 /// - [`Z3_optimize_get_param_descrs`]
5587 /// - [`Z3_optimize_set_params`]
5588 pub fn Z3_optimize_get_help(c: Z3_context, t: Z3_optimize) -> Z3_string;
5589 /// Retrieve statistics information from the last call to [`Z3_optimize_check`]
5590 pub fn Z3_optimize_get_statistics(c: Z3_context, d: Z3_optimize) -> Option<Z3_stats>;
5591 /// Return the set of asserted formulas on the optimization context.
5592 pub fn Z3_optimize_get_assertions(
5593 c: Z3_context,
5594 o: Z3_optimize,
5595 ) -> Option<Z3_ast_vector>;
5596 /// Return objectives on the optimization context.
5597 /// If the objective function is a max-sat objective it is returned
5598 /// as a Pseudo-Boolean (minimization) sum of the form `(+ (if f1 w1 0) (if f2 w2 0) ...)`
5599 /// If the objective function is entered as a maximization objective, then return
5600 /// the corresponding minimization objective. In this way the resulting objective
5601 /// function is always returned as a minimization objective.
5602 pub fn Z3_optimize_get_objectives(
5603 c: Z3_context,
5604 o: Z3_optimize,
5605 ) -> Option<Z3_ast_vector>;
5606 /// register a model event handler for new models.
5607 pub fn Z3_optimize_register_model_eh(
5608 c: Z3_context,
5609 o: Z3_optimize,
5610 m: Z3_model,
5611 ctx: *mut ::core::ffi::c_void,
5612 model_eh: Z3_model_eh,
5613 );
5614 /// Copy an optimization context from a source to a target context.
5615 ///
5616 /// This function allows translating an optimization context from one Z3_context
5617 /// to another. This is useful when working with multiple contexts and needing to
5618 /// transfer optimization problems between them.
5619 ///
5620 /// - `c`: Source context containing the optimization context to translate
5621 /// - `o`: The optimization context to translate from the source context
5622 /// - `target`: Target context where the optimization context will be created
5623 ///
5624 /// \return A new optimization context in the target context with the same state
5625 pub fn Z3_optimize_translate(
5626 c: Z3_context,
5627 o: Z3_optimize,
5628 target: Z3_context,
5629 ) -> Option<Z3_optimize>;
5630 /// Create the RoundingMode sort.
5631 ///
5632 /// - `c`: logical context
5633 ///
5634 /// # See also
5635 ///
5636 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
5637 /// - [`Z3_mk_fpa_rna`]
5638 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
5639 /// - [`Z3_mk_fpa_rne`]
5640 /// - [`Z3_mk_fpa_round_toward_negative`]
5641 /// - [`Z3_mk_fpa_rtn`]
5642 /// - [`Z3_mk_fpa_round_toward_positive`]
5643 /// - [`Z3_mk_fpa_rtp`]
5644 /// - [`Z3_mk_fpa_round_toward_zero`]
5645 /// - [`Z3_mk_fpa_rtz`]
5646 pub fn Z3_mk_fpa_rounding_mode_sort(c: Z3_context) -> Option<Z3_sort>;
5647 /// Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
5648 ///
5649 /// This is the same as [`Z3_mk_fpa_rne`].
5650 ///
5651 /// - `c`: logical context
5652 ///
5653 /// # See also
5654 ///
5655 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5656 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
5657 /// - [`Z3_mk_fpa_round_toward_negative`]
5658 /// - [`Z3_mk_fpa_round_toward_positive`]
5659 /// - [`Z3_mk_fpa_round_toward_zero`]
5660 pub fn Z3_mk_fpa_round_nearest_ties_to_even(c: Z3_context) -> Option<Z3_ast>;
5661 /// Create a numeral of RoundingMode sort which represents the NearestTiesToEven rounding mode.
5662 ///
5663 /// This is the same as [`Z3_mk_fpa_round_nearest_ties_to_even`].
5664 ///
5665 /// - `c`: logical context
5666 ///
5667 /// # See also
5668 ///
5669 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5670 /// - [`Z3_mk_fpa_rna`]
5671 /// - [`Z3_mk_fpa_rtn`]
5672 /// - [`Z3_mk_fpa_rtp`]
5673 /// - [`Z3_mk_fpa_rtz`]
5674 pub fn Z3_mk_fpa_rne(c: Z3_context) -> Option<Z3_ast>;
5675 /// Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
5676 ///
5677 /// This is the same as [`Z3_mk_fpa_rna`].
5678 ///
5679 /// - `c`: logical context
5680 ///
5681 /// # See also
5682 ///
5683 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5684 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
5685 /// - [`Z3_mk_fpa_round_toward_negative`]
5686 /// - [`Z3_mk_fpa_round_toward_positive`]
5687 /// - [`Z3_mk_fpa_round_toward_zero`]
5688 pub fn Z3_mk_fpa_round_nearest_ties_to_away(c: Z3_context) -> Option<Z3_ast>;
5689 /// Create a numeral of RoundingMode sort which represents the NearestTiesToAway rounding mode.
5690 ///
5691 /// This is the same as [`Z3_mk_fpa_round_nearest_ties_to_away`].
5692 ///
5693 /// - `c`: logical context
5694 ///
5695 /// # See also
5696 ///
5697 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5698 /// - [`Z3_mk_fpa_rne`]
5699 /// - [`Z3_mk_fpa_rtn`]
5700 /// - [`Z3_mk_fpa_rtp`]
5701 /// - [`Z3_mk_fpa_rtz`]
5702 pub fn Z3_mk_fpa_rna(c: Z3_context) -> Option<Z3_ast>;
5703 /// Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
5704 ///
5705 /// This is the same as [`Z3_mk_fpa_rtp`].
5706 ///
5707 /// - `c`: logical context
5708 ///
5709 /// # See also
5710 ///
5711 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5712 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
5713 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
5714 /// - [`Z3_mk_fpa_round_toward_negative`]
5715 /// - [`Z3_mk_fpa_round_toward_zero`]
5716 pub fn Z3_mk_fpa_round_toward_positive(c: Z3_context) -> Option<Z3_ast>;
5717 /// Create a numeral of RoundingMode sort which represents the TowardPositive rounding mode.
5718 ///
5719 /// This is the same as [`Z3_mk_fpa_round_toward_positive`].
5720 ///
5721 /// - `c`: logical context
5722 ///
5723 /// # See also
5724 ///
5725 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5726 /// - [`Z3_mk_fpa_rna`]
5727 /// - [`Z3_mk_fpa_rne`]
5728 /// - [`Z3_mk_fpa_rtn`]
5729 /// - [`Z3_mk_fpa_rtz`]
5730 pub fn Z3_mk_fpa_rtp(c: Z3_context) -> Option<Z3_ast>;
5731 /// Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
5732 ///
5733 /// This is the same as [`Z3_mk_fpa_rtn`].
5734 ///
5735 /// - `c`: logical context
5736 ///
5737 /// # See also
5738 ///
5739 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5740 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
5741 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
5742 /// - [`Z3_mk_fpa_round_toward_positive`]
5743 /// - [`Z3_mk_fpa_round_toward_zero`]
5744 pub fn Z3_mk_fpa_round_toward_negative(c: Z3_context) -> Option<Z3_ast>;
5745 /// Create a numeral of RoundingMode sort which represents the TowardNegative rounding mode.
5746 ///
5747 /// This is the same as [`Z3_mk_fpa_round_toward_negative`].
5748 ///
5749 /// - `c`: logical context
5750 ///
5751 /// # See also
5752 ///
5753 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5754 /// - [`Z3_mk_fpa_rna`]
5755 /// - [`Z3_mk_fpa_rne`]
5756 /// - [`Z3_mk_fpa_rtp`]
5757 /// - [`Z3_mk_fpa_rtz`]
5758 pub fn Z3_mk_fpa_rtn(c: Z3_context) -> Option<Z3_ast>;
5759 /// Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
5760 ///
5761 /// This is the same as [`Z3_mk_fpa_rtz`].
5762 ///
5763 /// - `c`: logical context
5764 ///
5765 /// # See also
5766 ///
5767 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5768 /// - [`Z3_mk_fpa_round_nearest_ties_to_away`]
5769 /// - [`Z3_mk_fpa_round_nearest_ties_to_even`]
5770 /// - [`Z3_mk_fpa_round_toward_negative`]
5771 /// - [`Z3_mk_fpa_round_toward_positive`]
5772 pub fn Z3_mk_fpa_round_toward_zero(c: Z3_context) -> Option<Z3_ast>;
5773 /// Create a numeral of RoundingMode sort which represents the TowardZero rounding mode.
5774 ///
5775 /// This is the same as [`Z3_mk_fpa_round_toward_zero`].
5776 ///
5777 /// - `c`: logical context
5778 ///
5779 /// # See also
5780 ///
5781 /// - [`Z3_mk_fpa_rounding_mode_sort`]
5782 /// - [`Z3_mk_fpa_rna`]
5783 /// - [`Z3_mk_fpa_rne`]
5784 /// - [`Z3_mk_fpa_rtn`]
5785 /// - [`Z3_mk_fpa_rtp`]
5786 pub fn Z3_mk_fpa_rtz(c: Z3_context) -> Option<Z3_ast>;
5787 /// Create a FloatingPoint sort.
5788 ///
5789 /// - `c`: logical context
5790 /// - `ebits`: number of exponent bits
5791 /// - `sbits`: number of significand bits
5792 ///
5793 /// **Remark:** `ebits` must be larger than 1 and `sbits` must be larger than 2.
5794 ///
5795 /// # See also
5796 ///
5797 /// - [`Z3_mk_fpa_sort_half`]
5798 /// - [`Z3_mk_fpa_sort_16`]
5799 /// - [`Z3_mk_fpa_sort_single`]
5800 /// - [`Z3_mk_fpa_sort_32`]
5801 /// - [`Z3_mk_fpa_sort_double`]
5802 /// - [`Z3_mk_fpa_sort_64`]
5803 /// - [`Z3_mk_fpa_sort_quadruple`]
5804 /// - [`Z3_mk_fpa_sort_128`]
5805 pub fn Z3_mk_fpa_sort(
5806 c: Z3_context,
5807 ebits: ::core::ffi::c_uint,
5808 sbits: ::core::ffi::c_uint,
5809 ) -> Option<Z3_sort>;
5810 /// Create the half-precision (16-bit) FloatingPoint sort.
5811 ///
5812 /// This is the same as [`Z3_mk_fpa_sort_16`].
5813 ///
5814 /// - `c`: logical context
5815 ///
5816 /// # See also
5817 ///
5818 /// - [`Z3_mk_fpa_sort`]
5819 /// - [`Z3_mk_fpa_sort_single`]
5820 /// - [`Z3_mk_fpa_sort_double`]
5821 /// - [`Z3_mk_fpa_sort_quadruple`]
5822 pub fn Z3_mk_fpa_sort_half(c: Z3_context) -> Option<Z3_sort>;
5823 /// Create the half-precision (16-bit) FloatingPoint sort.
5824 ///
5825 /// This is the same as [`Z3_mk_fpa_sort_half`].
5826 ///
5827 /// - `c`: logical context
5828 ///
5829 /// # See also
5830 ///
5831 /// - [`Z3_mk_fpa_sort`]
5832 /// - [`Z3_mk_fpa_sort_32`]
5833 /// - [`Z3_mk_fpa_sort_64`]
5834 /// - [`Z3_mk_fpa_sort_128`]
5835 pub fn Z3_mk_fpa_sort_16(c: Z3_context) -> Option<Z3_sort>;
5836 /// Create the single-precision (32-bit) FloatingPoint sort.
5837 ///
5838 /// This is the same as [`Z3_mk_fpa_sort_32`].
5839 ///
5840 /// - `c`: logical context.
5841 ///
5842 /// # See also
5843 ///
5844 /// - [`Z3_mk_fpa_sort`]
5845 /// - [`Z3_mk_fpa_sort_half`]
5846 /// - [`Z3_mk_fpa_sort_double`]
5847 /// - [`Z3_mk_fpa_sort_quadruple`]
5848 pub fn Z3_mk_fpa_sort_single(c: Z3_context) -> Option<Z3_sort>;
5849 /// Create the single-precision (32-bit) FloatingPoint sort.
5850 ///
5851 /// This is the same as [`Z3_mk_fpa_sort_single`].
5852 ///
5853 /// - `c`: logical context
5854 ///
5855 /// # See also
5856 ///
5857 /// - [`Z3_mk_fpa_sort`]
5858 /// - [`Z3_mk_fpa_sort_16`]
5859 /// - [`Z3_mk_fpa_sort_64`]
5860 /// - [`Z3_mk_fpa_sort_128`]
5861 pub fn Z3_mk_fpa_sort_32(c: Z3_context) -> Option<Z3_sort>;
5862 /// Create the double-precision (64-bit) FloatingPoint sort.
5863 ///
5864 /// This is the same as [`Z3_mk_fpa_sort_64`].
5865 ///
5866 /// - `c`: logical context
5867 ///
5868 /// # See also
5869 ///
5870 /// - [`Z3_mk_fpa_sort`]
5871 /// - [`Z3_mk_fpa_sort_half`]
5872 /// - [`Z3_mk_fpa_sort_single`]
5873 /// - [`Z3_mk_fpa_sort_quadruple`]
5874 pub fn Z3_mk_fpa_sort_double(c: Z3_context) -> Option<Z3_sort>;
5875 /// Create the double-precision (64-bit) FloatingPoint sort.
5876 ///
5877 /// This is the same as [`Z3_mk_fpa_sort_double`].
5878 ///
5879 /// - `c`: logical context
5880 ///
5881 /// # See also
5882 ///
5883 /// - [`Z3_mk_fpa_sort`]
5884 /// - [`Z3_mk_fpa_sort_16`]
5885 /// - [`Z3_mk_fpa_sort_32`]
5886 /// - [`Z3_mk_fpa_sort_128`]
5887 pub fn Z3_mk_fpa_sort_64(c: Z3_context) -> Option<Z3_sort>;
5888 /// Create the quadruple-precision (128-bit) FloatingPoint sort.
5889 ///
5890 /// This is the same as [`Z3_mk_fpa_sort_128`].
5891 ///
5892 /// - `c`: logical context
5893 ///
5894 /// # See also
5895 ///
5896 /// - [`Z3_mk_fpa_sort`]
5897 /// - [`Z3_mk_fpa_sort_half`]
5898 /// - [`Z3_mk_fpa_sort_single`]
5899 /// - [`Z3_mk_fpa_sort_double`]
5900 pub fn Z3_mk_fpa_sort_quadruple(c: Z3_context) -> Option<Z3_sort>;
5901 /// Create the quadruple-precision (128-bit) FloatingPoint sort.
5902 ///
5903 /// This is the same as [`Z3_mk_fpa_sort_quadruple`].
5904 ///
5905 /// - `c`: logical context
5906 ///
5907 /// # See also
5908 ///
5909 /// - [`Z3_mk_fpa_sort`]
5910 /// - [`Z3_mk_fpa_sort_16`]
5911 /// - [`Z3_mk_fpa_sort_32`]
5912 /// - [`Z3_mk_fpa_sort_64`]
5913 pub fn Z3_mk_fpa_sort_128(c: Z3_context) -> Option<Z3_sort>;
5914 /// Create a floating-point NaN of sort `s`.
5915 ///
5916 /// - `c`: logical context
5917 /// - `s`: target sort
5918 ///
5919 /// # See also
5920 ///
5921 /// - [`Z3_mk_fpa_inf`]
5922 /// - [`Z3_mk_fpa_is_nan`]
5923 /// - [`Z3_mk_fpa_zero`]
5924 pub fn Z3_mk_fpa_nan(c: Z3_context, s: Z3_sort) -> Option<Z3_ast>;
5925 /// Create a floating-point infinity of sort `s`.
5926 ///
5927 /// - `c`: logical context
5928 /// - `s`: target sort
5929 /// - `negative`: indicates whether the result should be negative
5930 ///
5931 /// When `negative` is `true`, -oo will be generated instead of +oo.
5932 ///
5933 /// # See also
5934 ///
5935 /// - [`Z3_mk_fpa_is_infinite`]
5936 /// - [`Z3_mk_fpa_nan`]
5937 /// - [`Z3_mk_fpa_zero`]
5938 pub fn Z3_mk_fpa_inf(c: Z3_context, s: Z3_sort, negative: bool) -> Option<Z3_ast>;
5939 /// Create a floating-point zero of sort `s`.
5940 ///
5941 /// - `c`: logical context
5942 /// - `s`: target sort
5943 /// - `negative`: indicates whether the result should be negative
5944 ///
5945 /// When `negative` is `true`, -zero will be generated instead of +zero.
5946 ///
5947 /// # See also
5948 ///
5949 /// - [`Z3_mk_fpa_inf`]
5950 /// - [`Z3_mk_fpa_is_zero`]
5951 /// - [`Z3_mk_fpa_nan`]
5952 pub fn Z3_mk_fpa_zero(c: Z3_context, s: Z3_sort, negative: bool) -> Option<Z3_ast>;
5953 /// Create an expression of FloatingPoint sort from three bit-vector expressions.
5954 ///
5955 /// This is the operator named `fp' in the SMT FP theory definition.
5956 /// Note that `sgn` is required to be a bit-vector of size 1. Significand and exponent
5957 /// are required to be longer than 1 and 2 respectively. The FloatingPoint sort
5958 /// of the resulting expression is automatically determined from the bit-vector sizes
5959 /// of the arguments. The exponent is assumed to be in IEEE-754 biased representation.
5960 ///
5961 /// - `c`: logical context
5962 /// - `sgn`: sign
5963 /// - `exp`: exponent
5964 /// - `sig`: significand
5965 ///
5966 /// # See also
5967 ///
5968 /// - [`Z3_mk_fpa_numeral_double`]
5969 /// - [`Z3_mk_fpa_numeral_float`]
5970 /// - [`Z3_mk_fpa_numeral_int`]
5971 /// - [`Z3_mk_fpa_numeral_int_uint`]
5972 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
5973 /// - [`Z3_mk_numeral`]
5974 pub fn Z3_mk_fpa_fp(
5975 c: Z3_context,
5976 sgn: Z3_ast,
5977 exp: Z3_ast,
5978 sig: Z3_ast,
5979 ) -> Option<Z3_ast>;
5980 /// Create a numeral of FloatingPoint sort from a float.
5981 ///
5982 /// This function is used to create numerals that fit in a float value.
5983 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
5984 ///
5985 /// - `c`: logical context
5986 /// - `v`: value
5987 /// - `ty`: sort
5988 ///
5989 /// `ty` must be a FloatingPoint sort
5990 ///
5991 /// # See also
5992 ///
5993 /// - [`Z3_mk_fpa_fp`]
5994 /// - [`Z3_mk_fpa_numeral_double`]
5995 /// - [`Z3_mk_fpa_numeral_int`]
5996 /// - [`Z3_mk_fpa_numeral_int_uint`]
5997 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
5998 /// - [`Z3_mk_numeral`]
5999 pub fn Z3_mk_fpa_numeral_float(c: Z3_context, v: f32, ty: Z3_sort) -> Option<Z3_ast>;
6000 /// Create a numeral of FloatingPoint sort from a double.
6001 ///
6002 /// This function is used to create numerals that fit in a double value.
6003 /// It is slightly faster than [`Z3_mk_numeral`] since it is not necessary to parse a string.
6004 ///
6005 /// - `c`: logical context
6006 /// - `v`: value
6007 /// - `ty`: sort
6008 ///
6009 /// `ty` must be a FloatingPoint sort
6010 ///
6011 /// # See also
6012 ///
6013 /// - [`Z3_mk_fpa_fp`]
6014 /// - [`Z3_mk_fpa_numeral_float`]
6015 /// - [`Z3_mk_fpa_numeral_int`]
6016 /// - [`Z3_mk_fpa_numeral_int_uint`]
6017 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
6018 /// - [`Z3_mk_numeral`]
6019 pub fn Z3_mk_fpa_numeral_double(
6020 c: Z3_context,
6021 v: f64,
6022 ty: Z3_sort,
6023 ) -> Option<Z3_ast>;
6024 /// Create a numeral of FloatingPoint sort from a signed integer.
6025 ///
6026 /// - `c`: logical context
6027 /// - `v`: value
6028 /// - `ty`: result sort
6029 ///
6030 /// `ty` must be a FloatingPoint sort
6031 ///
6032 /// # See also
6033 ///
6034 /// - [`Z3_mk_fpa_fp`]
6035 /// - [`Z3_mk_fpa_numeral_double`]
6036 /// - [`Z3_mk_fpa_numeral_float`]
6037 /// - [`Z3_mk_fpa_numeral_int_uint`]
6038 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
6039 /// - [`Z3_mk_numeral`]
6040 pub fn Z3_mk_fpa_numeral_int(
6041 c: Z3_context,
6042 v: ::core::ffi::c_int,
6043 ty: Z3_sort,
6044 ) -> Option<Z3_ast>;
6045 /// Create a numeral of FloatingPoint sort from a sign bit and two integers.
6046 ///
6047 /// - `c`: logical context
6048 /// - `sgn`: sign bit (true == negative)
6049 /// - `sig`: significand
6050 /// - `exp`: exponent
6051 /// - `ty`: result sort
6052 ///
6053 /// `ty` must be a FloatingPoint sort
6054 ///
6055 /// # See also
6056 ///
6057 /// - [`Z3_mk_fpa_fp`]
6058 /// - [`Z3_mk_fpa_numeral_double`]
6059 /// - [`Z3_mk_fpa_numeral_float`]
6060 /// - [`Z3_mk_fpa_numeral_int`]
6061 /// - [`Z3_mk_fpa_numeral_int64_uint64`]
6062 /// - [`Z3_mk_numeral`]
6063 pub fn Z3_mk_fpa_numeral_int_uint(
6064 c: Z3_context,
6065 sgn: bool,
6066 exp: ::core::ffi::c_int,
6067 sig: ::core::ffi::c_uint,
6068 ty: Z3_sort,
6069 ) -> Option<Z3_ast>;
6070 /// Create a numeral of FloatingPoint sort from a sign bit and two 64-bit integers.
6071 ///
6072 /// - `c`: logical context
6073 /// - `sgn`: sign bit (true == negative)
6074 /// - `sig`: significand
6075 /// - `exp`: exponent
6076 /// - `ty`: result sort
6077 ///
6078 /// `ty` must be a FloatingPoint sort
6079 ///
6080 /// # See also
6081 ///
6082 /// - [`Z3_mk_fpa_fp`]
6083 /// - [`Z3_mk_fpa_numeral_double`]
6084 /// - [`Z3_mk_fpa_numeral_float`]
6085 /// - [`Z3_mk_fpa_numeral_int`]
6086 /// - [`Z3_mk_fpa_numeral_int_uint`]
6087 /// - [`Z3_mk_numeral`]
6088 pub fn Z3_mk_fpa_numeral_int64_uint64(
6089 c: Z3_context,
6090 sgn: bool,
6091 exp: i64,
6092 sig: u64,
6093 ty: Z3_sort,
6094 ) -> Option<Z3_ast>;
6095 /// Floating-point absolute value
6096 ///
6097 /// - `c`: logical context
6098 /// - `t`: term of FloatingPoint sort
6099 ///
6100 /// # See also
6101 ///
6102 /// - [`Z3_mk_fpa_is_negative`]
6103 /// - [`Z3_mk_fpa_is_positive`]
6104 /// - [`Z3_mk_fpa_neg`]
6105 pub fn Z3_mk_fpa_abs(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6106 /// Floating-point negation
6107 ///
6108 /// - `c`: logical context
6109 /// - `t`: term of FloatingPoint sort
6110 ///
6111 /// # See also
6112 ///
6113 /// - [`Z3_mk_fpa_abs`]
6114 /// - [`Z3_mk_fpa_is_negative`]
6115 /// - [`Z3_mk_fpa_is_positive`]
6116 pub fn Z3_mk_fpa_neg(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6117 /// Floating-point addition
6118 ///
6119 /// - `c`: logical context
6120 /// - `rm`: term of RoundingMode sort
6121 /// - `t1`: term of FloatingPoint sort
6122 /// - `t2`: term of FloatingPoint sort
6123 ///
6124 /// `rm` must be of RoundingMode sort, `t1` and `t2` must have the same FloatingPoint sort.
6125 pub fn Z3_mk_fpa_add(
6126 c: Z3_context,
6127 rm: Z3_ast,
6128 t1: Z3_ast,
6129 t2: Z3_ast,
6130 ) -> Option<Z3_ast>;
6131 /// Floating-point subtraction
6132 ///
6133 /// - `c`: logical context
6134 /// - `rm`: term of RoundingMode sort
6135 /// - `t1`: term of FloatingPoint sort
6136 /// - `t2`: term of FloatingPoint sort
6137 ///
6138 /// `rm` must be of RoundingMode sort, `t1` and `t2` must have the same FloatingPoint sort.
6139 pub fn Z3_mk_fpa_sub(
6140 c: Z3_context,
6141 rm: Z3_ast,
6142 t1: Z3_ast,
6143 t2: Z3_ast,
6144 ) -> Option<Z3_ast>;
6145 /// Floating-point multiplication
6146 ///
6147 /// - `c`: logical context
6148 /// - `rm`: term of RoundingMode sort
6149 /// - `t1`: term of FloatingPoint sort
6150 /// - `t2`: term of FloatingPoint sort
6151 ///
6152 /// `rm` must be of RoundingMode sort, `t1` and `t2` must have the same FloatingPoint sort.
6153 pub fn Z3_mk_fpa_mul(
6154 c: Z3_context,
6155 rm: Z3_ast,
6156 t1: Z3_ast,
6157 t2: Z3_ast,
6158 ) -> Option<Z3_ast>;
6159 /// Floating-point division
6160 ///
6161 /// - `c`: logical context
6162 /// - `rm`: term of RoundingMode sort
6163 /// - `t1`: term of FloatingPoint sort.
6164 /// - `t2`: term of FloatingPoint sort
6165 ///
6166 /// The nodes `rm` must be of RoundingMode sort, `t1` and `t2` must have the same FloatingPoint sort.
6167 pub fn Z3_mk_fpa_div(
6168 c: Z3_context,
6169 rm: Z3_ast,
6170 t1: Z3_ast,
6171 t2: Z3_ast,
6172 ) -> Option<Z3_ast>;
6173 /// Floating-point fused multiply-add.
6174 ///
6175 /// - `c`: logical context
6176 /// - `rm`: term of RoundingMode sort
6177 /// - `t1`: term of FloatingPoint sort
6178 /// - `t2`: term of FloatingPoint sort
6179 /// - `t3`: term of FloatingPoint sort
6180 ///
6181 /// The result is `round((t1 * t2) + t3)`.
6182 ///
6183 /// `rm` must be of RoundingMode sort, `t1`, `t2`, and `t3` must have the same FloatingPoint sort.
6184 pub fn Z3_mk_fpa_fma(
6185 c: Z3_context,
6186 rm: Z3_ast,
6187 t1: Z3_ast,
6188 t2: Z3_ast,
6189 t3: Z3_ast,
6190 ) -> Option<Z3_ast>;
6191 /// Floating-point square root
6192 ///
6193 /// - `c`: logical context
6194 /// - `rm`: term of RoundingMode sort
6195 /// - `t`: term of FloatingPoint sort
6196 ///
6197 /// `rm` must be of RoundingMode sort, `t` must have FloatingPoint sort.
6198 pub fn Z3_mk_fpa_sqrt(c: Z3_context, rm: Z3_ast, t: Z3_ast) -> Option<Z3_ast>;
6199 /// Floating-point remainder
6200 ///
6201 /// - `c`: logical context
6202 /// - `t1`: term of FloatingPoint sort
6203 /// - `t2`: term of FloatingPoint sort
6204 ///
6205 /// `t1` and `t2` must have the same FloatingPoint sort.
6206 pub fn Z3_mk_fpa_rem(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6207 /// Floating-point roundToIntegral. Rounds a floating-point number to
6208 /// the closest integer, again represented as a floating-point number.
6209 ///
6210 /// - `c`: logical context
6211 /// - `rm`: term of RoundingMode sort
6212 /// - `t`: term of FloatingPoint sort
6213 ///
6214 /// `t` must be of FloatingPoint sort.
6215 pub fn Z3_mk_fpa_round_to_integral(
6216 c: Z3_context,
6217 rm: Z3_ast,
6218 t: Z3_ast,
6219 ) -> Option<Z3_ast>;
6220 /// Minimum of floating-point numbers.
6221 ///
6222 /// - `c`: logical context
6223 /// - `t1`: term of FloatingPoint sort
6224 /// - `t2`: term of FloatingPoint sort
6225 ///
6226 /// `t1`, `t2` must have the same FloatingPoint sort.
6227 ///
6228 /// # See also
6229 ///
6230 /// - [`Z3_mk_fpa_max`]
6231 pub fn Z3_mk_fpa_min(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6232 /// Maximum of floating-point numbers.
6233 ///
6234 /// - `c`: logical context
6235 /// - `t1`: term of FloatingPoint sort
6236 /// - `t2`: term of FloatingPoint sort
6237 ///
6238 /// `t1`, `t2` must have the same FloatingPoint sort.
6239 ///
6240 /// # See also
6241 ///
6242 /// - [`Z3_mk_fpa_min`]
6243 pub fn Z3_mk_fpa_max(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6244 /// Floating-point less than or equal.
6245 ///
6246 /// - `c`: logical context
6247 /// - `t1`: term of FloatingPoint sort
6248 /// - `t2`: term of FloatingPoint sort
6249 ///
6250 /// `t1` and `t2` must have the same FloatingPoint sort.
6251 ///
6252 /// # See also
6253 ///
6254 /// - [`Z3_mk_fpa_eq`]
6255 /// - [`Z3_mk_fpa_geq`]
6256 /// - [`Z3_mk_fpa_gt`]
6257 /// - [`Z3_mk_fpa_lt`]
6258 pub fn Z3_mk_fpa_leq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6259 /// Floating-point less than.
6260 ///
6261 /// - `c`: logical context
6262 /// - `t1`: term of FloatingPoint sort
6263 /// - `t2`: term of FloatingPoint sort
6264 ///
6265 /// `t1` and `t2` must have the same FloatingPoint sort.
6266 ///
6267 /// # See also
6268 ///
6269 /// - [`Z3_mk_fpa_eq`]
6270 /// - [`Z3_mk_fpa_geq`]
6271 /// - [`Z3_mk_fpa_gt`]
6272 /// - [`Z3_mk_fpa_leq`]
6273 pub fn Z3_mk_fpa_lt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6274 /// Floating-point greater than or equal.
6275 ///
6276 /// - `c`: logical context
6277 /// - `t1`: term of FloatingPoint sort
6278 /// - `t2`: term of FloatingPoint sort
6279 ///
6280 /// `t1` and `t2` must have the same FloatingPoint sort.
6281 ///
6282 /// # See also
6283 ///
6284 /// - [`Z3_mk_fpa_eq`]
6285 /// - [`Z3_mk_fpa_gt`]
6286 /// - [`Z3_mk_fpa_leq`]
6287 /// - [`Z3_mk_fpa_lt`]
6288 pub fn Z3_mk_fpa_geq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6289 /// Floating-point greater than.
6290 ///
6291 /// - `c`: logical context
6292 /// - `t1`: term of FloatingPoint sort
6293 /// - `t2`: term of FloatingPoint sort
6294 ///
6295 /// `t1` and `t2` must have the same FloatingPoint sort.
6296 ///
6297 /// # See also
6298 ///
6299 /// - [`Z3_mk_fpa_eq`]
6300 /// - [`Z3_mk_fpa_geq`]
6301 /// - [`Z3_mk_fpa_leq`]
6302 /// - [`Z3_mk_fpa_lt`]
6303 pub fn Z3_mk_fpa_gt(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6304 /// Floating-point equality.
6305 ///
6306 /// - `c`: logical context
6307 /// - `t1`: term of FloatingPoint sort
6308 /// - `t2`: term of FloatingPoint sort
6309 ///
6310 /// Note that this is IEEE 754 equality (as opposed to SMT-LIB `=`).
6311 ///
6312 /// `t1` and `t2` must have the same FloatingPoint sort.
6313 ///
6314 /// # See also
6315 ///
6316 /// - [`Z3_mk_fpa_geq`]
6317 /// - [`Z3_mk_fpa_gt`]
6318 /// - [`Z3_mk_fpa_leq`]
6319 /// - [`Z3_mk_fpa_lt`]
6320 pub fn Z3_mk_fpa_eq(c: Z3_context, t1: Z3_ast, t2: Z3_ast) -> Option<Z3_ast>;
6321 /// Predicate indicating whether `t` is a normal floating-point number.
6322 ///
6323 /// - `c`: logical context
6324 /// - `t`: term of FloatingPoint sort
6325 ///
6326 /// `t` must have FloatingPoint sort.
6327 ///
6328 /// # See also
6329 ///
6330 /// - [`Z3_mk_fpa_is_infinite`]
6331 /// - [`Z3_mk_fpa_is_nan`]
6332 /// - [`Z3_mk_fpa_is_subnormal`]
6333 /// - [`Z3_mk_fpa_is_zero`]
6334 pub fn Z3_mk_fpa_is_normal(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6335 /// Predicate indicating whether `t` is a subnormal floating-point number.
6336 ///
6337 /// - `c`: logical context
6338 /// - `t`: term of FloatingPoint sort
6339 ///
6340 /// `t` must have FloatingPoint sort.
6341 ///
6342 /// # See also
6343 ///
6344 /// - [`Z3_mk_fpa_is_infinite`]
6345 /// - [`Z3_mk_fpa_is_nan`]
6346 /// - [`Z3_mk_fpa_is_normal`]
6347 /// - [`Z3_mk_fpa_is_zero`]
6348 pub fn Z3_mk_fpa_is_subnormal(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6349 /// Predicate indicating whether `t` is a floating-point number with zero value, i.e., +zero or -zero.
6350 ///
6351 /// - `c`: logical context
6352 /// - `t`: term of FloatingPoint sort
6353 ///
6354 /// `t` must have FloatingPoint sort.
6355 ///
6356 /// # See also
6357 ///
6358 /// - [`Z3_mk_fpa_is_infinite`]
6359 /// - [`Z3_mk_fpa_is_nan`]
6360 /// - [`Z3_mk_fpa_is_normal`]
6361 /// - [`Z3_mk_fpa_is_subnormal`]
6362 /// - [`Z3_mk_fpa_zero`]
6363 pub fn Z3_mk_fpa_is_zero(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6364 /// Predicate indicating whether `t` is a floating-point number representing +oo or -oo.
6365 ///
6366 /// - `c`: logical context
6367 /// - `t`: term of FloatingPoint sort
6368 ///
6369 /// `t` must have FloatingPoint sort.
6370 ///
6371 /// # See also
6372 ///
6373 /// - [`Z3_mk_fpa_inf`]
6374 /// - [`Z3_mk_fpa_is_nan`]
6375 /// - [`Z3_mk_fpa_is_normal`]
6376 /// - [`Z3_mk_fpa_is_subnormal`]
6377 /// - [`Z3_mk_fpa_is_zero`]
6378 pub fn Z3_mk_fpa_is_infinite(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6379 /// Predicate indicating whether `t` is a NaN.
6380 ///
6381 /// - `c`: logical context
6382 /// - `t`: term of FloatingPoint sort
6383 ///
6384 /// `t` must have FloatingPoint sort.
6385 ///
6386 /// # See also
6387 ///
6388 /// - [`Z3_mk_fpa_is_infinite`]
6389 /// - [`Z3_mk_fpa_is_normal`]
6390 /// - [`Z3_mk_fpa_is_subnormal`]
6391 /// - [`Z3_mk_fpa_is_zero`]
6392 /// - [`Z3_mk_fpa_nan`]
6393 pub fn Z3_mk_fpa_is_nan(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6394 /// Predicate indicating whether `t` is a negative floating-point number.
6395 ///
6396 /// - `c`: logical context
6397 /// - `t`: term of FloatingPoint sort
6398 ///
6399 /// `t` must have FloatingPoint sort.
6400 ///
6401 /// # See also
6402 ///
6403 /// - [`Z3_mk_fpa_abs`]
6404 /// - [`Z3_mk_fpa_is_positive`]
6405 /// - [`Z3_mk_fpa_neg`]
6406 pub fn Z3_mk_fpa_is_negative(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6407 /// Predicate indicating whether `t` is a positive floating-point number.
6408 ///
6409 /// - `c`: logical context
6410 /// - `t`: term of FloatingPoint sort
6411 ///
6412 /// `t` must have FloatingPoint sort.
6413 ///
6414 /// # See also
6415 ///
6416 /// - [`Z3_mk_fpa_abs`]
6417 /// - [`Z3_mk_fpa_is_negative`]
6418 /// - [`Z3_mk_fpa_neg`]
6419 pub fn Z3_mk_fpa_is_positive(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6420 /// Conversion of a single IEEE 754-2008 bit-vector into a floating-point number.
6421 ///
6422 /// Produces a term that represents the conversion of a bit-vector term `bv` to a
6423 /// floating-point term of sort `s`.
6424 ///
6425 /// - `c`: logical context
6426 /// - `bv`: a bit-vector term
6427 /// - `s`: floating-point sort
6428 ///
6429 /// `s` must be a FloatingPoint sort, `t` must be of bit-vector sort, and the bit-vector
6430 /// size of `bv` must be equal to `ebits+sbits` of `s`. The format of the bit-vector is
6431 /// as defined by the IEEE 754-2008 interchange format.
6432 pub fn Z3_mk_fpa_to_fp_bv(c: Z3_context, bv: Z3_ast, s: Z3_sort) -> Option<Z3_ast>;
6433 /// Conversion of a FloatingPoint term into another term of different FloatingPoint sort.
6434 ///
6435 /// Produces a term that represents the conversion of a floating-point term `t` to a
6436 /// floating-point term of sort `s`. If necessary, the result will be rounded according
6437 /// to rounding mode `rm`.
6438 ///
6439 /// - `c`: logical context
6440 /// - `rm`: term of RoundingMode sort
6441 /// - `t`: term of FloatingPoint sort
6442 /// - `s`: floating-point sort
6443 ///
6444 /// `s` must be a FloatingPoint sort, `rm` must be of RoundingMode sort, `t` must be of floating-point sort.
6445 pub fn Z3_mk_fpa_to_fp_float(
6446 c: Z3_context,
6447 rm: Z3_ast,
6448 t: Z3_ast,
6449 s: Z3_sort,
6450 ) -> Option<Z3_ast>;
6451 /// Conversion of a term of real sort into a term of FloatingPoint sort.
6452 ///
6453 /// Produces a term that represents the conversion of term `t` of real sort into a
6454 /// floating-point term of sort `s`. If necessary, the result will be rounded according
6455 /// to rounding mode `rm`.
6456 ///
6457 /// - `c`: logical context
6458 /// - `rm`: term of RoundingMode sort
6459 /// - `t`: term of Real sort
6460 /// - `s`: floating-point sort
6461 ///
6462 /// `s` must be a FloatingPoint sort, `rm` must be of RoundingMode sort, `t` must be of real sort.
6463 pub fn Z3_mk_fpa_to_fp_real(
6464 c: Z3_context,
6465 rm: Z3_ast,
6466 t: Z3_ast,
6467 s: Z3_sort,
6468 ) -> Option<Z3_ast>;
6469 /// Conversion of a 2's complement signed bit-vector term into a term of FloatingPoint sort.
6470 ///
6471 /// Produces a term that represents the conversion of the bit-vector term `t` into a
6472 /// floating-point term of sort `s`. The bit-vector `t` is taken to be in signed
6473 /// 2's complement format. If necessary, the result will be rounded according
6474 /// to rounding mode `rm`.
6475 ///
6476 /// - `c`: logical context
6477 /// - `rm`: term of RoundingMode sort
6478 /// - `t`: term of bit-vector sort
6479 /// - `s`: floating-point sort
6480 ///
6481 /// `s` must be a FloatingPoint sort, `rm` must be of RoundingMode sort, `t` must be of bit-vector sort.
6482 pub fn Z3_mk_fpa_to_fp_signed(
6483 c: Z3_context,
6484 rm: Z3_ast,
6485 t: Z3_ast,
6486 s: Z3_sort,
6487 ) -> Option<Z3_ast>;
6488 /// Conversion of a 2's complement unsigned bit-vector term into a term of FloatingPoint sort.
6489 ///
6490 /// Produces a term that represents the conversion of the bit-vector term `t` into a
6491 /// floating-point term of sort `s`. The bit-vector `t` is taken to be in unsigned
6492 /// 2's complement format. If necessary, the result will be rounded according
6493 /// to rounding mode `rm`.
6494 ///
6495 /// - `c`: logical context
6496 /// - `rm`: term of RoundingMode sort
6497 /// - `t`: term of bit-vector sort
6498 /// - `s`: floating-point sort
6499 ///
6500 /// `s` must be a FloatingPoint sort, `rm` must be of RoundingMode sort, `t` must be of bit-vector sort.
6501 pub fn Z3_mk_fpa_to_fp_unsigned(
6502 c: Z3_context,
6503 rm: Z3_ast,
6504 t: Z3_ast,
6505 s: Z3_sort,
6506 ) -> Option<Z3_ast>;
6507 /// Conversion of a floating-point term into an unsigned bit-vector.
6508 ///
6509 /// Produces a term that represents the conversion of the floating-point term `t` into a
6510 /// bit-vector term of size `sz` in unsigned 2's complement format. If necessary, the result
6511 /// will be rounded according to rounding mode `rm`.
6512 ///
6513 /// - `c`: logical context
6514 /// - `rm`: term of RoundingMode sort
6515 /// - `t`: term of FloatingPoint sort
6516 /// - `sz`: size of the resulting bit-vector
6517 pub fn Z3_mk_fpa_to_ubv(
6518 c: Z3_context,
6519 rm: Z3_ast,
6520 t: Z3_ast,
6521 sz: ::core::ffi::c_uint,
6522 ) -> Option<Z3_ast>;
6523 /// Conversion of a floating-point term into a signed bit-vector.
6524 ///
6525 /// Produces a term that represents the conversion of the floating-point term `t` into a
6526 /// bit-vector term of size `sz` in signed 2's complement format. If necessary, the result
6527 /// will be rounded according to rounding mode `rm`.
6528 ///
6529 /// - `c`: logical context
6530 /// - `rm`: term of RoundingMode sort
6531 /// - `t`: term of FloatingPoint sort
6532 /// - `sz`: size of the resulting bit-vector
6533 pub fn Z3_mk_fpa_to_sbv(
6534 c: Z3_context,
6535 rm: Z3_ast,
6536 t: Z3_ast,
6537 sz: ::core::ffi::c_uint,
6538 ) -> Option<Z3_ast>;
6539 /// Conversion of a floating-point term into a real-numbered term.
6540 ///
6541 /// Produces a term that represents the conversion of the floating-point term `t` into a
6542 /// real number. Note that this type of conversion will often result in non-linear
6543 /// constraints over real terms.
6544 ///
6545 /// - `c`: logical context
6546 /// - `t`: term of FloatingPoint sort
6547 pub fn Z3_mk_fpa_to_real(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6548 /// Retrieves the number of bits reserved for the exponent in a FloatingPoint sort.
6549 ///
6550 /// - `c`: logical context
6551 /// - `s`: FloatingPoint sort
6552 ///
6553 /// # See also
6554 ///
6555 /// - [`Z3_fpa_get_sbits`]
6556 pub fn Z3_fpa_get_ebits(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
6557 /// Retrieves the number of bits reserved for the significand in a FloatingPoint sort.
6558 ///
6559 /// - `c`: logical context
6560 /// - `s`: FloatingPoint sort
6561 ///
6562 /// # See also
6563 ///
6564 /// - [`Z3_fpa_get_ebits`]
6565 pub fn Z3_fpa_get_sbits(c: Z3_context, s: Z3_sort) -> ::core::ffi::c_uint;
6566 /// Checks whether a given ast is a floating-point numeral.
6567 ///
6568 /// - `c`: logical context
6569 /// - `t`: an ast
6570 ///
6571 /// # See also
6572 ///
6573 /// - [`Z3_fpa_is_numeral_nan`]
6574 /// - [`Z3_fpa_is_numeral_inf`]
6575 /// - [`Z3_fpa_is_numeral_normal`]
6576 /// - [`Z3_fpa_is_numeral_subnormal`]
6577 /// - [`Z3_fpa_is_numeral_zero`]
6578 pub fn Z3_fpa_is_numeral(c: Z3_context, t: Z3_ast) -> bool;
6579 /// Checks whether a given floating-point numeral is a NaN.
6580 ///
6581 /// - `c`: logical context
6582 /// - `t`: a floating-point numeral
6583 ///
6584 /// # See also
6585 ///
6586 /// - [`Z3_fpa_is_numeral_inf`]
6587 /// - [`Z3_fpa_is_numeral_normal`]
6588 /// - [`Z3_fpa_is_numeral_subnormal`]
6589 /// - [`Z3_fpa_is_numeral_zero`]
6590 pub fn Z3_fpa_is_numeral_nan(c: Z3_context, t: Z3_ast) -> bool;
6591 /// Checks whether a given floating-point numeral is a +oo or -oo.
6592 ///
6593 /// - `c`: logical context
6594 /// - `t`: a floating-point numeral
6595 ///
6596 /// # See also
6597 ///
6598 /// - [`Z3_fpa_is_numeral_nan`]
6599 /// - [`Z3_fpa_is_numeral_normal`]
6600 /// - [`Z3_fpa_is_numeral_subnormal`]
6601 /// - [`Z3_fpa_is_numeral_zero`]
6602 pub fn Z3_fpa_is_numeral_inf(c: Z3_context, t: Z3_ast) -> bool;
6603 /// Checks whether a given floating-point numeral is +zero or -zero.
6604 ///
6605 /// - `c`: logical context
6606 /// - `t`: a floating-point numeral
6607 ///
6608 /// # See also
6609 ///
6610 /// - [`Z3_fpa_is_numeral_inf`]
6611 /// - [`Z3_fpa_is_numeral_nan`]
6612 /// - [`Z3_fpa_is_numeral_normal`]
6613 /// - [`Z3_fpa_is_numeral_subnormal`]
6614 pub fn Z3_fpa_is_numeral_zero(c: Z3_context, t: Z3_ast) -> bool;
6615 /// Checks whether a given floating-point numeral is normal.
6616 ///
6617 /// - `c`: logical context
6618 /// - `t`: a floating-point numeral
6619 ///
6620 /// # See also
6621 ///
6622 /// - [`Z3_fpa_is_numeral_inf`]
6623 /// - [`Z3_fpa_is_numeral_nan`]
6624 /// - [`Z3_fpa_is_numeral_subnormal`]
6625 /// - [`Z3_fpa_is_numeral_zero`]
6626 pub fn Z3_fpa_is_numeral_normal(c: Z3_context, t: Z3_ast) -> bool;
6627 /// Checks whether a given floating-point numeral is subnormal.
6628 ///
6629 /// - `c`: logical context
6630 /// - `t`: a floating-point numeral
6631 ///
6632 /// # See also
6633 ///
6634 /// - [`Z3_fpa_is_numeral_inf`]
6635 /// - [`Z3_fpa_is_numeral_nan`]
6636 /// - [`Z3_fpa_is_numeral_normal`]
6637 /// - [`Z3_fpa_is_numeral_zero`]
6638 pub fn Z3_fpa_is_numeral_subnormal(c: Z3_context, t: Z3_ast) -> bool;
6639 /// Checks whether a given floating-point numeral is positive.
6640 ///
6641 /// - `c`: logical context
6642 /// - `t`: a floating-point numeral
6643 ///
6644 /// # See also
6645 ///
6646 /// - [`Z3_fpa_is_numeral_negative`]
6647 pub fn Z3_fpa_is_numeral_positive(c: Z3_context, t: Z3_ast) -> bool;
6648 /// Checks whether a given floating-point numeral is negative.
6649 ///
6650 /// - `c`: logical context
6651 /// - `t`: a floating-point numeral
6652 ///
6653 /// # See also
6654 ///
6655 /// - [`Z3_fpa_is_numeral_positive`]
6656 pub fn Z3_fpa_is_numeral_negative(c: Z3_context, t: Z3_ast) -> bool;
6657 /// Retrieves the sign of a floating-point literal as a bit-vector expression.
6658 ///
6659 /// - `c`: logical context
6660 /// - `t`: a floating-point numeral
6661 ///
6662 /// Remarks: NaN is an invalid argument.
6663 pub fn Z3_fpa_get_numeral_sign_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6664 /// Retrieves the significand of a floating-point literal as a bit-vector expression.
6665 ///
6666 /// - `c`: logical context
6667 /// - `t`: a floating-point numeral
6668 ///
6669 /// Remarks: NaN is an invalid argument.
6670 pub fn Z3_fpa_get_numeral_significand_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6671 /// Retrieves the sign of a floating-point literal.
6672 ///
6673 /// - `c`: logical context
6674 /// - `t`: a floating-point numeral
6675 /// - `sgn`: the retrieved sign
6676 ///
6677 /// **Returns:** true if `t` corresponds to a floating point numeral, otherwise invokes exception handler or returns false
6678 ///
6679 /// Remarks: sets `sgn` to `false` if `t' is positive and to `true` otherwise, except for
6680 /// NaN, which is an invalid argument.
6681 pub fn Z3_fpa_get_numeral_sign(c: Z3_context, t: Z3_ast, sgn: *mut bool) -> bool;
6682 /// Return the significand value of a floating-point numeral as a string.
6683 ///
6684 /// - `c`: logical context
6685 /// - `t`: a floating-point numeral
6686 ///
6687 /// **Returns:** true if `t` corresponds to a floating point numeral, otherwise invokes exception handler or returns false
6688 ///
6689 /// Remarks: The significand `s` is always `0.0 <= s < 2.0`; the resulting string is long
6690 /// enough to represent the real significand precisely.
6691 pub fn Z3_fpa_get_numeral_significand_string(c: Z3_context, t: Z3_ast) -> Z3_string;
6692 /// Return the significand value of a floating-point numeral as a uint64.
6693 ///
6694 /// - `c`: logical context
6695 /// - `t`: a floating-point numeral
6696 /// - `n`: pointer to output uint64
6697 ///
6698 /// Remarks: This function extracts the significand bits in `t`, without the
6699 /// hidden bit or normalization. Sets the `Z3_INVALID_ARG` error code if the
6700 /// significand does not fit into a `uint64`. NaN is an invalid argument.
6701 pub fn Z3_fpa_get_numeral_significand_uint64(
6702 c: Z3_context,
6703 t: Z3_ast,
6704 n: *mut u64,
6705 ) -> bool;
6706 /// Return the exponent value of a floating-point numeral as a string.
6707 ///
6708 /// - `c`: logical context
6709 /// - `t`: a floating-point numeral
6710 /// - `biased`: flag to indicate whether the result is in biased representation
6711 ///
6712 /// **Returns:** true if `t` corresponds to a floating point numeral, otherwise invokes exception handler or returns false
6713 ///
6714 /// Remarks: This function extracts the exponent in `t`, without normalization.
6715 /// NaN is an invalid argument.
6716 pub fn Z3_fpa_get_numeral_exponent_string(
6717 c: Z3_context,
6718 t: Z3_ast,
6719 biased: bool,
6720 ) -> Z3_string;
6721 /// Return the exponent value of a floating-point numeral as a signed 64-bit integer
6722 ///
6723 /// - `c`: logical context
6724 /// - `t`: a floating-point numeral
6725 /// - `n`: exponent
6726 /// - `biased`: flag to indicate whether the result is in biased representation
6727 ///
6728 /// **Returns:** true if `t` corresponds to a floating point numeral, otherwise invokes exception handler or returns false
6729 ///
6730 /// Remarks: This function extracts the exponent in `t`, without normalization.
6731 /// NaN is an invalid argument.
6732 pub fn Z3_fpa_get_numeral_exponent_int64(
6733 c: Z3_context,
6734 t: Z3_ast,
6735 n: *mut i64,
6736 biased: bool,
6737 ) -> bool;
6738 /// Retrieves the exponent of a floating-point literal as a bit-vector expression.
6739 ///
6740 /// - `c`: logical context
6741 /// - `t`: a floating-point numeral
6742 /// - `biased`: flag to indicate whether the result is in biased representation
6743 ///
6744 /// Remarks: This function extracts the exponent in `t`, without normalization.
6745 /// NaN is an invalid arguments.
6746 pub fn Z3_fpa_get_numeral_exponent_bv(
6747 c: Z3_context,
6748 t: Z3_ast,
6749 biased: bool,
6750 ) -> Option<Z3_ast>;
6751 /// Conversion of a floating-point term into a bit-vector term in IEEE 754-2008 format.
6752 ///
6753 /// - `c`: logical context
6754 /// - `t`: term of FloatingPoint sort
6755 ///
6756 /// `t` must have FloatingPoint sort. The size of the resulting bit-vector is automatically
6757 /// determined.
6758 ///
6759 /// Note that IEEE 754-2008 allows multiple different representations of NaN. This conversion
6760 /// knows only one NaN and it will always produce the same bit-vector representation of
6761 /// that NaN.
6762 pub fn Z3_mk_fpa_to_ieee_bv(c: Z3_context, t: Z3_ast) -> Option<Z3_ast>;
6763 /// Conversion of a real-sorted significand and an integer-sorted exponent into a term of FloatingPoint sort.
6764 ///
6765 /// Produces a term that represents the conversion of `sig * 2^exp` into a
6766 /// floating-point term of sort `s`. If necessary, the result will be rounded
6767 /// according to rounding mode `rm`.
6768 ///
6769 /// - `c`: logical context
6770 /// - `rm`: term of RoundingMode sort
6771 /// - `exp`: exponent term of Int sort
6772 /// - `sig`: significand term of Real sort
6773 /// - `s`: FloatingPoint sort
6774 ///
6775 /// `s` must be a FloatingPoint sort, `rm` must be of RoundingMode sort, `exp` must be of int sort, `sig` must be of real sort.
6776 pub fn Z3_mk_fpa_to_fp_int_real(
6777 c: Z3_context,
6778 rm: Z3_ast,
6779 exp: Z3_ast,
6780 sig: Z3_ast,
6781 s: Z3_sort,
6782 ) -> Option<Z3_ast>;
6783 /// Pose a query against the asserted rules at the given level.
6784 ///
6785 /// ```c
6786 /// query ::= (exists (bound-vars) query)
6787 /// | literals
6788 /// ```
6789 ///
6790 /// query returns
6791 /// - `Z3_L_FALSE` if the query is unsatisfiable.
6792 /// - `Z3_L_TRUE` if the query is satisfiable. Obtain the answer by calling [`Z3_fixedpoint_get_answer`].
6793 /// - `Z3_L_UNDEF` if the query was interrupted, timed out or otherwise failed.
6794 pub fn Z3_fixedpoint_query_from_lvl(
6795 c: Z3_context,
6796 d: Z3_fixedpoint,
6797 query: Z3_ast,
6798 lvl: ::core::ffi::c_uint,
6799 ) -> Z3_lbool;
6800 /// Retrieve a bottom-up (from query) sequence of ground facts
6801 ///
6802 /// The previous call to [`Z3_fixedpoint_query`] must have returned `Z3_L_TRUE`.
6803 pub fn Z3_fixedpoint_get_ground_sat_answer(
6804 c: Z3_context,
6805 d: Z3_fixedpoint,
6806 ) -> Option<Z3_ast>;
6807 /// Obtain the list of rules along the counterexample trace.
6808 pub fn Z3_fixedpoint_get_rules_along_trace(
6809 c: Z3_context,
6810 d: Z3_fixedpoint,
6811 ) -> Option<Z3_ast_vector>;
6812 /// Obtain the list of rules along the counterexample trace.
6813 pub fn Z3_fixedpoint_get_rule_names_along_trace(
6814 c: Z3_context,
6815 d: Z3_fixedpoint,
6816 ) -> Option<Z3_symbol>;
6817 /// Add an invariant for the predicate `pred`.
6818 /// Add an assumed invariant of predicate `pred`.
6819 ///
6820 /// Note: this functionality is Spacer specific.
6821 pub fn Z3_fixedpoint_add_invariant(
6822 c: Z3_context,
6823 d: Z3_fixedpoint,
6824 pred: Z3_func_decl,
6825 property: Z3_ast,
6826 );
6827 /// Retrieve reachable states of a predicate.
6828 /// Note: this functionality is Spacer specific.
6829 pub fn Z3_fixedpoint_get_reachable(
6830 c: Z3_context,
6831 d: Z3_fixedpoint,
6832 pred: Z3_func_decl,
6833 ) -> Option<Z3_ast>;
6834 /// Project variables given a model
6835 pub fn Z3_qe_model_project(
6836 c: Z3_context,
6837 m: Z3_model,
6838 num_bounds: ::core::ffi::c_uint,
6839 bound: *const Z3_app,
6840 body: Z3_ast,
6841 ) -> Option<Z3_ast>;
6842 /// Project variables given a model
6843 pub fn Z3_qe_model_project_skolem(
6844 c: Z3_context,
6845 m: Z3_model,
6846 num_bounds: ::core::ffi::c_uint,
6847 bound: *const Z3_app,
6848 body: Z3_ast,
6849 map: Z3_ast_map,
6850 ) -> Option<Z3_ast>;
6851 /// Project with witness extraction.
6852 ///
6853 /// The returned map contains a binding of variables to terms that such that when the binding
6854 /// is used for the formula, it remains true within the model.
6855 pub fn Z3_qe_model_project_with_witness(
6856 c: Z3_context,
6857 m: Z3_model,
6858 num_bounds: ::core::ffi::c_uint,
6859 bound: *const Z3_app,
6860 body: Z3_ast,
6861 map: Z3_ast_map,
6862 ) -> Option<Z3_ast>;
6863 /// Extrapolates a model of a formula
6864 pub fn Z3_model_extrapolate(
6865 c: Z3_context,
6866 m: Z3_model,
6867 fml: Z3_ast,
6868 ) -> Option<Z3_ast>;
6869 /// Best-effort quantifier elimination
6870 pub fn Z3_qe_lite(
6871 c: Z3_context,
6872 vars: Z3_ast_vector,
6873 body: Z3_ast,
6874 ) -> Option<Z3_ast>;
6875}