Quantifiers. More...
Inheritance diagram for QuantifierRef:Public Member Functions | |
| def | as_ast |
| def | get_id |
| def | sort |
| def | is_forall |
| def | weight |
| def | num_patterns |
| def | pattern |
| def | num_no_patterns |
| def | no_pattern |
| def | body |
| def | num_vars |
| def | var_name |
| def | var_sort |
| def | children |
Public Member Functions inherited from BoolRef | |
| def | sort |
Public Member Functions inherited from ExprRef | |
| def | as_ast |
| def | get_id |
| def | sort |
| def | sort_kind |
| def | __eq__ |
| def | __ne__ |
| def | decl |
| def | num_args |
| def | arg |
| def | children |
Public Member Functions inherited from AstRef | |
| def | __init__ |
| def | __del__ |
| def | __str__ |
| def | __repr__ |
| def | sexpr |
| def | as_ast |
| def | get_id |
| def | ctx_ref |
| def | eq |
| def | translate |
| def | hash |
Public Member Functions inherited from Z3PPObject | |
| def | use_pp |
Additional Inherited Members | |
Data Fields inherited from AstRef | |
| ast | |
| ctx | |
Quantifiers.
Universally and Existentially quantified formulas.
| def as_ast | ( | self | ) |
| def body | ( | self | ) |
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 1703 of file z3py.py.
Referenced by QuantifierRef.children().
| def children | ( | self | ) |
| def get_id | ( | self | ) |
Definition at line 1628 of file z3py.py.
| def is_forall | ( | self | ) |
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 1635 of file z3py.py.
| def no_pattern | ( | self, | |
| idx | |||
| ) |
| def num_no_patterns | ( | self | ) |
Return the number of no-patterns.
Definition at line 1693 of file z3py.py.
Referenced by QuantifierRef.no_pattern().
| 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 1663 of file z3py.py.
| def num_vars | ( | self | ) |
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 1714 of file z3py.py.
| 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 1675 of file z3py.py.
| def sort | ( | self | ) |
Return the Boolean sort.
| 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 1726 of file z3py.py.
| 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 1742 of file z3py.py.
| def weight | ( | self | ) |
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 1649 of file z3py.py.
1.8.5