python - 如何为 Z3 中的变量分配新值?
问题描述
我x
在 SMT-Z3-Python-Solver 中有一个变量,并且已经为其分配了 value 23
。
如何重新分配x
to eg的值42
?
我正在寻找类似的功能s.reassign(x == 42)
。
# coding=utf-8
from z3 import *
x = Int('x')
s = Solver()
s.add(x == 36)
s.reassign(x == 42) # <- PseudoCode
if s.check() == sat:
print s.model()[x]
else:
print "UNSAT"
解决方案
推荐阅读
- asp.net - 谷歌recaptcha第二次不起作用
- amazon-web-services - 将 DynamoDB 表恢复到其他 AWS 账户的时间点
- android - 使用 top 测量 Android 应用程序中的 CPU 负载
- ffmpeg - 如何使用 ffmpeg 删除所有元数据?包括 DURATION 和 ENCODER
- sql - 执行计算,其中计算的数据在两个表之外
- kubernetes - 从“kubectl get pod”和“kubectl describe pod”命令获取不同的 Pod 状态
- c# - 无法使用 C# Net Core 5.0 连接到本地 SQL 服务器,远程工作
- svelte - 使用 Svelte 进行表格分页
- capl - 独木舟使用 2 LDF
- c - 如何使用 ARM NEON 内在函数将 u8 掩码转换为 u32 掩码?