Z3
Loading...
Searching...
No Matches
ParserContext Class Reference

Public Member Functions

 __init__ (self, ctx=None)
 __del__ (self)
 add_sort (self, sort)
 add_decl (self, decl)
 from_string (self, s)

Data Fields

 ctx = _get_ctx(ctx)
 pctx = Z3_mk_parser_context(self.ctx.ref())

Detailed Description

Definition at line 10027 of file z3py.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
ctx = None )

Definition at line 10028 of file z3py.py.

10028 def __init__(self, ctx= None):
10029 self.ctx = _get_ctx(ctx)
10030 self.pctx = Z3_mk_parser_context(self.ctx.ref())
10031 Z3_parser_context_inc_ref(self.ctx.ref(), self.pctx)
10032
void Z3_API Z3_parser_context_inc_ref(Z3_context c, Z3_parser_context pc)
Increment the reference counter of the given Z3_parser_context object.
Z3_parser_context Z3_API Z3_mk_parser_context(Z3_context c)
Create a parser context.

◆ __del__()

__del__ ( self)

Definition at line 10033 of file z3py.py.

10033 def __del__(self):
10034 if self.ctx.ref() is not None and self.pctx is not None and Z3_parser_context_dec_ref is not None:
10035 Z3_parser_context_dec_ref(self.ctx.ref(), self.pctx)
10036 self.pctx = None
10037
void Z3_API Z3_parser_context_dec_ref(Z3_context c, Z3_parser_context pc)
Decrement the reference counter of the given Z3_parser_context object.

Member Function Documentation

◆ add_decl()

add_decl ( self,
decl )

Definition at line 10041 of file z3py.py.

10041 def add_decl(self, decl):
10042 Z3_parser_context_add_decl(self.ctx.ref(), self.pctx, decl.as_ast())
10043
void Z3_API Z3_parser_context_add_decl(Z3_context c, Z3_parser_context pc, Z3_func_decl f)
Add a function declaration.

◆ add_sort()

add_sort ( self,
sort )

Definition at line 10038 of file z3py.py.

10038 def add_sort(self, sort):
10039 Z3_parser_context_add_sort(self.ctx.ref(), self.pctx, sort.as_ast())
10040
void Z3_API Z3_parser_context_add_sort(Z3_context c, Z3_parser_context pc, Z3_sort s)
Add a sort declaration.

◆ from_string()

from_string ( self,
s )

Definition at line 10044 of file z3py.py.

10044 def from_string(self, s):
10045 return AstVector(Z3_parser_context_from_string(self.ctx.ref(), self.pctx, s), self.ctx)
10046
Z3_ast_vector Z3_API Z3_parser_context_from_string(Z3_context c, Z3_parser_context pc, Z3_string s)
Parse a string of SMTLIB2 commands. Return assertions.

Field Documentation

◆ ctx

ctx = _get_ctx(ctx)

Definition at line 10029 of file z3py.py.

◆ pctx

pctx = Z3_mk_parser_context(self.ctx.ref())

Definition at line 10030 of file z3py.py.