kdrag.contrib.expr
Functions
|
Classes
|
|
|
|
|
|
|
|
|
|
|
|
|
- class kdrag.contrib.expr.AstNode(kind, children, hash)
Bases:
NamedTuple- Parameters:
kind (Kind)
children (tuple)
hash (int)
- children: tuple
Alias for field number 1
- count(value, /)
Return number of occurrences of value.
- hash: int
Alias for field number 2
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class kdrag.contrib.expr.AstRef(ctx: 'Context', ast: kdrag.contrib.expr.AstNode)
Bases:
object- eq(other)
- get_id()
- class kdrag.contrib.expr.Context(table: dict = <factory>)
Bases:
object>>> ctx = Context() >>> s1 = ctx.DeclareSort("S") >>> s2 = ctx.DeclareSort("S") >>> s1.eq(s2) True >>> f = ctx.Function("f", s1, ctx.BoolSort()) >>> x = ctx.Const("x", s1) >>> f(x) == ctx.BoolVal(True) (= (f x) true) >>> ctx.FreshConst(s1, prefix="foo") foo!0
- Parameters:
table (dict)
- Function(name: str, *sig: SortRef) FuncDeclRef
- Parameters:
name (str)
sig (SortRef)
- Return type:
- counter = 0
- table: dict
- class kdrag.contrib.expr.ExprRef(ctx: Context, ast: AstNode)
Bases:
AstRef- children()
- decl()
- eq(other)
- get_id()
- class kdrag.contrib.expr.FuncDeclRef(ctx: Context, ast: AstNode)
Bases:
AstRef- eq(other)
- get_id()
- name()
- class kdrag.contrib.expr.Kind(*values)
Bases:
Enum- APP = 2
- DECL = 1
- SORT = 0
- VAR = 3
- classmethod __contains__(value)
Return True if value is in cls.
value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)
- classmethod __getitem__(name)
Return the member matching name.
- classmethod __iter__()
Return members in definition order.
- classmethod __len__()
Return the number of members (no aliases)
- kdrag.contrib.expr.main_ctx()