Z3
z3_fixedpoint.h
Go to the documentation of this file.
1 /*++
2 Copyright (c) 2015 Microsoft Corporation
3 
4 Module Name:
5 
6  z3_fixedpoint.h
7 
8 Abstract:
9 
10  Fixedpoint API
11 
12 Author:
13 
14  Christoph M. Wintersteiger (cwinter) 2015-12-03
15 
16 Notes:
17 
18 --*/
19 #ifndef Z3_FIXEDPOINT_H_
20 #define Z3_FIXEDPOINT_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif // __cplusplus
25 
28 
38  Z3_fixedpoint Z3_API Z3_mk_fixedpoint(Z3_context c);
39 
44  void Z3_API Z3_fixedpoint_inc_ref(Z3_context c, Z3_fixedpoint d);
45 
50  void Z3_API Z3_fixedpoint_dec_ref(Z3_context c, Z3_fixedpoint d);
51 
63  void Z3_API Z3_fixedpoint_add_rule(Z3_context c, Z3_fixedpoint d, Z3_ast rule, Z3_symbol name);
64 
81  void Z3_API Z3_fixedpoint_add_fact(Z3_context c, Z3_fixedpoint d,
82  Z3_func_decl r,
83  unsigned num_args, unsigned args[]);
84 
92  void Z3_API Z3_fixedpoint_assert(Z3_context c, Z3_fixedpoint d, Z3_ast axiom);
93 
108  Z3_lbool Z3_API Z3_fixedpoint_query(Z3_context c, Z3_fixedpoint d, Z3_ast query);
109 
122  Z3_context c, Z3_fixedpoint d,
123  unsigned num_relations, Z3_func_decl const relations[]);
124 
137  Z3_ast Z3_API Z3_fixedpoint_get_answer(Z3_context c, Z3_fixedpoint d);
138 
145  Z3_string Z3_API Z3_fixedpoint_get_reason_unknown(Z3_context c, Z3_fixedpoint d);
146 
152  void Z3_API Z3_fixedpoint_update_rule(Z3_context c, Z3_fixedpoint d, Z3_ast a, Z3_symbol name);
153 
162  unsigned Z3_API Z3_fixedpoint_get_num_levels(Z3_context c, Z3_fixedpoint d, Z3_func_decl pred);
163 
173  Z3_ast Z3_API Z3_fixedpoint_get_cover_delta(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred);
174 
186  void Z3_API Z3_fixedpoint_add_cover(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred, Z3_ast property);
187 
192  Z3_stats Z3_API Z3_fixedpoint_get_statistics(Z3_context c, Z3_fixedpoint d);
193 
201  void Z3_API Z3_fixedpoint_register_relation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f);
202 
212  Z3_context c,
213  Z3_fixedpoint d,
214  Z3_func_decl f,
215  unsigned num_relations,
216  Z3_symbol const relation_kinds[]);
217 
222  Z3_ast_vector Z3_API Z3_fixedpoint_get_rules(
223  Z3_context c,
224  Z3_fixedpoint f);
225 
230  Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions(
231  Z3_context c,
232  Z3_fixedpoint f);
233 
241  void Z3_API Z3_fixedpoint_set_params(Z3_context c, Z3_fixedpoint f, Z3_params p);
242 
250  Z3_string Z3_API Z3_fixedpoint_get_help(Z3_context c, Z3_fixedpoint f);
251 
259  Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs(Z3_context c, Z3_fixedpoint f);
260 
273  Z3_context c,
274  Z3_fixedpoint f,
275  unsigned num_queries,
276  Z3_ast queries[]);
277 
291  Z3_ast_vector Z3_API Z3_fixedpoint_from_string(Z3_context c,
292  Z3_fixedpoint f,
293  Z3_string s);
294 
308  Z3_ast_vector Z3_API Z3_fixedpoint_from_file(Z3_context c,
309  Z3_fixedpoint f,
310  Z3_string s);
311 
321  void Z3_API Z3_fixedpoint_push(Z3_context c, Z3_fixedpoint d);
322 
331  void Z3_API Z3_fixedpoint_pop(Z3_context c, Z3_fixedpoint d);
332 
336  void*, Z3_func_decl,
337  unsigned, Z3_ast const [],
338  unsigned, Z3_ast const []);
339 
341  void*, Z3_func_decl,
342  unsigned, Z3_ast const [],
343  Z3_ast*);
344 
345 
347  void Z3_API Z3_fixedpoint_init(Z3_context c, Z3_fixedpoint d, void* state);
348 
355  Z3_context c ,Z3_fixedpoint d, Z3_fixedpoint_reduce_assign_callback_fptr cb);
356 
359  Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb);
360 
361  typedef void (*Z3_fixedpoint_new_lemma_eh)(void *state, Z3_ast lemma, unsigned level);
362  typedef void (*Z3_fixedpoint_predecessor_eh)(void *state);
363  typedef void (*Z3_fixedpoint_unfold_eh)(void *state);
364 
366  void Z3_API Z3_fixedpoint_add_callback(Z3_context ctx, Z3_fixedpoint f, void *state,
367  Z3_fixedpoint_new_lemma_eh new_lemma_eh,
368  Z3_fixedpoint_predecessor_eh predecessor_eh,
369  Z3_fixedpoint_unfold_eh unfold_eh);
370 
371  void Z3_API Z3_fixedpoint_add_constraint (Z3_context c, Z3_fixedpoint d, Z3_ast e, unsigned lvl);
372 
375 
376 #ifdef __cplusplus
377 }
378 #endif // __cplusplus
379 
380 #endif
Z3_fixedpoint Z3_API Z3_mk_fixedpoint(Z3_context c)
Create a new fixedpoint context.
void Z3_API Z3_fixedpoint_add_rule(Z3_context c, Z3_fixedpoint d, Z3_ast rule, Z3_symbol name)
Add a universal Horn clause as a named rule. The horn_rule should be of the form: ...
void(* Z3_fixedpoint_unfold_eh)(void *state)
void Z3_API Z3_fixedpoint_set_reduce_assign_callback(Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_assign_callback_fptr cb)
Register a callback to destructive updates.
Z3_ast_vector Z3_API Z3_fixedpoint_from_string(Z3_context c, Z3_fixedpoint f, Z3_string s)
Parse an SMT-LIB2 string with fixedpoint rules. Add the rules to the current fixedpoint context...
void Z3_fixedpoint_reduce_app_callback_fptr(void *, Z3_func_decl, unsigned, Z3_ast const [], Z3_ast *)
void Z3_API Z3_fixedpoint_set_reduce_app_callback(Z3_context c, Z3_fixedpoint d, Z3_fixedpoint_reduce_app_callback_fptr cb)
Register a callback for building terms based on the relational operators.
Z3_stats Z3_API Z3_fixedpoint_get_statistics(Z3_context c, Z3_fixedpoint d)
Retrieve statistics information from the last call to Z3_fixedpoint_query.
void(* Z3_fixedpoint_new_lemma_eh)(void *state, Z3_ast lemma, unsigned level)
void Z3_API Z3_fixedpoint_assert(Z3_context c, Z3_fixedpoint d, Z3_ast axiom)
Assert a constraint to the fixedpoint context.
void Z3_API Z3_fixedpoint_pop(Z3_context c, Z3_fixedpoint d)
Backtrack one backtracking point.
void Z3_API Z3_fixedpoint_push(Z3_context c, Z3_fixedpoint d)
Create a backtracking point.
void Z3_API Z3_fixedpoint_inc_ref(Z3_context c, Z3_fixedpoint d)
Increment the reference counter of the given fixedpoint context.
Z3_lbool
Lifted Boolean type: false, undefined, true.
Definition: z3_api.h:98
Z3_ast_vector Z3_API Z3_fixedpoint_from_file(Z3_context c, Z3_fixedpoint f, Z3_string s)
Parse an SMT-LIB2 file with fixedpoint rules. Add the rules to the current fixedpoint context...
void Z3_API Z3_fixedpoint_init(Z3_context c, Z3_fixedpoint d, void *state)
Initialize the context with a user-defined state.
Z3_string Z3_API Z3_fixedpoint_get_reason_unknown(Z3_context c, Z3_fixedpoint d)
Retrieve a string that describes the last status returned by Z3_fixedpoint_query. ...
void Z3_API Z3_fixedpoint_dec_ref(Z3_context c, Z3_fixedpoint d)
Decrement the reference counter of the given fixedpoint context.
Z3_ast_vector Z3_API Z3_fixedpoint_get_rules(Z3_context c, Z3_fixedpoint f)
Retrieve set of rules from fixedpoint context.
Z3_param_descrs Z3_API Z3_fixedpoint_get_param_descrs(Z3_context c, Z3_fixedpoint f)
Return the parameter description set for the given fixedpoint object.
void Z3_API Z3_fixedpoint_add_constraint(Z3_context c, Z3_fixedpoint d, Z3_ast e, unsigned lvl)
unsigned Z3_API Z3_fixedpoint_get_num_levels(Z3_context c, Z3_fixedpoint d, Z3_func_decl pred)
Query the PDR engine for the maximal levels properties are known about predicate. ...
void Z3_API Z3_fixedpoint_add_cover(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred, Z3_ast property)
Add property about the predicate pred. Add a property of predicate pred at level. It gets pushed forw...
void Z3_API Z3_fixedpoint_update_rule(Z3_context c, Z3_fixedpoint d, Z3_ast a, Z3_symbol name)
Update a named rule. A rule with the same name must have been previously created. ...
Z3_string Z3_API Z3_fixedpoint_get_help(Z3_context c, Z3_fixedpoint f)
Return a string describing all fixedpoint available parameters.
void Z3_API Z3_fixedpoint_add_callback(Z3_context ctx, Z3_fixedpoint f, void *state, Z3_fixedpoint_new_lemma_eh new_lemma_eh, Z3_fixedpoint_predecessor_eh predecessor_eh, Z3_fixedpoint_unfold_eh unfold_eh)
set export callback for lemmas
Z3_ast_vector Z3_API Z3_fixedpoint_get_assertions(Z3_context c, Z3_fixedpoint f)
Retrieve set of background assertions from fixedpoint context.
Z3_ast Z3_API Z3_fixedpoint_get_cover_delta(Z3_context c, Z3_fixedpoint d, int level, Z3_func_decl pred)
Z3_lbool Z3_API Z3_fixedpoint_query(Z3_context c, Z3_fixedpoint d, Z3_ast query)
Pose a query against the asserted rules.
void Z3_API Z3_fixedpoint_add_fact(Z3_context c, Z3_fixedpoint d, Z3_func_decl r, unsigned num_args, unsigned args[])
Add a Database fact.
void Z3_API Z3_fixedpoint_set_params(Z3_context c, Z3_fixedpoint f, Z3_params p)
Set parameters on fixedpoint context.
void Z3_API Z3_fixedpoint_set_predicate_representation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f, unsigned num_relations, Z3_symbol const relation_kinds[])
Configure the predicate representation.
void Z3_API Z3_fixedpoint_register_relation(Z3_context c, Z3_fixedpoint d, Z3_func_decl f)
Register relation as Fixedpoint defined. Fixedpoint defined relations have least-fixedpoint semantics...
Z3_ast Z3_API Z3_fixedpoint_get_answer(Z3_context c, Z3_fixedpoint d)
Retrieve a formula that encodes satisfying answers to the query.
Z3_string Z3_API Z3_fixedpoint_to_string(Z3_context c, Z3_fixedpoint f, unsigned num_queries, Z3_ast queries[])
Print the current rules and background axioms as a string.
Z3_lbool Z3_API Z3_fixedpoint_query_relations(Z3_context c, Z3_fixedpoint d, unsigned num_relations, Z3_func_decl const relations[])
Pose multiple queries against the asserted rules.
void Z3_fixedpoint_reduce_assign_callback_fptr(void *, Z3_func_decl, unsigned, Z3_ast const [], unsigned, Z3_ast const [])
The following utilities allows adding user-defined domains.
void(* Z3_fixedpoint_predecessor_eh)(void *state)
const char * Z3_string
Z3 string type. It is just an alias for const char *.
Definition: z3_api.h:82