当前位置: 首页>>代码示例>>Python>>正文


Python z3.BoolVal方法代码示例

本文整理汇总了Python中z3.BoolVal方法的典型用法代码示例。如果您正苦于以下问题:Python z3.BoolVal方法的具体用法?Python z3.BoolVal怎么用?Python z3.BoolVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在z3的用法示例。


在下文中一共展示了z3.BoolVal方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: query

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def query(self):  # May want to change this....
        global __property_to_function__

        self._populate_properties()  # Apply to specific instance of variables
        # if self.__query__ is None:
        conj = []
        for p in self._properties:  # combines Test and Var-specific properties
            # p.__z3__ = uninterpreted function
            # p.__var__ = instantiated z3 BoolVal
            # Add the uf, and interpret the uf as always ==ing the instantiated BoolVal
            # conj += [p.__z3__, p.__z3__ == p.__var__]
            conj += [p.__z3__]

            # Add property to property to function map
            __property_to_function__[p.__z3__] = p.property.function

        return conj
        # self.__query__ = query
        # return self.__query__ 
开发者ID:emjun,项目名称:tea-lang,代码行数:21,代码来源:solver.py

示例2: __init__

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def __init__(self, z3ctx, z3solver):
        self.ctx = z3ctx
        self.solver = z3solver
        self.int_zero = z3.IntVal(0, self.ctx)
        self.int_one  = z3.IntVal(1, self.ctx)
        self.true = z3.BoolVal(True, self.ctx)
        self.false = z3.BoolVal(False, self.ctx)
        assert to_bool(self.true) is True
        assert to_bool(self.false) is False
        assert to_bool(self.int_zero) is None 
开发者ID:CozySynthesizer,项目名称:cozy,代码行数:12,代码来源:solver.py

示例3: distinct

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def distinct(self, t, *values):
        if len(values) <= 1:
            return z3.BoolVal(True, self.ctx)
        return self.all(
            self.distinct(t, values[1:]),
            *[self.neg(self.eq(t, values[0], v1, {})) for v1 in values[1:]]) 
开发者ID:CozySynthesizer,项目名称:cozy,代码行数:8,代码来源:solver.py

示例4: visit_EBool

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def visit_EBool(self, b, env):
        return z3.BoolVal(b.val, self.ctx) 
开发者ID:CozySynthesizer,项目名称:cozy,代码行数:4,代码来源:solver.py

示例5: visit_bool

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def visit_bool(self, e, env):
        return z3.BoolVal(e, self.ctx) 
开发者ID:CozySynthesizer,项目名称:cozy,代码行数:4,代码来源:solver.py

示例6: BoolV

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def BoolV(self, ast): #pylint:disable=unused-argument
        # TODO: Here the checks performed by the high level API are mandatory before calling the low level API
        #       So we can keep the high level API call here
        return z3.BoolVal(ast.args[0], ctx=self._context) 
开发者ID:angr,项目名称:claripy,代码行数:6,代码来源:backend_z3.py

示例7: _is_false

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def _is_false(self, e, extra_constraints=(), solver=None, model_callback=None):
        return z3.simplify(e).eq(z3.BoolVal(False, ctx=self._context)) 
开发者ID:angr,项目名称:claripy,代码行数:4,代码来源:backend_z3.py

示例8: _is_true

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def _is_true(self, e, extra_constraints=(), solver=None, model_callback=None):
        return z3.simplify(e).eq(z3.BoolVal(True, ctx=self._context)) 
开发者ID:angr,项目名称:claripy,代码行数:4,代码来源:backend_z3.py

示例9: walk_bool_constant

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def walk_bool_constant(self, formula, **kwargs):
        _t = z3.BoolVal(formula.constant_value(), ctx=self.ctx)
        z3term = _t.as_ast()
        z3.Z3_inc_ref(self.ctx.ref(), z3term)
        return z3term 
开发者ID:pysmt,项目名称:pysmt,代码行数:7,代码来源:z3.py

示例10: simplify_non_const_hashes

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def simplify_non_const_hashes(expr, sha_ids):
    while True:
        expr = z3.simplify(expr, expand_select_store=True)
        sha_subst = get_sha_subst_non_recursive(expr, sha_ids)
        if not sha_subst:
            break
        expr = z3.substitute(expr, [(s, z3.BoolVal(False)) for s in sha_subst])
    return expr 
开发者ID:nescio007,项目名称:teether,代码行数:10,代码来源:z3_extra_util.py

示例11: generate_reaching_constraints

# 需要导入模块: import z3 [as 别名]
# 或者: from z3 import BoolVal [as 别名]
def generate_reaching_constraints(self):
        visitor = ConditionVisitor(self.view)

        for (
            (start, end),
            reaching_condition,
        ) in self.reaching_conditions.items():
            or_exprs = []

            for condition in reaching_condition:
                and_exprs = []

                for edge in condition:
                    if edge.type == BranchType.UnconditionalBranch:
                        continue

                    if edge.type == BranchType.TrueBranch:
                        condition = edge.source[-1].condition
                        if (
                            condition.operation
                            == MediumLevelILOperation.MLIL_VAR
                        ):
                            condition = self.function.get_ssa_var_definition(
                                edge.source[-1].ssa_form.condition.src
                            ).src
                        and_exprs.append(visitor.simplify(condition))

                    elif edge.type == BranchType.FalseBranch:
                        condition = edge.source[-1].condition
                        if (
                            condition.operation
                            == MediumLevelILOperation.MLIL_VAR
                        ):
                            condition = self.function.get_ssa_var_definition(
                                edge.source[-1].ssa_form.condition.src
                            ).src
                        and_exprs += Tactic("ctx-solver-simplify")(
                            Not(visitor.simplify(condition))
                        )[0]

                if and_exprs != []:
                    or_exprs.append(And(*and_exprs))

            if or_exprs:
                or_exprs = Tactic("ctx-solver-simplify")(Or(*or_exprs))[0]
                reaching_constraint = (
                    And(*or_exprs)
                    if len(or_exprs) > 1
                    else or_exprs[0]
                    if len(or_exprs)
                    else BoolVal(True)
                )
                self._reaching_constraints[(start, end)] = reaching_constraint 
开发者ID:joshwatson,项目名称:f-ing-around-with-binaryninja,代码行数:55,代码来源:mlil_ast.py


注:本文中的z3.BoolVal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。