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