Quantifiers. More...
def as_ast (self) def get_id (self) def sort (self) def is_forall (self) def is_exists (self) def is_lambda (self) def __getitem__ (self, arg) def weight (self) def skolem_id (self) def qid (self) def num_patterns (self) def pattern (self, idx) def num_no_patterns (self) def no_pattern (self, idx) def body (self) def num_vars (self) def var_name (self, idx) def var_sort (self, idx) def children (self) def __add__ (self, other) def __radd__ (self, other) def __rmul__ (self, other) def __mul__ (self, other) def __and__ (self, other) def __or__ (self, other) def __xor__ (self, other) def __invert__ (self) def sort_kind (self) def __eq__ (self, other) def __hash__ (self) def __ne__ (self, other) def params (self) def decl (self) def num_args (self) def arg (self, idx) def from_string (self, s) def serialize (self) def __init__ (self, ast, ctx=None) def __del__ (self) def __deepcopy__ (self, memo={}) def __str__ (self) def __repr__ (self) def __nonzero__ (self) def __bool__ (self) def sexpr (self) def ctx_ref (self) def eq (self, other) def translate (self, target) def __copy__ (self) def hash (self) def use_pp (self)Quantifiers.
Universally and Existentially quantified formulas.
Definition at line 2028 of file z3py.py.
◆ __getitem__() def __getitem__ ( self, arg )Return the Z3 expression `self[arg]`.
Definition at line 2085 of file z3py.py.
2085 def__getitem__(self, arg):
2086 """Return the Z3 expression `self[arg]`. 2089_z3_assert(self.is_lambda(),
"quantifier should be a lambda expression")
2090 return_array_select(self, arg)
◆ as_ast()Return a pointer to the corresponding C Z3_ast object.
Reimplemented from ExprRef.
Definition at line 2031 of file z3py.py.
Referenced by AstRef.__del__(), SeqRef.__ge__(), SeqRef.__getitem__(), SeqRef.__gt__(), BitVecRef.__invert__(), SeqRef.__le__(), CharRef.__le__(), SeqRef.__lt__(), ArithRef.__neg__(), BitVecRef.__neg__(), AlgebraicNumRef.approx(), ExprRef.arg(), IntNumRef.as_binary_string(), BitVecNumRef.as_binary_string(), RatNumRef.as_decimal(), AlgebraicNumRef.as_decimal(), IntNumRef.as_string(), RatNumRef.as_string(), BitVecNumRef.as_string(), FiniteDomainRef.as_string(), FiniteDomainNumRef.as_string(), FPRef.as_string(), FPRMRef.as_string(), FPNumRef.as_string(), SeqRef.as_string(), SeqRef.at(), ExprRef.decl(), ArrayRef.default(), RatNumRef.denominator(), AstRef.eq(), FPNumRef.exponent(), FPNumRef.exponent_as_bv(), FPNumRef.exponent_as_long(), AstRef.get_id(), SortRef.get_id(), FuncDeclRef.get_id(), ExprRef.get_id(), PatternRef.get_id(), QuantifierRef.get_id(), AstRef.hash(), AlgebraicNumRef.index(), CharRef.is_digit(), SeqRef.is_string(), SeqRef.is_string_value(), FPNumRef.isInf(), FPNumRef.isNaN(), FPNumRef.isNegative(), FPNumRef.isNormal(), FPNumRef.isPositive(), FPNumRef.isSubnormal(), FPNumRef.isZero(), ExprRef.num_args(), RatNumRef.numerator(), AlgebraicNumRef.poly(), AstRef.sexpr(), FPNumRef.sign(), FPNumRef.sign_as_bv(), FPNumRef.significand(), FPNumRef.significand_as_bv(), FPNumRef.significand_as_long(), ExprRef.sort(), BoolRef.sort(), QuantifierRef.sort(), ArithRef.sort(), BitVecRef.sort(), ArrayRef.sort(), DatatypeRef.sort(), FiniteDomainRef.sort(), FPRef.sort(), SeqRef.sort(), CharRef.to_bv(), CharRef.to_int(), and AstRef.translate().
◆ body()Return the expression being quantified. >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) == 0) >>> q.body() f(Var(0)) == 0
Definition at line 2156 of file z3py.py.
2157 """Return the expression being quantified. 2159 >>> f = Function('f', IntSort(), IntSort()) 2161 >>> q = ForAll(x, f(x) == 0)Z3_ast Z3_API Z3_get_quantifier_body(Z3_context c, Z3_ast a)
Return body of quantifier.
Referenced by QuantifierRef.children().
◆ children()Return a list containing a single element self.body() >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) == 0) >>> q.children() [f(Var(0)) == 0]
Reimplemented from ExprRef.
Definition at line 2211 of file z3py.py.
2212 """Return a list containing a single element self.body() 2214 >>> f = Function('f', IntSort(), IntSort()) 2216 >>> q = ForAll(x, f(x) == 0) 2220 return[self.body()]
◆ get_id()Return unique identifier for object. It can be used for hash-tables and maps.
Reimplemented from ExprRef.
Definition at line 2034 of file z3py.py.
unsigned Z3_API Z3_get_ast_id(Z3_context c, Z3_ast t)
Return a unique identifier for t. The identifier is unique up to structural equality....
◆ is_exists()Return `True` if `self` is an existential quantifier. >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) == 0) >>> q.is_exists() False >>> q = Exists(x, f(x) != 0) >>> q.is_exists() True
Definition at line 2057 of file z3py.py.
2057 defis_exists(self):
2058 """Return `True` if `self` is an existential quantifier. 2060 >>> f = Function('f', IntSort(), IntSort()) 2062 >>> q = ForAll(x, f(x) == 0) 2065 >>> q = Exists(x, f(x) != 0)bool Z3_API Z3_is_quantifier_exists(Z3_context c, Z3_ast a)
Determine if ast is an existential quantifier.
◆ is_forall()Return `True` if `self` is a universal quantifier. >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) == 0) >>> q.is_forall() True >>> q = Exists(x, f(x) != 0) >>> q.is_forall() False
Definition at line 2043 of file z3py.py.
2043 defis_forall(self):
2044 """Return `True` if `self` is a universal quantifier. 2046 >>> f = Function('f', IntSort(), IntSort()) 2048 >>> q = ForAll(x, f(x) == 0) 2051 >>> q = Exists(x, f(x) != 0)bool Z3_API Z3_is_quantifier_forall(Z3_context c, Z3_ast a)
Determine if an ast is a universal quantifier.
◆ is_lambda()Return `True` if `self` is a lambda expression. >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = Lambda(x, f(x)) >>> q.is_lambda() True >>> q = Exists(x, f(x) != 0) >>> q.is_lambda() False
Definition at line 2071 of file z3py.py.
2071 defis_lambda(self):
2072 """Return `True` if `self` is a lambda expression. 2074 >>> f = Function('f', IntSort(), IntSort()) 2076 >>> q = Lambda(x, f(x)) 2079 >>> q = Exists(x, f(x) != 0)bool Z3_API Z3_is_lambda(Z3_context c, Z3_ast a)
Determine if ast is a lambda expression.
Referenced by QuantifierRef.__getitem__(), and QuantifierRef.sort().
◆ no_pattern() def no_pattern ( self, idx )Return a no-pattern.
Definition at line 2150 of file z3py.py.
2150 defno_pattern(self, idx):
2151 """Return a no-pattern.""" 2153_z3_assert(idx < self.num_no_patterns(),
"Invalid no-pattern idx")
Z3_ast Z3_API Z3_get_quantifier_no_pattern_ast(Z3_context c, Z3_ast a, unsigned i)
Return i'th no_pattern.
◆ num_no_patterns() def num_no_patterns ( self )Return the number of no-patterns.
Definition at line 2146 of file z3py.py.
2146 defnum_no_patterns(self):
2147 """Return the number of no-patterns."""unsigned Z3_API Z3_get_quantifier_num_no_patterns(Z3_context c, Z3_ast a)
Return number of no_patterns used in quantifier.
Referenced by QuantifierRef.no_pattern().
◆ num_patterns() def num_patterns ( self )Return the number of patterns (i.e., quantifier instantiation hints) in `self`. >>> f = Function('f', IntSort(), IntSort()) >>> g = Function('g', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) != g(x), patterns = [ f(x), g(x) ]) >>> q.num_patterns() 2
Definition at line 2116 of file z3py.py.
2116 defnum_patterns(self):
2117 """Return the number of patterns (i.e., quantifier instantiation hints) in `self`. 2119 >>> f = Function('f', IntSort(), IntSort()) 2120 >>> g = Function('g', IntSort(), IntSort()) 2122 >>> q = ForAll(x, f(x) != g(x), patterns = [ f(x), g(x) ]) 2123 >>> q.num_patterns()unsigned Z3_API Z3_get_quantifier_num_patterns(Z3_context c, Z3_ast a)
Return number of patterns used in quantifier.
Referenced by QuantifierRef.pattern().
◆ num_vars()Return the number of variables bounded by this quantifier. >>> f = Function('f', IntSort(), IntSort(), IntSort()) >>> x = Int('x') >>> y = Int('y') >>> q = ForAll([x, y], f(x, y) >= x) >>> q.num_vars() 2
Definition at line 2167 of file z3py.py.
2168 """Return the number of variables bounded by this quantifier. 2170 >>> f = Function('f', IntSort(), IntSort(), IntSort()) 2173 >>> q = ForAll([x, y], f(x, y) >= x)unsigned Z3_API Z3_get_quantifier_num_bound(Z3_context c, Z3_ast a)
Return number of bound variables of quantifier.
Referenced by QuantifierRef.var_name(), and QuantifierRef.var_sort().
◆ pattern() def pattern ( self, idx )Return a pattern (i.e., quantifier instantiation hints) in `self`. >>> f = Function('f', IntSort(), IntSort()) >>> g = Function('g', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) != g(x), patterns = [ f(x), g(x) ]) >>> q.num_patterns() 2 >>> q.pattern(0) f(Var(0)) >>> q.pattern(1) g(Var(0))
Definition at line 2128 of file z3py.py.
2128 defpattern(self, idx):
2129 """Return a pattern (i.e., quantifier instantiation hints) in `self`. 2131 >>> f = Function('f', IntSort(), IntSort()) 2132 >>> g = Function('g', IntSort(), IntSort()) 2134 >>> q = ForAll(x, f(x) != g(x), patterns = [ f(x), g(x) ]) 2135 >>> q.num_patterns() 2143_z3_assert(idx < self.num_patterns(),
"Invalid pattern idx")
Z3_pattern Z3_API Z3_get_quantifier_pattern_ast(Z3_context c, Z3_ast a, unsigned i)
Return i'th pattern.
◆ qid()Return the quantifier id of `self`.
Definition at line 2111 of file z3py.py.
2112 """Return the quantifier id of `self`.Z3_symbol Z3_API Z3_get_quantifier_id(Z3_context c, Z3_ast a)
Obtain id of quantifier.
◆ skolem_id()Return the skolem id of `self`.
Definition at line 2106 of file z3py.py.
2106 defskolem_id(self):
2107 """Return the skolem id of `self`.Z3_symbol Z3_API Z3_get_quantifier_skolem_id(Z3_context c, Z3_ast a)
Obtain skolem id of quantifier.
◆ sort()Return the Boolean sort or sort of Lambda.
Reimplemented from BoolRef.
Definition at line 2037 of file z3py.py.
2038 """Return the Boolean sort or sort of Lambda.""" 2039 ifself.is_lambda():
2040 return_sort(self.ctx, self.as_ast())
Referenced by FPNumRef.as_string(), ArrayRef.domain(), ArrayRef.domain_n(), FPRef.ebits(), ArithRef.is_int(), ArithRef.is_real(), ArrayRef.range(), FPRef.sbits(), BitVecRef.size(), and ExprRef.sort_kind().
◆ var_name() def var_name ( self, idx )Return a string representing a name used when displaying the quantifier. >>> f = Function('f', IntSort(), IntSort(), IntSort()) >>> x = Int('x') >>> y = Int('y') >>> q = ForAll([x, y], f(x, y) >= x) >>> q.var_name(0) 'x' >>> q.var_name(1) 'y'
Definition at line 2179 of file z3py.py.
2179 defvar_name(self, idx):
2180 """Return a string representing a name used when displaying the quantifier. 2182 >>> f = Function('f', IntSort(), IntSort(), IntSort()) 2185 >>> q = ForAll([x, y], f(x, y) >= x) 2192_z3_assert(idx < self.num_vars(),
"Invalid variable idx")
Z3_symbol Z3_API Z3_get_quantifier_bound_name(Z3_context c, Z3_ast a, unsigned i)
Return symbol of the i'th bound variable.
◆ var_sort() def var_sort ( self, idx )Return the sort of a bound variable. >>> f = Function('f', IntSort(), RealSort(), IntSort()) >>> x = Int('x') >>> y = Real('y') >>> q = ForAll([x, y], f(x, y) >= x) >>> q.var_sort(0) Int >>> q.var_sort(1) Real
Definition at line 2195 of file z3py.py.
2195 defvar_sort(self, idx):
2196 """Return the sort of a bound variable. 2198 >>> f = Function('f', IntSort(), RealSort(), IntSort()) 2201 >>> q = ForAll([x, y], f(x, y) >= x) 2208_z3_assert(idx < self.num_vars(),
"Invalid variable idx")
Z3_sort Z3_API Z3_get_quantifier_bound_sort(Z3_context c, Z3_ast a, unsigned i)
Return sort of the i'th bound variable.
◆ weight()Return the weight annotation of `self`. >>> f = Function('f', IntSort(), IntSort()) >>> x = Int('x') >>> q = ForAll(x, f(x) == 0) >>> q.weight() 1 >>> q = ForAll(x, f(x) == 0, weight=10) >>> q.weight() 10
Definition at line 2092 of file z3py.py.
2093 """Return the weight annotation of `self`. 2095 >>> f = Function('f', IntSort(), IntSort()) 2097 >>> q = ForAll(x, f(x) == 0) 2100 >>> q = ForAll(x, f(x) == 0, weight=10)unsigned Z3_API Z3_get_quantifier_weight(Z3_context c, Z3_ast a)
Obtain weight of quantifier.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4