Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
Or | (*args) | Create a Z3 or-expression or or-probe.
>>> p, q, r = Bools('p q r')
>>> Or(p, q, r)
Or(p, q, r)
>>> P = BoolVector('p', 5)
>>> Or(P)
Or(p__0, p__1, p__2, p__3, p__4)
| Create a Z3 or-expression or or-probe. | def Or(*args):
"""Create a Z3 or-expression or or-probe.
>>> p, q, r = Bools('p q r')
>>> Or(p, q, r)
Or(p, q, r)
>>> P = BoolVector('p', 5)
>>> Or(P)
Or(p__0, p__1, p__2, p__3, p__4)
"""
last_arg = None
if len(args) > 0:
last_arg = args[len(args)-1]
if isinstance(la... | [
"def",
"Or",
"(",
"*",
"args",
")",
":",
"last_arg",
"=",
"None",
"if",
"len",
"(",
"args",
")",
">",
"0",
":",
"last_arg",
"=",
"args",
"[",
"len",
"(",
"args",
")",
"-",
"1",
"]",
"if",
"isinstance",
"(",
"last_arg",
",",
"Context",
")",
":",... | [
1739,
0
] | [
1769,
59
] | python | en | ['en', 'en', 'en'] | True |
is_pattern | (a) | Return `True` if `a` is a Z3 pattern (hint for quantifier instantiation.
>>> f = Function('f', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) == 0, patterns = [ f(x) ])
>>> q
ForAll(x, f(x) == 0)
>>> q.num_patterns()
1
>>> is_pattern(q.pattern(0))
True
>>> q.patte... | Return `True` if `a` is a Z3 pattern (hint for quantifier instantiation. | def is_pattern(a):
"""Return `True` if `a` is a Z3 pattern (hint for quantifier instantiation.
>>> f = Function('f', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) == 0, patterns = [ f(x) ])
>>> q
ForAll(x, f(x) == 0)
>>> q.num_patterns()
1
>>> is_pattern(q.pattern(0)... | [
"def",
"is_pattern",
"(",
"a",
")",
":",
"return",
"isinstance",
"(",
"a",
",",
"PatternRef",
")"
] | [
1787,
0
] | [
1802,
36
] | python | en | ['en', 'en', 'en'] | True |
MultiPattern | (*args) | Create a Z3 multi-pattern using the given expressions `*args`
>>> f = Function('f', IntSort(), IntSort())
>>> g = Function('g', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) != g(x), patterns = [ MultiPattern(f(x), g(x)) ])
>>> q
ForAll(x, f(x) != g(x))
>>> q.num_patterns()
... | Create a Z3 multi-pattern using the given expressions `*args` | def MultiPattern(*args):
"""Create a Z3 multi-pattern using the given expressions `*args`
>>> f = Function('f', IntSort(), IntSort())
>>> g = Function('g', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) != g(x), patterns = [ MultiPattern(f(x), g(x)) ])
>>> q
ForAll(x, f(x) !=... | [
"def",
"MultiPattern",
"(",
"*",
"args",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"len",
"(",
"args",
")",
">",
"0",
",",
"\"At least one argument expected\"",
")",
"_z3_assert",
"(",
"all",
"(",
"[",
"is_expr",
"(",
"a",
")",
"for... | [
1804,
0
] | [
1825,
62
] | python | en | ['en', 'en', 'en'] | True |
is_quantifier | (a) | Return `True` if `a` is a Z3 quantifier.
>>> f = Function('f', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) == 0)
>>> is_quantifier(q)
True
>>> is_quantifier(f(x))
False
| Return `True` if `a` is a Z3 quantifier. | def is_quantifier(a):
"""Return `True` if `a` is a Z3 quantifier.
>>> f = Function('f', IntSort(), IntSort())
>>> x = Int('x')
>>> q = ForAll(x, f(x) == 0)
>>> is_quantifier(q)
True
>>> is_quantifier(f(x))
False
"""
return isinstance(a, QuantifierRef) | [
"def",
"is_quantifier",
"(",
"a",
")",
":",
"return",
"isinstance",
"(",
"a",
",",
"QuantifierRef",
")"
] | [
2025,
0
] | [
2036,
39
] | python | en | ['en', 'fy', 'en'] | True |
ForAll | (vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]) | Create a Z3 forall formula.
The parameters `weight`, `qid`, `skid`, `patterns` and `no_patterns` are optional annotations.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> x = Int('x')
>>> y = Int('y')
>>> ForAll([x, y], f(x, y) >= x)
ForAll([x, y], f(x, y) >= x)
>>> ForAll([x, y... | Create a Z3 forall formula. | def ForAll(vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]):
"""Create a Z3 forall formula.
The parameters `weight`, `qid`, `skid`, `patterns` and `no_patterns` are optional annotations.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> x = Int('x')
>>> y = Int('y')
>... | [
"def",
"ForAll",
"(",
"vs",
",",
"body",
",",
"weight",
"=",
"1",
",",
"qid",
"=",
"\"\"",
",",
"skid",
"=",
"\"\"",
",",
"patterns",
"=",
"[",
"]",
",",
"no_patterns",
"=",
"[",
"]",
")",
":",
"return",
"_mk_quantifier",
"(",
"True",
",",
"vs",
... | [
2072,
0
] | [
2087,
83
] | python | en | ['en', 'pt', 'en'] | True |
Exists | (vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]) | Create a Z3 exists formula.
The parameters `weight`, `qif`, `skid`, `patterns` and `no_patterns` are optional annotations.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> x = Int('x')
>>> y = Int('y')
>>> q = Exists([x, y], f(x, y) >= x, skid="foo")
>>> q
Exists([x, y], f(x, y)... | Create a Z3 exists formula. | def Exists(vs, body, weight=1, qid="", skid="", patterns=[], no_patterns=[]):
"""Create a Z3 exists formula.
The parameters `weight`, `qif`, `skid`, `patterns` and `no_patterns` are optional annotations.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> x = Int('x')
>>> y = Int('y')
... | [
"def",
"Exists",
"(",
"vs",
",",
"body",
",",
"weight",
"=",
"1",
",",
"qid",
"=",
"\"\"",
",",
"skid",
"=",
"\"\"",
",",
"patterns",
"=",
"[",
"]",
",",
"no_patterns",
"=",
"[",
"]",
")",
":",
"return",
"_mk_quantifier",
"(",
"False",
",",
"vs",... | [
2089,
0
] | [
2107,
84
] | python | en | ['en', 'haw', 'en'] | True |
Lambda | (vs, body) | Create a Z3 lambda expression.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> mem0 = Array('mem0', IntSort(), IntSort())
>>> lo, hi, e, i = Ints('lo hi e i')
>>> mem1 = Lambda([i], If(And(lo <= i, i <= hi), e, mem0[i]))
>>> mem1
Lambda(i, If(And(lo <= i, i <= hi), e, mem0[i]))
| Create a Z3 lambda expression. | def Lambda(vs, body):
"""Create a Z3 lambda expression.
>>> f = Function('f', IntSort(), IntSort(), IntSort())
>>> mem0 = Array('mem0', IntSort(), IntSort())
>>> lo, hi, e, i = Ints('lo hi e i')
>>> mem1 = Lambda([i], If(And(lo <= i, i <= hi), e, mem0[i]))
>>> mem1
Lambda(i, If(And(lo <= i,... | [
"def",
"Lambda",
"(",
"vs",
",",
"body",
")",
":",
"ctx",
"=",
"body",
".",
"ctx",
"if",
"is_app",
"(",
"vs",
")",
":",
"vs",
"=",
"[",
"vs",
"]",
"num_vars",
"=",
"len",
"(",
"vs",
")",
"_vs",
"=",
"(",
"Ast",
"*",
"num_vars",
")",
"(",
")... | [
2109,
0
] | [
2127,
90
] | python | co | ['pt', 'co', 'en'] | False |
is_arith_sort | (s) | Return `True` if s is an arithmetical sort (type).
>>> is_arith_sort(IntSort())
True
>>> is_arith_sort(RealSort())
True
>>> is_arith_sort(BoolSort())
False
>>> n = Int('x') + 1
>>> is_arith_sort(n.sort())
True
| Return `True` if s is an arithmetical sort (type). | def is_arith_sort(s):
"""Return `True` if s is an arithmetical sort (type).
>>> is_arith_sort(IntSort())
True
>>> is_arith_sort(RealSort())
True
>>> is_arith_sort(BoolSort())
False
>>> n = Int('x') + 1
>>> is_arith_sort(n.sort())
True
"""
return isinstance(s, ArithSortRe... | [
"def",
"is_arith_sort",
"(",
"s",
")",
":",
"return",
"isinstance",
"(",
"s",
",",
"ArithSortRef",
")"
] | [
2206,
0
] | [
2219,
38
] | python | en | ['en', 'en', 'en'] | True |
is_arith | (a) | Return `True` if `a` is an arithmetical expression.
>>> x = Int('x')
>>> is_arith(x)
True
>>> is_arith(x + 1)
True
>>> is_arith(1)
False
>>> is_arith(IntVal(1))
True
>>> y = Real('y')
>>> is_arith(y)
True
>>> is_arith(y + 1)
True
| Return `True` if `a` is an arithmetical expression. | def is_arith(a):
"""Return `True` if `a` is an arithmetical expression.
>>> x = Int('x')
>>> is_arith(x)
True
>>> is_arith(x + 1)
True
>>> is_arith(1)
False
>>> is_arith(IntVal(1))
True
>>> y = Real('y')
>>> is_arith(y)
True
>>> is_arith(y + 1)
True
"""
... | [
"def",
"is_arith",
"(",
"a",
")",
":",
"return",
"isinstance",
"(",
"a",
",",
"ArithRef",
")"
] | [
2505,
0
] | [
2523,
34
] | python | en | ['en', 'en', 'en'] | True |
is_int | (a) | Return `True` if `a` is an integer expression.
>>> x = Int('x')
>>> is_int(x + 1)
True
>>> is_int(1)
False
>>> is_int(IntVal(1))
True
>>> y = Real('y')
>>> is_int(y)
False
>>> is_int(y + 1)
False
| Return `True` if `a` is an integer expression. | def is_int(a):
"""Return `True` if `a` is an integer expression.
>>> x = Int('x')
>>> is_int(x + 1)
True
>>> is_int(1)
False
>>> is_int(IntVal(1))
True
>>> y = Real('y')
>>> is_int(y)
False
>>> is_int(y + 1)
False
"""
return is_arith(a) and a.is_int() | [
"def",
"is_int",
"(",
"a",
")",
":",
"return",
"is_arith",
"(",
"a",
")",
"and",
"a",
".",
"is_int",
"(",
")"
] | [
2525,
0
] | [
2541,
37
] | python | en | ['en', 'en', 'en'] | True |
is_real | (a) | Return `True` if `a` is a real expression.
>>> x = Int('x')
>>> is_real(x + 1)
False
>>> y = Real('y')
>>> is_real(y)
True
>>> is_real(y + 1)
True
>>> is_real(1)
False
>>> is_real(RealVal(1))
True
| Return `True` if `a` is a real expression. | def is_real(a):
"""Return `True` if `a` is a real expression.
>>> x = Int('x')
>>> is_real(x + 1)
False
>>> y = Real('y')
>>> is_real(y)
True
>>> is_real(y + 1)
True
>>> is_real(1)
False
>>> is_real(RealVal(1))
True
"""
return is_arith(a) and a.is_real() | [
"def",
"is_real",
"(",
"a",
")",
":",
"return",
"is_arith",
"(",
"a",
")",
"and",
"a",
".",
"is_real",
"(",
")"
] | [
2543,
0
] | [
2559,
38
] | python | en | ['en', 'en', 'en'] | True |
is_int_value | (a) | Return `True` if `a` is an integer value of sort Int.
>>> is_int_value(IntVal(1))
True
>>> is_int_value(1)
False
>>> is_int_value(Int('x'))
False
>>> n = Int('x') + 1
>>> n
x + 1
>>> n.arg(1)
1
>>> is_int_value(n.arg(1))
True
>>> is_int_value(RealVal("1/3"))
... | Return `True` if `a` is an integer value of sort Int. | def is_int_value(a):
"""Return `True` if `a` is an integer value of sort Int.
>>> is_int_value(IntVal(1))
True
>>> is_int_value(1)
False
>>> is_int_value(Int('x'))
False
>>> n = Int('x') + 1
>>> n
x + 1
>>> n.arg(1)
1
>>> is_int_value(n.arg(1))
True
>>> is_in... | [
"def",
"is_int_value",
"(",
"a",
")",
":",
"return",
"is_arith",
"(",
"a",
")",
"and",
"a",
".",
"is_int",
"(",
")",
"and",
"_is_numeral",
"(",
"a",
".",
"ctx",
",",
"a",
".",
"as_ast",
"(",
")",
")"
] | [
2567,
0
] | [
2588,
72
] | python | en | ['en', 'en', 'en'] | True |
is_rational_value | (a) | Return `True` if `a` is rational value of sort Real.
>>> is_rational_value(RealVal(1))
True
>>> is_rational_value(RealVal("3/5"))
True
>>> is_rational_value(IntVal(1))
False
>>> is_rational_value(1)
False
>>> n = Real('x') + 1
>>> n.arg(1)
1
>>> is_rational_value(n.arg(1... | Return `True` if `a` is rational value of sort Real. | def is_rational_value(a):
"""Return `True` if `a` is rational value of sort Real.
>>> is_rational_value(RealVal(1))
True
>>> is_rational_value(RealVal("3/5"))
True
>>> is_rational_value(IntVal(1))
False
>>> is_rational_value(1)
False
>>> n = Real('x') + 1
>>> n.arg(1)
1
... | [
"def",
"is_rational_value",
"(",
"a",
")",
":",
"return",
"is_arith",
"(",
"a",
")",
"and",
"a",
".",
"is_real",
"(",
")",
"and",
"_is_numeral",
"(",
"a",
".",
"ctx",
",",
"a",
".",
"as_ast",
"(",
")",
")"
] | [
2590,
0
] | [
2609,
73
] | python | en | ['en', 'en', 'en'] | True |
is_algebraic_value | (a) | Return `True` if `a` is an algebraic value of sort Real.
>>> is_algebraic_value(RealVal("3/5"))
False
>>> n = simplify(Sqrt(2))
>>> n
1.4142135623?
>>> is_algebraic_value(n)
True
| Return `True` if `a` is an algebraic value of sort Real. | def is_algebraic_value(a):
"""Return `True` if `a` is an algebraic value of sort Real.
>>> is_algebraic_value(RealVal("3/5"))
False
>>> n = simplify(Sqrt(2))
>>> n
1.4142135623?
>>> is_algebraic_value(n)
True
"""
return is_arith(a) and a.is_real() and _is_algebraic(a.ctx, a.as_a... | [
"def",
"is_algebraic_value",
"(",
"a",
")",
":",
"return",
"is_arith",
"(",
"a",
")",
"and",
"a",
".",
"is_real",
"(",
")",
"and",
"_is_algebraic",
"(",
"a",
".",
"ctx",
",",
"a",
".",
"as_ast",
"(",
")",
")"
] | [
2611,
0
] | [
2622,
75
] | python | en | ['en', 'en', 'en'] | True |
is_add | (a) | Return `True` if `a` is an expression of the form b + c.
>>> x, y = Ints('x y')
>>> is_add(x + y)
True
>>> is_add(x - y)
False
| Return `True` if `a` is an expression of the form b + c. | def is_add(a):
"""Return `True` if `a` is an expression of the form b + c.
>>> x, y = Ints('x y')
>>> is_add(x + y)
True
>>> is_add(x - y)
False
"""
return is_app_of(a, Z3_OP_ADD) | [
"def",
"is_add",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_ADD",
")"
] | [
2624,
0
] | [
2633,
34
] | python | en | ['en', 'en', 'en'] | True |
is_mul | (a) | Return `True` if `a` is an expression of the form b * c.
>>> x, y = Ints('x y')
>>> is_mul(x * y)
True
>>> is_mul(x - y)
False
| Return `True` if `a` is an expression of the form b * c. | def is_mul(a):
"""Return `True` if `a` is an expression of the form b * c.
>>> x, y = Ints('x y')
>>> is_mul(x * y)
True
>>> is_mul(x - y)
False
"""
return is_app_of(a, Z3_OP_MUL) | [
"def",
"is_mul",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_MUL",
")"
] | [
2635,
0
] | [
2644,
34
] | python | en | ['en', 'en', 'en'] | True |
is_sub | (a) | Return `True` if `a` is an expression of the form b - c.
>>> x, y = Ints('x y')
>>> is_sub(x - y)
True
>>> is_sub(x + y)
False
| Return `True` if `a` is an expression of the form b - c. | def is_sub(a):
"""Return `True` if `a` is an expression of the form b - c.
>>> x, y = Ints('x y')
>>> is_sub(x - y)
True
>>> is_sub(x + y)
False
"""
return is_app_of(a, Z3_OP_SUB) | [
"def",
"is_sub",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_SUB",
")"
] | [
2646,
0
] | [
2655,
34
] | python | en | ['en', 'en', 'en'] | True |
is_div | (a) | Return `True` if `a` is an expression of the form b / c.
>>> x, y = Reals('x y')
>>> is_div(x / y)
True
>>> is_div(x + y)
False
>>> x, y = Ints('x y')
>>> is_div(x / y)
False
>>> is_idiv(x / y)
True
| Return `True` if `a` is an expression of the form b / c. | def is_div(a):
"""Return `True` if `a` is an expression of the form b / c.
>>> x, y = Reals('x y')
>>> is_div(x / y)
True
>>> is_div(x + y)
False
>>> x, y = Ints('x y')
>>> is_div(x / y)
False
>>> is_idiv(x / y)
True
"""
return is_app_of(a, Z3_OP_DIV) | [
"def",
"is_div",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_DIV",
")"
] | [
2657,
0
] | [
2671,
34
] | python | en | ['en', 'en', 'en'] | True |
is_idiv | (a) | Return `True` if `a` is an expression of the form b div c.
>>> x, y = Ints('x y')
>>> is_idiv(x / y)
True
>>> is_idiv(x + y)
False
| Return `True` if `a` is an expression of the form b div c. | def is_idiv(a):
"""Return `True` if `a` is an expression of the form b div c.
>>> x, y = Ints('x y')
>>> is_idiv(x / y)
True
>>> is_idiv(x + y)
False
"""
return is_app_of(a, Z3_OP_IDIV) | [
"def",
"is_idiv",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_IDIV",
")"
] | [
2673,
0
] | [
2682,
35
] | python | en | ['en', 'en', 'en'] | True |
is_mod | (a) | Return `True` if `a` is an expression of the form b % c.
>>> x, y = Ints('x y')
>>> is_mod(x % y)
True
>>> is_mod(x + y)
False
| Return `True` if `a` is an expression of the form b % c. | def is_mod(a):
"""Return `True` if `a` is an expression of the form b % c.
>>> x, y = Ints('x y')
>>> is_mod(x % y)
True
>>> is_mod(x + y)
False
"""
return is_app_of(a, Z3_OP_MOD) | [
"def",
"is_mod",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_MOD",
")"
] | [
2684,
0
] | [
2693,
34
] | python | en | ['en', 'en', 'en'] | True |
is_le | (a) | Return `True` if `a` is an expression of the form b <= c.
>>> x, y = Ints('x y')
>>> is_le(x <= y)
True
>>> is_le(x < y)
False
| Return `True` if `a` is an expression of the form b <= c. | def is_le(a):
"""Return `True` if `a` is an expression of the form b <= c.
>>> x, y = Ints('x y')
>>> is_le(x <= y)
True
>>> is_le(x < y)
False
"""
return is_app_of(a, Z3_OP_LE) | [
"def",
"is_le",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_LE",
")"
] | [
2695,
0
] | [
2704,
33
] | python | en | ['en', 'en', 'en'] | True |
is_lt | (a) | Return `True` if `a` is an expression of the form b < c.
>>> x, y = Ints('x y')
>>> is_lt(x < y)
True
>>> is_lt(x == y)
False
| Return `True` if `a` is an expression of the form b < c. | def is_lt(a):
"""Return `True` if `a` is an expression of the form b < c.
>>> x, y = Ints('x y')
>>> is_lt(x < y)
True
>>> is_lt(x == y)
False
"""
return is_app_of(a, Z3_OP_LT) | [
"def",
"is_lt",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_LT",
")"
] | [
2706,
0
] | [
2715,
33
] | python | en | ['en', 'en', 'en'] | True |
is_ge | (a) | Return `True` if `a` is an expression of the form b >= c.
>>> x, y = Ints('x y')
>>> is_ge(x >= y)
True
>>> is_ge(x == y)
False
| Return `True` if `a` is an expression of the form b >= c. | def is_ge(a):
"""Return `True` if `a` is an expression of the form b >= c.
>>> x, y = Ints('x y')
>>> is_ge(x >= y)
True
>>> is_ge(x == y)
False
"""
return is_app_of(a, Z3_OP_GE) | [
"def",
"is_ge",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_GE",
")"
] | [
2717,
0
] | [
2726,
33
] | python | en | ['en', 'en', 'en'] | True |
is_gt | (a) | Return `True` if `a` is an expression of the form b > c.
>>> x, y = Ints('x y')
>>> is_gt(x > y)
True
>>> is_gt(x == y)
False
| Return `True` if `a` is an expression of the form b > c. | def is_gt(a):
"""Return `True` if `a` is an expression of the form b > c.
>>> x, y = Ints('x y')
>>> is_gt(x > y)
True
>>> is_gt(x == y)
False
"""
return is_app_of(a, Z3_OP_GT) | [
"def",
"is_gt",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_GT",
")"
] | [
2728,
0
] | [
2737,
33
] | python | en | ['en', 'en', 'en'] | True |
is_is_int | (a) | Return `True` if `a` is an expression of the form IsInt(b).
>>> x = Real('x')
>>> is_is_int(IsInt(x))
True
>>> is_is_int(x)
False
| Return `True` if `a` is an expression of the form IsInt(b). | def is_is_int(a):
"""Return `True` if `a` is an expression of the form IsInt(b).
>>> x = Real('x')
>>> is_is_int(IsInt(x))
True
>>> is_is_int(x)
False
"""
return is_app_of(a, Z3_OP_IS_INT) | [
"def",
"is_is_int",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_IS_INT",
")"
] | [
2739,
0
] | [
2748,
37
] | python | en | ['en', 'en', 'en'] | True |
is_to_real | (a) | Return `True` if `a` is an expression of the form ToReal(b).
>>> x = Int('x')
>>> n = ToReal(x)
>>> n
ToReal(x)
>>> is_to_real(n)
True
>>> is_to_real(x)
False
| Return `True` if `a` is an expression of the form ToReal(b). | def is_to_real(a):
"""Return `True` if `a` is an expression of the form ToReal(b).
>>> x = Int('x')
>>> n = ToReal(x)
>>> n
ToReal(x)
>>> is_to_real(n)
True
>>> is_to_real(x)
False
"""
return is_app_of(a, Z3_OP_TO_REAL) | [
"def",
"is_to_real",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_TO_REAL",
")"
] | [
2750,
0
] | [
2762,
38
] | python | en | ['en', 'en', 'en'] | True |
is_to_int | (a) | Return `True` if `a` is an expression of the form ToInt(b).
>>> x = Real('x')
>>> n = ToInt(x)
>>> n
ToInt(x)
>>> is_to_int(n)
True
>>> is_to_int(x)
False
| Return `True` if `a` is an expression of the form ToInt(b). | def is_to_int(a):
"""Return `True` if `a` is an expression of the form ToInt(b).
>>> x = Real('x')
>>> n = ToInt(x)
>>> n
ToInt(x)
>>> is_to_int(n)
True
>>> is_to_int(x)
False
"""
return is_app_of(a, Z3_OP_TO_INT) | [
"def",
"is_to_int",
"(",
"a",
")",
":",
"return",
"is_app_of",
"(",
"a",
",",
"Z3_OP_TO_INT",
")"
] | [
2764,
0
] | [
2776,
37
] | python | en | ['en', 'en', 'en'] | True |
IntSort | (ctx=None) | Return the integer sort in the given context. If `ctx=None`, then the global context is used.
>>> IntSort()
Int
>>> x = Const('x', IntSort())
>>> is_int(x)
True
>>> x.sort() == IntSort()
True
>>> x.sort() == BoolSort()
False
| Return the integer sort in the given context. If `ctx=None`, then the global context is used. | def IntSort(ctx=None):
"""Return the integer sort in the given context. If `ctx=None`, then the global context is used.
>>> IntSort()
Int
>>> x = Const('x', IntSort())
>>> is_int(x)
True
>>> x.sort() == IntSort()
True
>>> x.sort() == BoolSort()
False
"""
ctx = _get_ctx(c... | [
"def",
"IntSort",
"(",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithSortRef",
"(",
"Z3_mk_int_sort",
"(",
"ctx",
".",
"ref",
"(",
")",
")",
",",
"ctx",
")"
] | [
2951,
0
] | [
2965,
55
] | python | en | ['en', 'en', 'en'] | True |
RealSort | (ctx=None) | Return the real sort in the given context. If `ctx=None`, then the global context is used.
>>> RealSort()
Real
>>> x = Const('x', RealSort())
>>> is_real(x)
True
>>> is_int(x)
False
>>> x.sort() == RealSort()
True
| Return the real sort in the given context. If `ctx=None`, then the global context is used. | def RealSort(ctx=None):
"""Return the real sort in the given context. If `ctx=None`, then the global context is used.
>>> RealSort()
Real
>>> x = Const('x', RealSort())
>>> is_real(x)
True
>>> is_int(x)
False
>>> x.sort() == RealSort()
True
"""
ctx = _get_ctx(ctx)
re... | [
"def",
"RealSort",
"(",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithSortRef",
"(",
"Z3_mk_real_sort",
"(",
"ctx",
".",
"ref",
"(",
")",
")",
",",
"ctx",
")"
] | [
2967,
0
] | [
2981,
56
] | python | en | ['en', 'en', 'en'] | True |
IntVal | (val, ctx=None) | Return a Z3 integer value. If `ctx=None`, then the global context is used.
>>> IntVal(1)
1
>>> IntVal("100")
100
| Return a Z3 integer value. If `ctx=None`, then the global context is used. | def IntVal(val, ctx=None):
"""Return a Z3 integer value. If `ctx=None`, then the global context is used.
>>> IntVal(1)
1
>>> IntVal("100")
100
"""
ctx = _get_ctx(ctx)
return IntNumRef(Z3_mk_numeral(ctx.ref(), _to_int_str(val), IntSort(ctx).ast), ctx) | [
"def",
"IntVal",
"(",
"val",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"IntNumRef",
"(",
"Z3_mk_numeral",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"_to_int_str",
"(",
"val",
")",
",",
"IntSort",
"(",
"ctx",... | [
2998,
0
] | [
3007,
87
] | python | en | ['en', 'en', 'en'] | True |
RealVal | (val, ctx=None) | Return a Z3 real value.
`val` may be a Python int, long, float or string representing a number in decimal or rational notation.
If `ctx=None`, then the global context is used.
>>> RealVal(1)
1
>>> RealVal(1).sort()
Real
>>> RealVal("3/5")
3/5
>>> RealVal("1.5")
3/2
| Return a Z3 real value. | def RealVal(val, ctx=None):
"""Return a Z3 real value.
`val` may be a Python int, long, float or string representing a number in decimal or rational notation.
If `ctx=None`, then the global context is used.
>>> RealVal(1)
1
>>> RealVal(1).sort()
Real
>>> RealVal("3/5")
3/5
>>> ... | [
"def",
"RealVal",
"(",
"val",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"RatNumRef",
"(",
"Z3_mk_numeral",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"str",
"(",
"val",
")",
",",
"RealSort",
"(",
"ctx",
")"... | [
3009,
0
] | [
3025,
80
] | python | en | ['en', 'en', 'en'] | True |
RatVal | (a, b, ctx=None) | Return a Z3 rational a/b.
If `ctx=None`, then the global context is used.
>>> RatVal(3,5)
3/5
>>> RatVal(3,5).sort()
Real
| Return a Z3 rational a/b. | def RatVal(a, b, ctx=None):
"""Return a Z3 rational a/b.
If `ctx=None`, then the global context is used.
>>> RatVal(3,5)
3/5
>>> RatVal(3,5).sort()
Real
"""
if z3_debug():
_z3_assert(_is_int(a) or isinstance(a, str), "First argument cannot be converted into an integer")
... | [
"def",
"RatVal",
"(",
"a",
",",
"b",
",",
"ctx",
"=",
"None",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"_is_int",
"(",
"a",
")",
"or",
"isinstance",
"(",
"a",
",",
"str",
")",
",",
"\"First argument cannot be converted into an intege... | [
3027,
0
] | [
3040,
52
] | python | en | ['en', 'lb', 'en'] | True |
Q | (a, b, ctx=None) | Return a Z3 rational a/b.
If `ctx=None`, then the global context is used.
>>> Q(3,5)
3/5
>>> Q(3,5).sort()
Real
| Return a Z3 rational a/b. | def Q(a, b, ctx=None):
"""Return a Z3 rational a/b.
If `ctx=None`, then the global context is used.
>>> Q(3,5)
3/5
>>> Q(3,5).sort()
Real
"""
return simplify(RatVal(a, b)) | [
"def",
"Q",
"(",
"a",
",",
"b",
",",
"ctx",
"=",
"None",
")",
":",
"return",
"simplify",
"(",
"RatVal",
"(",
"a",
",",
"b",
")",
")"
] | [
3042,
0
] | [
3052,
33
] | python | en | ['en', 'lb', 'en'] | True |
Int | (name, ctx=None) | Return an integer constant named `name`. If `ctx=None`, then the global context is used.
>>> x = Int('x')
>>> is_int(x)
True
>>> is_int(x + 1)
True
| Return an integer constant named `name`. If `ctx=None`, then the global context is used. | def Int(name, ctx=None):
"""Return an integer constant named `name`. If `ctx=None`, then the global context is used.
>>> x = Int('x')
>>> is_int(x)
True
>>> is_int(x + 1)
True
"""
ctx = _get_ctx(ctx)
return ArithRef(Z3_mk_const(ctx.ref(), to_symbol(name, ctx), IntSort(ctx).ast), ctx... | [
"def",
"Int",
"(",
"name",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithRef",
"(",
"Z3_mk_const",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"to_symbol",
"(",
"name",
",",
"ctx",
")",
",",
"IntSort",
"("... | [
3054,
0
] | [
3064,
88
] | python | en | ['en', 'en', 'en'] | True |
Ints | (names, ctx=None) | Return a tuple of Integer constants.
>>> x, y, z = Ints('x y z')
>>> Sum(x, y, z)
x + y + z
| Return a tuple of Integer constants. | def Ints(names, ctx=None):
"""Return a tuple of Integer constants.
>>> x, y, z = Ints('x y z')
>>> Sum(x, y, z)
x + y + z
"""
ctx = _get_ctx(ctx)
if isinstance(names, str):
names = names.split(" ")
return [Int(name, ctx) for name in names] | [
"def",
"Ints",
"(",
"names",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"if",
"isinstance",
"(",
"names",
",",
"str",
")",
":",
"names",
"=",
"names",
".",
"split",
"(",
"\" \"",
")",
"return",
"[",
"Int",
"(",
... | [
3066,
0
] | [
3076,
45
] | python | en | ['en', 'ca', 'en'] | True |
IntVector | (prefix, sz, ctx=None) | Return a list of integer constants of size `sz`.
>>> X = IntVector('x', 3)
>>> X
[x__0, x__1, x__2]
>>> Sum(X)
x__0 + x__1 + x__2
| Return a list of integer constants of size `sz`. | def IntVector(prefix, sz, ctx=None):
"""Return a list of integer constants of size `sz`.
>>> X = IntVector('x', 3)
>>> X
[x__0, x__1, x__2]
>>> Sum(X)
x__0 + x__1 + x__2
"""
ctx = _get_ctx(ctx)
return [ Int('%s__%s' % (prefix, i), ctx) for i in range(sz) ] | [
"def",
"IntVector",
"(",
"prefix",
",",
"sz",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"[",
"Int",
"(",
"'%s__%s'",
"%",
"(",
"prefix",
",",
"i",
")",
",",
"ctx",
")",
"for",
"i",
"in",
"range",
"(",... | [
3078,
0
] | [
3088,
66
] | python | en | ['en', 'ca', 'en'] | True |
FreshInt | (prefix='x', ctx=None) | Return a fresh integer constant in the given context using the given prefix.
>>> x = FreshInt()
>>> y = FreshInt()
>>> eq(x, y)
False
>>> x.sort()
Int
| Return a fresh integer constant in the given context using the given prefix. | def FreshInt(prefix='x', ctx=None):
"""Return a fresh integer constant in the given context using the given prefix.
>>> x = FreshInt()
>>> y = FreshInt()
>>> eq(x, y)
False
>>> x.sort()
Int
"""
ctx = _get_ctx(ctx)
return ArithRef(Z3_mk_fresh_const(ctx.ref(), prefix, IntSort(ctx)... | [
"def",
"FreshInt",
"(",
"prefix",
"=",
"'x'",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithRef",
"(",
"Z3_mk_fresh_const",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"prefix",
",",
"IntSort",
"(",
"ctx",
"... | [
3090,
0
] | [
3101,
80
] | python | en | ['en', 'en', 'en'] | True |
Real | (name, ctx=None) | Return a real constant named `name`. If `ctx=None`, then the global context is used.
>>> x = Real('x')
>>> is_real(x)
True
>>> is_real(x + 1)
True
| Return a real constant named `name`. If `ctx=None`, then the global context is used. | def Real(name, ctx=None):
"""Return a real constant named `name`. If `ctx=None`, then the global context is used.
>>> x = Real('x')
>>> is_real(x)
True
>>> is_real(x + 1)
True
"""
ctx = _get_ctx(ctx)
return ArithRef(Z3_mk_const(ctx.ref(), to_symbol(name, ctx), RealSort(ctx).ast), ct... | [
"def",
"Real",
"(",
"name",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithRef",
"(",
"Z3_mk_const",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"to_symbol",
"(",
"name",
",",
"ctx",
")",
",",
"RealSort",
"... | [
3103,
0
] | [
3113,
89
] | python | en | ['en', 'en', 'en'] | True |
Reals | (names, ctx=None) | Return a tuple of real constants.
>>> x, y, z = Reals('x y z')
>>> Sum(x, y, z)
x + y + z
>>> Sum(x, y, z).sort()
Real
| Return a tuple of real constants. | def Reals(names, ctx=None):
"""Return a tuple of real constants.
>>> x, y, z = Reals('x y z')
>>> Sum(x, y, z)
x + y + z
>>> Sum(x, y, z).sort()
Real
"""
ctx = _get_ctx(ctx)
if isinstance(names, str):
names = names.split(" ")
return [Real(name, ctx) for name in names] | [
"def",
"Reals",
"(",
"names",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"if",
"isinstance",
"(",
"names",
",",
"str",
")",
":",
"names",
"=",
"names",
".",
"split",
"(",
"\" \"",
")",
"return",
"[",
"Real",
"(",
... | [
3115,
0
] | [
3127,
46
] | python | en | ['en', 'en', 'en'] | True |
RealVector | (prefix, sz, ctx=None) | Return a list of real constants of size `sz`.
>>> X = RealVector('x', 3)
>>> X
[x__0, x__1, x__2]
>>> Sum(X)
x__0 + x__1 + x__2
>>> Sum(X).sort()
Real
| Return a list of real constants of size `sz`. | def RealVector(prefix, sz, ctx=None):
"""Return a list of real constants of size `sz`.
>>> X = RealVector('x', 3)
>>> X
[x__0, x__1, x__2]
>>> Sum(X)
x__0 + x__1 + x__2
>>> Sum(X).sort()
Real
"""
ctx = _get_ctx(ctx)
return [ Real('%s__%s' % (prefix, i), ctx) for i in range(s... | [
"def",
"RealVector",
"(",
"prefix",
",",
"sz",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"[",
"Real",
"(",
"'%s__%s'",
"%",
"(",
"prefix",
",",
"i",
")",
",",
"ctx",
")",
"for",
"i",
"in",
"range",
"(... | [
3129,
0
] | [
3141,
67
] | python | en | ['en', 'en', 'en'] | True |
FreshReal | (prefix='b', ctx=None) | Return a fresh real constant in the given context using the given prefix.
>>> x = FreshReal()
>>> y = FreshReal()
>>> eq(x, y)
False
>>> x.sort()
Real
| Return a fresh real constant in the given context using the given prefix. | def FreshReal(prefix='b', ctx=None):
"""Return a fresh real constant in the given context using the given prefix.
>>> x = FreshReal()
>>> y = FreshReal()
>>> eq(x, y)
False
>>> x.sort()
Real
"""
ctx = _get_ctx(ctx)
return ArithRef(Z3_mk_fresh_const(ctx.ref(), prefix, RealSort(ct... | [
"def",
"FreshReal",
"(",
"prefix",
"=",
"'b'",
",",
"ctx",
"=",
"None",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"return",
"ArithRef",
"(",
"Z3_mk_fresh_const",
"(",
"ctx",
".",
"ref",
"(",
")",
",",
"prefix",
",",
"RealSort",
"(",
"ctx",
... | [
3143,
0
] | [
3154,
81
] | python | en | ['en', 'en', 'en'] | True |
ToReal | (a) | Return the Z3 expression ToReal(a).
>>> x = Int('x')
>>> x.sort()
Int
>>> n = ToReal(x)
>>> n
ToReal(x)
>>> n.sort()
Real
| Return the Z3 expression ToReal(a). | def ToReal(a):
""" Return the Z3 expression ToReal(a).
>>> x = Int('x')
>>> x.sort()
Int
>>> n = ToReal(x)
>>> n
ToReal(x)
>>> n.sort()
Real
"""
if z3_debug():
_z3_assert(a.is_int(), "Z3 integer expression expected.")
ctx = a.ctx
return ArithRef(Z3_mk_int2rea... | [
"def",
"ToReal",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"a",
".",
"is_int",
"(",
")",
",",
"\"Z3 integer expression expected.\"",
")",
"ctx",
"=",
"a",
".",
"ctx",
"return",
"ArithRef",
"(",
"Z3_mk_int2real",
"(",
"ctx",
... | [
3156,
0
] | [
3171,
63
] | python | en | ['en', 'en', 'en'] | True |
ToInt | (a) | Return the Z3 expression ToInt(a).
>>> x = Real('x')
>>> x.sort()
Real
>>> n = ToInt(x)
>>> n
ToInt(x)
>>> n.sort()
Int
| Return the Z3 expression ToInt(a). | def ToInt(a):
""" Return the Z3 expression ToInt(a).
>>> x = Real('x')
>>> x.sort()
Real
>>> n = ToInt(x)
>>> n
ToInt(x)
>>> n.sort()
Int
"""
if z3_debug():
_z3_assert(a.is_real(), "Z3 real expression expected.")
ctx = a.ctx
return ArithRef(Z3_mk_real2int(ctx... | [
"def",
"ToInt",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"a",
".",
"is_real",
"(",
")",
",",
"\"Z3 real expression expected.\"",
")",
"ctx",
"=",
"a",
".",
"ctx",
"return",
"ArithRef",
"(",
"Z3_mk_real2int",
"(",
"ctx",
"... | [
3173,
0
] | [
3188,
63
] | python | en | ['en', 'en', 'en'] | True |
IsInt | (a) | Return the Z3 predicate IsInt(a).
>>> x = Real('x')
>>> IsInt(x + "1/2")
IsInt(x + 1/2)
>>> solve(IsInt(x + "1/2"), x > 0, x < 1)
[x = 1/2]
>>> solve(IsInt(x + "1/2"), x > 0, x < 1, x != "1/2")
no solution
| Return the Z3 predicate IsInt(a). | def IsInt(a):
""" Return the Z3 predicate IsInt(a).
>>> x = Real('x')
>>> IsInt(x + "1/2")
IsInt(x + 1/2)
>>> solve(IsInt(x + "1/2"), x > 0, x < 1)
[x = 1/2]
>>> solve(IsInt(x + "1/2"), x > 0, x < 1, x != "1/2")
no solution
"""
if z3_debug():
_z3_assert(a.is_real(), "Z3 ... | [
"def",
"IsInt",
"(",
"a",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"a",
".",
"is_real",
"(",
")",
",",
"\"Z3 real expression expected.\"",
")",
"ctx",
"=",
"a",
".",
"ctx",
"return",
"BoolRef",
"(",
"Z3_mk_is_int",
"(",
"ctx",
".",... | [
3190,
0
] | [
3204,
60
] | python | en | ['en', 'ig', 'en'] | True |
Sqrt | (a, ctx=None) | Return a Z3 expression which represents the square root of a.
>>> x = Real('x')
>>> Sqrt(x)
x**(1/2)
| Return a Z3 expression which represents the square root of a. | def Sqrt(a, ctx=None):
""" Return a Z3 expression which represents the square root of a.
>>> x = Real('x')
>>> Sqrt(x)
x**(1/2)
"""
if not is_expr(a):
ctx = _get_ctx(ctx)
a = RealVal(a, ctx)
return a ** "1/2" | [
"def",
"Sqrt",
"(",
"a",
",",
"ctx",
"=",
"None",
")",
":",
"if",
"not",
"is_expr",
"(",
"a",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"a",
"=",
"RealVal",
"(",
"a",
",",
"ctx",
")",
"return",
"a",
"**",
"\"1/2\""
] | [
3206,
0
] | [
3216,
21
] | python | en | ['en', 'en', 'en'] | True |
Cbrt | (a, ctx=None) | Return a Z3 expression which represents the cubic root of a.
>>> x = Real('x')
>>> Cbrt(x)
x**(1/3)
| Return a Z3 expression which represents the cubic root of a. | def Cbrt(a, ctx=None):
""" Return a Z3 expression which represents the cubic root of a.
>>> x = Real('x')
>>> Cbrt(x)
x**(1/3)
"""
if not is_expr(a):
ctx = _get_ctx(ctx)
a = RealVal(a, ctx)
return a ** "1/3" | [
"def",
"Cbrt",
"(",
"a",
",",
"ctx",
"=",
"None",
")",
":",
"if",
"not",
"is_expr",
"(",
"a",
")",
":",
"ctx",
"=",
"_get_ctx",
"(",
"ctx",
")",
"a",
"=",
"RealVal",
"(",
"a",
",",
"ctx",
")",
"return",
"a",
"**",
"\"1/3\""
] | [
3218,
0
] | [
3228,
21
] | python | en | ['en', 'en', 'en'] | True |
is_bv_sort | (s) | Return True if `s` is a Z3 bit-vector sort.
>>> is_bv_sort(BitVecSort(32))
True
>>> is_bv_sort(IntSort())
False
| Return True if `s` is a Z3 bit-vector sort. | def is_bv_sort(s):
"""Return True if `s` is a Z3 bit-vector sort.
>>> is_bv_sort(BitVecSort(32))
True
>>> is_bv_sort(IntSort())
False
"""
return isinstance(s, BitVecSortRef) | [
"def",
"is_bv_sort",
"(",
"s",
")",
":",
"return",
"isinstance",
"(",
"s",
",",
"BitVecSortRef",
")"
] | [
3268,
0
] | [
3276,
39
] | python | en | ['en', 'nl', 'en'] | True |
Context.ref | (self) | Return a reference to the actual C pointer to the Z3 context. | Return a reference to the actual C pointer to the Z3 context. | def ref(self):
"""Return a reference to the actual C pointer to the Z3 context."""
return self.ctx | [
"def",
"ref",
"(",
"self",
")",
":",
"return",
"self",
".",
"ctx"
] | [
199,
4
] | [
201,
23
] | python | en | ['en', 'en', 'en'] | True |
Context.interrupt | (self) | Interrupt a solver performing a satisfiability test, a tactic processing a goal, or simplify functions.
This method can be invoked from a thread different from the one executing the
interruptible procedure.
| Interrupt a solver performing a satisfiability test, a tactic processing a goal, or simplify functions. | def interrupt(self):
"""Interrupt a solver performing a satisfiability test, a tactic processing a goal, or simplify functions.
This method can be invoked from a thread different from the one executing the
interruptible procedure.
"""
Z3_interrupt(self.ref()) | [
"def",
"interrupt",
"(",
"self",
")",
":",
"Z3_interrupt",
"(",
"self",
".",
"ref",
"(",
")",
")"
] | [
203,
4
] | [
209,
32
] | python | en | ['en', 'en', 'en'] | True |
AstRef.sexpr | (self) | Return a string representing the AST node in s-expression notation.
>>> x = Int('x')
>>> ((x + 1)*x).sexpr()
'(* (+ x 1) x)'
| Return a string representing the AST node in s-expression notation. | def sexpr(self):
"""Return a string representing the AST node in s-expression notation.
>>> x = Int('x')
>>> ((x + 1)*x).sexpr()
'(* (+ x 1) x)'
"""
return Z3_ast_to_string(self.ctx_ref(), self.as_ast()) | [
"def",
"sexpr",
"(",
"self",
")",
":",
"return",
"Z3_ast_to_string",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as_ast",
"(",
")",
")"
] | [
348,
4
] | [
355,
62
] | python | en | ['en', 'en', 'en'] | True |
AstRef.as_ast | (self) | Return a pointer to the corresponding C Z3_ast object. | Return a pointer to the corresponding C Z3_ast object. | def as_ast(self):
"""Return a pointer to the corresponding C Z3_ast object."""
return self.ast | [
"def",
"as_ast",
"(",
"self",
")",
":",
"return",
"self",
".",
"ast"
] | [
357,
4
] | [
359,
23
] | python | en | ['en', 'en', 'en'] | True |
AstRef.get_id | (self) | Return unique identifier for object. It can be used for hash-tables and maps. | Return unique identifier for object. It can be used for hash-tables and maps. | def get_id(self):
"""Return unique identifier for object. It can be used for hash-tables and maps."""
return Z3_get_ast_id(self.ctx_ref(), self.as_ast()) | [
"def",
"get_id",
"(",
"self",
")",
":",
"return",
"Z3_get_ast_id",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as_ast",
"(",
")",
")"
] | [
361,
4
] | [
363,
59
] | python | en | ['en', 'en', 'en'] | True |
AstRef.ctx_ref | (self) | Return a reference to the C context where this AST node is stored. | Return a reference to the C context where this AST node is stored. | def ctx_ref(self):
"""Return a reference to the C context where this AST node is stored."""
return self.ctx.ref() | [
"def",
"ctx_ref",
"(",
"self",
")",
":",
"return",
"self",
".",
"ctx",
".",
"ref",
"(",
")"
] | [
365,
4
] | [
367,
29
] | python | en | ['en', 'en', 'en'] | True |
AstRef.eq | (self, other) | Return `True` if `self` and `other` are structurally identical.
>>> x = Int('x')
>>> n1 = x + 1
>>> n2 = 1 + x
>>> n1.eq(n2)
False
>>> n1 = simplify(n1)
>>> n2 = simplify(n2)
>>> n1.eq(n2)
True
| Return `True` if `self` and `other` are structurally identical. | def eq(self, other):
"""Return `True` if `self` and `other` are structurally identical.
>>> x = Int('x')
>>> n1 = x + 1
>>> n2 = 1 + x
>>> n1.eq(n2)
False
>>> n1 = simplify(n1)
>>> n2 = simplify(n2)
>>> n1.eq(n2)
True
"""
i... | [
"def",
"eq",
"(",
"self",
",",
"other",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_ast",
"(",
"other",
")",
",",
"\"Z3 AST expected\"",
")",
"return",
"Z3_is_eq_ast",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as... | [
369,
4
] | [
384,
74
] | python | en | ['en', 'en', 'en'] | True |
AstRef.translate | (self, target) | Translate `self` to the context `target`. That is, return a copy of `self` in the context `target`.
>>> c1 = Context()
>>> c2 = Context()
>>> x = Int('x', c1)
>>> y = Int('y', c2)
>>> # Nodes in different contexts can't be mixed.
>>> # However, we can translate nodes f... | Translate `self` to the context `target`. That is, return a copy of `self` in the context `target`. | def translate(self, target):
"""Translate `self` to the context `target`. That is, return a copy of `self` in the context `target`.
>>> c1 = Context()
>>> c2 = Context()
>>> x = Int('x', c1)
>>> y = Int('y', c2)
>>> # Nodes in different contexts can't be mixed.
... | [
"def",
"translate",
"(",
"self",
",",
"target",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"isinstance",
"(",
"target",
",",
"Context",
")",
",",
"\"argument must be a Z3 context\"",
")",
"return",
"_to_ast_ref",
"(",
"Z3_translate",
"(",
... | [
386,
4
] | [
400,
93
] | python | en | ['en', 'en', 'en'] | True |
AstRef.hash | (self) | Return a hashcode for the `self`.
>>> n1 = simplify(Int('x') + 1)
>>> n2 = simplify(2 + Int('x') - 1)
>>> n1.hash() == n2.hash()
True
| Return a hashcode for the `self`. | def hash(self):
"""Return a hashcode for the `self`.
>>> n1 = simplify(Int('x') + 1)
>>> n2 = simplify(2 + Int('x') - 1)
>>> n1.hash() == n2.hash()
True
"""
return Z3_get_ast_hash(self.ctx_ref(), self.as_ast()) | [
"def",
"hash",
"(",
"self",
")",
":",
"return",
"Z3_get_ast_hash",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as_ast",
"(",
")",
")"
] | [
405,
4
] | [
413,
61
] | python | en | ['en', 'en', 'en'] | True |
SortRef.kind | (self) | Return the Z3 internal kind of a sort. This method can be used to test if `self` is one of the Z3 builtin sorts.
>>> b = BoolSort()
>>> b.kind() == Z3_BOOL_SORT
True
>>> b.kind() == Z3_INT_SORT
False
>>> A = ArraySort(IntSort(), IntSort())
>>> A.kind() == Z3_ARRA... | Return the Z3 internal kind of a sort. This method can be used to test if `self` is one of the Z3 builtin sorts. | def kind(self):
"""Return the Z3 internal kind of a sort. This method can be used to test if `self` is one of the Z3 builtin sorts.
>>> b = BoolSort()
>>> b.kind() == Z3_BOOL_SORT
True
>>> b.kind() == Z3_INT_SORT
False
>>> A = ArraySort(IntSort(), IntSort())
... | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"_sort_kind",
"(",
"self",
".",
"ctx",
",",
"self",
".",
"ast",
")"
] | [
522,
4
] | [
536,
45
] | python | en | ['en', 'en', 'en'] | True |
SortRef.subsort | (self, other) | Return `True` if `self` is a subsort of `other`.
>>> IntSort().subsort(RealSort())
True
| Return `True` if `self` is a subsort of `other`. | def subsort(self, other):
"""Return `True` if `self` is a subsort of `other`.
>>> IntSort().subsort(RealSort())
True
"""
return False | [
"def",
"subsort",
"(",
"self",
",",
"other",
")",
":",
"return",
"False"
] | [
538,
4
] | [
544,
20
] | python | en | ['en', 'en', 'en'] | True |
SortRef.cast | (self, val) | Try to cast `val` as an element of sort `self`.
This method is used in Z3Py to convert Python objects such as integers,
floats, longs and strings into Z3 expressions.
>>> x = Int('x')
>>> RealSort().cast(x)
ToReal(x)
| Try to cast `val` as an element of sort `self`. | def cast(self, val):
"""Try to cast `val` as an element of sort `self`.
This method is used in Z3Py to convert Python objects such as integers,
floats, longs and strings into Z3 expressions.
>>> x = Int('x')
>>> RealSort().cast(x)
ToReal(x)
"""
if z3_deb... | [
"def",
"cast",
"(",
"self",
",",
"val",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_expr",
"(",
"val",
")",
",",
"\"Z3 expression expected\"",
")",
"_z3_assert",
"(",
"self",
".",
"eq",
"(",
"val",
".",
"sort",
"(",
")",
")",
... | [
546,
4
] | [
559,
18
] | python | en | ['en', 'en', 'en'] | True |
SortRef.name | (self) | Return the name (string) of sort `self`.
>>> BoolSort().name()
'Bool'
>>> ArraySort(IntSort(), IntSort()).name()
'Array'
| Return the name (string) of sort `self`. | def name(self):
"""Return the name (string) of sort `self`.
>>> BoolSort().name()
'Bool'
>>> ArraySort(IntSort(), IntSort()).name()
'Array'
"""
return _symbol2py(self.ctx, Z3_get_sort_name(self.ctx_ref(), self.ast)) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"_symbol2py",
"(",
"self",
".",
"ctx",
",",
"Z3_get_sort_name",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
561,
4
] | [
569,
79
] | python | en | ['en', 'sl', 'en'] | True |
SortRef.__eq__ | (self, other) | Return `True` if `self` and `other` are the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() == BoolSort()
True
>>> p.sort() == IntSort()
False
| Return `True` if `self` and `other` are the same Z3 sort. | def __eq__(self, other):
"""Return `True` if `self` and `other` are the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() == BoolSort()
True
>>> p.sort() == IntSort()
False
"""
if other is None:
return False
return Z3_is_eq_sort(self.ctx_re... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"is",
"None",
":",
"return",
"False",
"return",
"Z3_is_eq_sort",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
",",
"other",
".",
"ast",
")"
] | [
571,
4
] | [
582,
65
] | python | en | ['en', 'en', 'en'] | True |
SortRef.__ne__ | (self, other) | Return `True` if `self` and `other` are not the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() != BoolSort()
False
>>> p.sort() != IntSort()
True
| Return `True` if `self` and `other` are not the same Z3 sort. | def __ne__(self, other):
"""Return `True` if `self` and `other` are not the same Z3 sort.
>>> p = Bool('p')
>>> p.sort() != BoolSort()
False
>>> p.sort() != IntSort()
True
"""
return not Z3_is_eq_sort(self.ctx_ref(), self.ast, other.ast) | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"return",
"not",
"Z3_is_eq_sort",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
",",
"other",
".",
"ast",
")"
] | [
584,
4
] | [
593,
69
] | python | en | ['en', 'en', 'en'] | True |
SortRef.__hash__ | (self) | Hash code. | Hash code. | def __hash__(self):
""" Hash code. """
return AstRef.__hash__(self) | [
"def",
"__hash__",
"(",
"self",
")",
":",
"return",
"AstRef",
".",
"__hash__",
"(",
"self",
")"
] | [
595,
4
] | [
597,
36
] | python | en | ['en', 'nl', 'en'] | False |
FuncDeclRef.name | (self) | Return the name of the function declaration `self`.
>>> f = Function('f', IntSort(), IntSort())
>>> f.name()
'f'
>>> isinstance(f.name(), str)
True
| Return the name of the function declaration `self`. | def name(self):
"""Return the name of the function declaration `self`.
>>> f = Function('f', IntSort(), IntSort())
>>> f.name()
'f'
>>> isinstance(f.name(), str)
True
"""
return _symbol2py(self.ctx, Z3_get_decl_name(self.ctx_ref(), self.ast)) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"_symbol2py",
"(",
"self",
".",
"ctx",
",",
"Z3_get_decl_name",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
680,
4
] | [
689,
79
] | python | en | ['en', 'en', 'en'] | True |
FuncDeclRef.arity | (self) | Return the number of arguments of a function declaration. If `self` is a constant, then `self.arity()` is 0.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.arity()
2
| Return the number of arguments of a function declaration. If `self` is a constant, then `self.arity()` is 0. | def arity(self):
"""Return the number of arguments of a function declaration. If `self` is a constant, then `self.arity()` is 0.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.arity()
2
"""
return int(Z3_get_arity(self.ctx_ref(), self.ast)) | [
"def",
"arity",
"(",
"self",
")",
":",
"return",
"int",
"(",
"Z3_get_arity",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
691,
4
] | [
698,
58
] | python | en | ['en', 'en', 'en'] | True |
FuncDeclRef.domain | (self, i) | Return the sort of the argument `i` of a function declaration. This method assumes that `0 <= i < self.arity()`.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.domain(0)
Int
>>> f.domain(1)
Real
| Return the sort of the argument `i` of a function declaration. This method assumes that `0 <= i < self.arity()`. | def domain(self, i):
"""Return the sort of the argument `i` of a function declaration. This method assumes that `0 <= i < self.arity()`.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.domain(0)
Int
>>> f.domain(1)
Real
"""
if z3_debug():
... | [
"def",
"domain",
"(",
"self",
",",
"i",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"i",
"<",
"self",
".",
"arity",
"(",
")",
",",
"\"Index out of bounds\"",
")",
"return",
"_to_sort_ref",
"(",
"Z3_get_domain",
"(",
"self",
".",
"ctx_... | [
700,
4
] | [
711,
81
] | python | en | ['en', 'en', 'en'] | True |
FuncDeclRef.range | (self) | Return the sort of the range of a function declaration. For constants, this is the sort of the constant.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.range()
Bool
| Return the sort of the range of a function declaration. For constants, this is the sort of the constant. | def range(self):
"""Return the sort of the range of a function declaration. For constants, this is the sort of the constant.
>>> f = Function('f', IntSort(), RealSort(), BoolSort())
>>> f.range()
Bool
"""
return _to_sort_ref(Z3_get_range(self.ctx_ref(), self.ast), self.c... | [
"def",
"range",
"(",
"self",
")",
":",
"return",
"_to_sort_ref",
"(",
"Z3_get_range",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
",",
"self",
".",
"ctx",
")"
] | [
713,
4
] | [
720,
77
] | python | en | ['en', 'en', 'en'] | True |
FuncDeclRef.kind | (self) | Return the internal kind of a function declaration. It can be used to identify Z3 built-in functions such as addition, multiplication, etc.
>>> x = Int('x')
>>> d = (x + 1).decl()
>>> d.kind() == Z3_OP_ADD
True
>>> d.kind() == Z3_OP_MUL
False
| Return the internal kind of a function declaration. It can be used to identify Z3 built-in functions such as addition, multiplication, etc. | def kind(self):
"""Return the internal kind of a function declaration. It can be used to identify Z3 built-in functions such as addition, multiplication, etc.
>>> x = Int('x')
>>> d = (x + 1).decl()
>>> d.kind() == Z3_OP_ADD
True
>>> d.kind() == Z3_OP_MUL
False
... | [
"def",
"kind",
"(",
"self",
")",
":",
"return",
"Z3_get_decl_kind",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")"
] | [
722,
4
] | [
732,
57
] | python | en | ['en', 'en', 'en'] | True |
FuncDeclRef.__call__ | (self, *args) | Create a Z3 application expression using the function `self`, and the given arguments.
The arguments must be Z3 expressions. This method assumes that
the sorts of the elements in `args` match the sorts of the
domain. Limited coercion is supported. For example, if
args[0] is a Python in... | Create a Z3 application expression using the function `self`, and the given arguments. | def __call__(self, *args):
"""Create a Z3 application expression using the function `self`, and the given arguments.
The arguments must be Z3 expressions. This method assumes that
the sorts of the elements in `args` match the sorts of the
domain. Limited coercion is supported. For exam... | [
"def",
"__call__",
"(",
"self",
",",
"*",
"args",
")",
":",
"args",
"=",
"_get_args",
"(",
"args",
")",
"num",
"=",
"len",
"(",
"args",
")",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"num",
"==",
"self",
".",
"arity",
"(",
")",
",",
"... | [
758,
4
] | [
788,
92
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.sort | (self) | Return the sort of expression `self`.
>>> x = Int('x')
>>> (x + 1).sort()
Int
>>> y = Real('y')
>>> (x + y).sort()
Real
| Return the sort of expression `self`. | def sort(self):
"""Return the sort of expression `self`.
>>> x = Int('x')
>>> (x + 1).sort()
Int
>>> y = Real('y')
>>> (x + y).sort()
Real
"""
return _sort(self.ctx, self.as_ast()) | [
"def",
"sort",
"(",
"self",
")",
":",
"return",
"_sort",
"(",
"self",
".",
"ctx",
",",
"self",
".",
"as_ast",
"(",
")",
")"
] | [
912,
4
] | [
922,
45
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.sort_kind | (self) | Shorthand for `self.sort().kind()`.
>>> a = Array('a', IntSort(), IntSort())
>>> a.sort_kind() == Z3_ARRAY_SORT
True
>>> a.sort_kind() == Z3_INT_SORT
False
| Shorthand for `self.sort().kind()`. | def sort_kind(self):
"""Shorthand for `self.sort().kind()`.
>>> a = Array('a', IntSort(), IntSort())
>>> a.sort_kind() == Z3_ARRAY_SORT
True
>>> a.sort_kind() == Z3_INT_SORT
False
"""
return self.sort().kind() | [
"def",
"sort_kind",
"(",
"self",
")",
":",
"return",
"self",
".",
"sort",
"(",
")",
".",
"kind",
"(",
")"
] | [
924,
4
] | [
933,
33
] | python | en | ['en', 'da', 'en'] | True |
ExprRef.__eq__ | (self, other) | Return a Z3 expression that represents the constraint `self == other`.
If `other` is `None`, then this method simply returns `False`.
>>> a = Int('a')
>>> b = Int('b')
>>> a == b
a == b
>>> a is None
False
| Return a Z3 expression that represents the constraint `self == other`. | def __eq__(self, other):
"""Return a Z3 expression that represents the constraint `self == other`.
If `other` is `None`, then this method simply returns `False`.
>>> a = Int('a')
>>> b = Int('b')
>>> a == b
a == b
>>> a is None
False
"""
... | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"is",
"None",
":",
"return",
"False",
"a",
",",
"b",
"=",
"_coerce_exprs",
"(",
"self",
",",
"other",
")",
"return",
"BoolRef",
"(",
"Z3_mk_eq",
"(",
"self",
".",
"ctx_ref",
"(",
... | [
935,
4
] | [
950,
82
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.__hash__ | (self) | Hash code. | Hash code. | def __hash__(self):
""" Hash code. """
return AstRef.__hash__(self) | [
"def",
"__hash__",
"(",
"self",
")",
":",
"return",
"AstRef",
".",
"__hash__",
"(",
"self",
")"
] | [
952,
4
] | [
954,
36
] | python | en | ['en', 'nl', 'en'] | False |
ExprRef.__ne__ | (self, other) | Return a Z3 expression that represents the constraint `self != other`.
If `other` is `None`, then this method simply returns `True`.
>>> a = Int('a')
>>> b = Int('b')
>>> a != b
a != b
>>> a is not None
True
| Return a Z3 expression that represents the constraint `self != other`. | def __ne__(self, other):
"""Return a Z3 expression that represents the constraint `self != other`.
If `other` is `None`, then this method simply returns `True`.
>>> a = Int('a')
>>> b = Int('b')
>>> a != b
a != b
>>> a is not None
True
"""
... | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"is",
"None",
":",
"return",
"True",
"a",
",",
"b",
"=",
"_coerce_exprs",
"(",
"self",
",",
"other",
")",
"_args",
",",
"sz",
"=",
"_to_ast_array",
"(",
"(",
"a",
",",
"b",
")",... | [
956,
4
] | [
972,
74
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.decl | (self) | Return the Z3 function declaration associated with a Z3 application.
>>> f = Function('f', IntSort(), IntSort())
>>> a = Int('a')
>>> t = f(a)
>>> eq(t.decl(), f)
True
>>> (a + 1).decl()
+
| Return the Z3 function declaration associated with a Z3 application. | def decl(self):
"""Return the Z3 function declaration associated with a Z3 application.
>>> f = Function('f', IntSort(), IntSort())
>>> a = Int('a')
>>> t = f(a)
>>> eq(t.decl(), f)
True
>>> (a + 1).decl()
+
"""
if z3_debug():
... | [
"def",
"decl",
"(",
"self",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_app",
"(",
"self",
")",
",",
"\"Z3 application expected\"",
")",
"return",
"FuncDeclRef",
"(",
"Z3_get_app_decl",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"s... | [
977,
4
] | [
990,
84
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.num_args | (self) | Return the number of arguments of a Z3 application.
>>> a = Int('a')
>>> b = Int('b')
>>> (a + b).num_args()
2
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t = f(a, b, 0)
>>> t.num_args()
3
| Return the number of arguments of a Z3 application. | def num_args(self):
"""Return the number of arguments of a Z3 application.
>>> a = Int('a')
>>> b = Int('b')
>>> (a + b).num_args()
2
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t = f(a, b, 0)
>>> t.num_args()
3
"... | [
"def",
"num_args",
"(",
"self",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_app",
"(",
"self",
")",
",",
"\"Z3 application expected\"",
")",
"return",
"int",
"(",
"Z3_get_app_num_args",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"s... | [
992,
4
] | [
1006,
70
] | python | en | ['en', 'en', 'en'] | True |
ExprRef.arg | (self, idx) | Return argument `idx` of the application `self`.
This method assumes that `self` is a function application with at least `idx+1` arguments.
>>> a = Int('a')
>>> b = Int('b')
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t = f(a, b, 0)
>>> t.arg(0... | Return argument `idx` of the application `self`. | def arg(self, idx):
"""Return argument `idx` of the application `self`.
This method assumes that `self` is a function application with at least `idx+1` arguments.
>>> a = Int('a')
>>> b = Int('b')
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t =... | [
"def",
"arg",
"(",
"self",
",",
"idx",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"is_app",
"(",
"self",
")",
",",
"\"Z3 application expected\"",
")",
"_z3_assert",
"(",
"idx",
"<",
"self",
".",
"num_args",
"(",
")",
",",
"\"Invalid ... | [
1008,
4
] | [
1027,
89
] | python | en | ['en', 'da', 'en'] | True |
ExprRef.children | (self) | Return a list containing the children of the given expression
>>> a = Int('a')
>>> b = Int('b')
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t = f(a, b, 0)
>>> t.children()
[a, b, 0]
| Return a list containing the children of the given expression | def children(self):
"""Return a list containing the children of the given expression
>>> a = Int('a')
>>> b = Int('b')
>>> f = Function('f', IntSort(), IntSort(), IntSort(), IntSort())
>>> t = f(a, b, 0)
>>> t.children()
[a, b, 0]
"""
if is_app(se... | [
"def",
"children",
"(",
"self",
")",
":",
"if",
"is_app",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"arg",
"(",
"i",
")",
"for",
"i",
"in",
"range",
"(",
"self",
".",
"num_args",
"(",
")",
")",
"]",
"else",
":",
"return",
"[",
"]"
] | [
1029,
4
] | [
1042,
21
] | python | en | ['en', 'en', 'en'] | True |
BoolSortRef.cast | (self, val) | Try to cast `val` as a Boolean.
>>> x = BoolSort().cast(True)
>>> x
True
>>> is_expr(x)
True
>>> is_expr(True)
False
>>> x.sort()
Bool
| Try to cast `val` as a Boolean. | def cast(self, val):
"""Try to cast `val` as a Boolean.
>>> x = BoolSort().cast(True)
>>> x
True
>>> is_expr(x)
True
>>> is_expr(True)
False
>>> x.sort()
Bool
"""
if isinstance(val, bool):
return BoolVal(val, se... | [
"def",
"cast",
"(",
"self",
",",
"val",
")",
":",
"if",
"isinstance",
"(",
"val",
",",
"bool",
")",
":",
"return",
"BoolVal",
"(",
"val",
",",
"self",
".",
"ctx",
")",
"if",
"z3_debug",
"(",
")",
":",
"if",
"not",
"is_expr",
"(",
"val",
")",
":... | [
1399,
4
] | [
1419,
18
] | python | en | ['en', 'en', 'en'] | True |
BoolRef.__mul__ | (self, other) | Create the Z3 expression `self * other`.
| Create the Z3 expression `self * other`.
| def __mul__(self, other):
"""Create the Z3 expression `self * other`.
"""
if other == 1:
return self
if other == 0:
return 0
return If(self, other, 0) | [
"def",
"__mul__",
"(",
"self",
",",
"other",
")",
":",
"if",
"other",
"==",
"1",
":",
"return",
"self",
"if",
"other",
"==",
"0",
":",
"return",
"0",
"return",
"If",
"(",
"self",
",",
"other",
",",
"0",
")"
] | [
1439,
4
] | [
1446,
33
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.sort | (self) | Return the Boolean sort or sort of Lambda. | Return the Boolean sort or sort of Lambda. | def sort(self):
"""Return the Boolean sort or sort of Lambda."""
if self.is_lambda():
return _sort(self.ctx, self.as_ast())
return BoolSort(self.ctx) | [
"def",
"sort",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_lambda",
"(",
")",
":",
"return",
"_sort",
"(",
"self",
".",
"ctx",
",",
"self",
".",
"as_ast",
"(",
")",
")",
"return",
"BoolSort",
"(",
"self",
".",
"ctx",
")"
] | [
1848,
4
] | [
1852,
33
] | python | en | ['en', 'id', 'en'] | True |
QuantifierRef.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
| Return `True` if `self` is a universal quantifier. | 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
... | [
"def",
"is_forall",
"(",
"self",
")",
":",
"return",
"Z3_is_quantifier_forall",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")"
] | [
1854,
4
] | [
1866,
64
] | python | en | ['en', 'mt', 'en'] | True |
QuantifierRef.is_exists | (self) | 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
| Return `True` if `self` is an existential quantifier. | def is_exists(self):
"""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
... | [
"def",
"is_exists",
"(",
"self",
")",
":",
"return",
"Z3_is_quantifier_exists",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")"
] | [
1868,
4
] | [
1880,
64
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.is_lambda | (self) | 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
| Return `True` if `self` is a lambda expression. | def is_lambda(self):
"""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
"""
... | [
"def",
"is_lambda",
"(",
"self",
")",
":",
"return",
"Z3_is_lambda",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")"
] | [
1882,
4
] | [
1894,
53
] | python | en | ['en', 'mt', 'en'] | True |
QuantifierRef.__getitem__ | (self, arg) | Return the Z3 expression `self[arg]`.
| Return the Z3 expression `self[arg]`.
| def __getitem__(self, arg):
"""Return the Z3 expression `self[arg]`.
"""
if z3_debug():
_z3_assert(self.is_lambda(), "quantifier should be a lambda expression")
arg = self.sort().domain().cast(arg)
return _to_expr_ref(Z3_mk_select(self.ctx_ref(), self.as_ast(), arg.as... | [
"def",
"__getitem__",
"(",
"self",
",",
"arg",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"self",
".",
"is_lambda",
"(",
")",
",",
"\"quantifier should be a lambda expression\"",
")",
"arg",
"=",
"self",
".",
"sort",
"(",
")",
".",
"do... | [
1896,
4
] | [
1902,
96
] | python | en | ['en', 'da', 'en'] | True |
QuantifierRef.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
| Return the weight annotation of `self`. | 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
"""
r... | [
"def",
"weight",
"(",
"self",
")",
":",
"return",
"int",
"(",
"Z3_get_quantifier_weight",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
1905,
4
] | [
1917,
70
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.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
... | Return the number of patterns (i.e., quantifier instantiation hints) in `self`. | 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) ])
... | [
"def",
"num_patterns",
"(",
"self",
")",
":",
"return",
"int",
"(",
"Z3_get_quantifier_num_patterns",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
1919,
4
] | [
1929,
76
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.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.pat... | Return a pattern (i.e., quantifier instantiation hints) in `self`. | 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_pat... | [
"def",
"pattern",
"(",
"self",
",",
"idx",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"idx",
"<",
"self",
".",
"num_patterns",
"(",
")",
",",
"\"Invalid pattern idx\"",
")",
"return",
"PatternRef",
"(",
"Z3_get_quantifier_pattern_ast",
"("... | [
1931,
4
] | [
1947,
97
] | python | en | ['en', 'co', 'en'] | True |
QuantifierRef.num_no_patterns | (self) | Return the number of no-patterns. | Return the number of no-patterns. | def num_no_patterns(self):
"""Return the number of no-patterns."""
return Z3_get_quantifier_num_no_patterns(self.ctx_ref(), self.ast) | [
"def",
"num_no_patterns",
"(",
"self",
")",
":",
"return",
"Z3_get_quantifier_num_no_patterns",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")"
] | [
1949,
4
] | [
1951,
74
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.no_pattern | (self, idx) | Return a no-pattern. | Return a no-pattern. | def no_pattern(self, idx):
"""Return a no-pattern."""
if z3_debug():
_z3_assert(idx < self.num_no_patterns(), "Invalid no-pattern idx")
return _to_expr_ref(Z3_get_quantifier_no_pattern_ast(self.ctx_ref(), self.ast, idx), self.ctx) | [
"def",
"no_pattern",
"(",
"self",
",",
"idx",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"idx",
"<",
"self",
".",
"num_no_patterns",
"(",
")",
",",
"\"Invalid no-pattern idx\"",
")",
"return",
"_to_expr_ref",
"(",
"Z3_get_quantifier_no_patte... | [
1953,
4
] | [
1957,
102
] | python | en | ['en', 'ht', 'en'] | True |
QuantifierRef.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
| Return the expression being quantified. | 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
"""
return _to_expr_ref(Z3_get_quantifier_body(self.ctx_ref(), self.ast), self... | [
"def",
"body",
"(",
"self",
")",
":",
"return",
"_to_expr_ref",
"(",
"Z3_get_quantifier_body",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
",",
"self",
".",
"ctx",
")"
] | [
1959,
4
] | [
1968,
87
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.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
| Return the number of variables bounded by this quantifier. | 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
"""
return int(Z3_ge... | [
"def",
"num_vars",
"(",
"self",
")",
":",
"return",
"int",
"(",
"Z3_get_quantifier_num_bound",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"ast",
")",
")"
] | [
1970,
4
] | [
1980,
73
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.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'
| Return a string representing a name used when displaying the quantifier. | 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.... | [
"def",
"var_name",
"(",
"self",
",",
"idx",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"idx",
"<",
"self",
".",
"num_vars",
"(",
")",
",",
"\"Invalid variable idx\"",
")",
"return",
"_symbol2py",
"(",
"self",
".",
"ctx",
",",
"Z3_get... | [
1982,
4
] | [
1996,
96
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.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
| Return the sort of a bound variable. | 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
"... | [
"def",
"var_sort",
"(",
"self",
",",
"idx",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"idx",
"<",
"self",
".",
"num_vars",
"(",
")",
",",
"\"Invalid variable idx\"",
")",
"return",
"_to_sort_ref",
"(",
"Z3_get_quantifier_bound_sort",
"(",... | [
1998,
4
] | [
2012,
98
] | python | en | ['en', 'en', 'en'] | True |
QuantifierRef.children | (self) | 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]
| Return a list containing a single element self.body() | def children(self):
"""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]
"""
return [ self.body() ] | [
"def",
"children",
"(",
"self",
")",
":",
"return",
"[",
"self",
".",
"body",
"(",
")",
"]"
] | [
2014,
4
] | [
2023,
30
] | python | en | ['en', 'en', 'en'] | True |
ArithSortRef.is_real | (self) | Return `True` if `self` is of the sort Real.
>>> x = Real('x')
>>> x.is_real()
True
>>> (x + 1).is_real()
True
>>> x = Int('x')
>>> x.is_real()
False
| Return `True` if `self` is of the sort Real. | def is_real(self):
"""Return `True` if `self` is of the sort Real.
>>> x = Real('x')
>>> x.is_real()
True
>>> (x + 1).is_real()
True
>>> x = Int('x')
>>> x.is_real()
False
"""
return self.kind() == Z3_REAL_SORT | [
"def",
"is_real",
"(",
"self",
")",
":",
"return",
"self",
".",
"kind",
"(",
")",
"==",
"Z3_REAL_SORT"
] | [
2138,
4
] | [
2150,
42
] | python | en | ['en', 'en', 'en'] | True |
ArithSortRef.is_int | (self) | Return `True` if `self` is of the sort Integer.
>>> x = Int('x')
>>> x.is_int()
True
>>> (x + 1).is_int()
True
>>> x = Real('x')
>>> x.is_int()
False
| Return `True` if `self` is of the sort Integer. | def is_int(self):
"""Return `True` if `self` is of the sort Integer.
>>> x = Int('x')
>>> x.is_int()
True
>>> (x + 1).is_int()
True
>>> x = Real('x')
>>> x.is_int()
False
"""
return self.kind() == Z3_INT_SORT | [
"def",
"is_int",
"(",
"self",
")",
":",
"return",
"self",
".",
"kind",
"(",
")",
"==",
"Z3_INT_SORT"
] | [
2152,
4
] | [
2164,
41
] | python | en | ['en', 'nl', 'en'] | True |
ArithSortRef.subsort | (self, other) | Return `True` if `self` is a subsort of `other`. | Return `True` if `self` is a subsort of `other`. | def subsort(self, other):
"""Return `True` if `self` is a subsort of `other`."""
return self.is_int() and is_arith_sort(other) and other.is_real() | [
"def",
"subsort",
"(",
"self",
",",
"other",
")",
":",
"return",
"self",
".",
"is_int",
"(",
")",
"and",
"is_arith_sort",
"(",
"other",
")",
"and",
"other",
".",
"is_real",
"(",
")"
] | [
2166,
4
] | [
2168,
73
] | python | en | ['en', 'en', 'en'] | True |
ArithSortRef.cast | (self, val) | Try to cast `val` as an Integer or Real.
>>> IntSort().cast(10)
10
>>> is_int(IntSort().cast(10))
True
>>> is_int(10)
False
>>> RealSort().cast(10)
10
>>> is_real(RealSort().cast(10))
True
| Try to cast `val` as an Integer or Real. | def cast(self, val):
"""Try to cast `val` as an Integer or Real.
>>> IntSort().cast(10)
10
>>> is_int(IntSort().cast(10))
True
>>> is_int(10)
False
>>> RealSort().cast(10)
10
>>> is_real(RealSort().cast(10))
True
"""
... | [
"def",
"cast",
"(",
"self",
",",
"val",
")",
":",
"if",
"is_expr",
"(",
"val",
")",
":",
"if",
"z3_debug",
"(",
")",
":",
"_z3_assert",
"(",
"self",
".",
"ctx",
"==",
"val",
".",
"ctx",
",",
"\"Context mismatch\"",
")",
"val_s",
"=",
"val",
".",
... | [
2170,
4
] | [
2204,
126
] | python | en | ['en', 'en', 'en'] | True |
ArithRef.sort | (self) | Return the sort (type) of the arithmetical expression `self`.
>>> Int('x').sort()
Int
>>> (Real('x') + 1).sort()
Real
| Return the sort (type) of the arithmetical expression `self`. | def sort(self):
"""Return the sort (type) of the arithmetical expression `self`.
>>> Int('x').sort()
Int
>>> (Real('x') + 1).sort()
Real
"""
return ArithSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx) | [
"def",
"sort",
"(",
"self",
")",
":",
"return",
"ArithSortRef",
"(",
"Z3_get_sort",
"(",
"self",
".",
"ctx_ref",
"(",
")",
",",
"self",
".",
"as_ast",
"(",
")",
")",
",",
"self",
".",
"ctx",
")"
] | [
2224,
4
] | [
2232,
81
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.