【发布时间】:2021-12-26 04:07:51
【问题描述】:
我可以用一个列表来表示连词。例如,让
x_1 = Int('x_1')
the_list = [Not(500 <= x_1), Not(x_1 <= 500), Not(x_1 <= 300)]
phi_1 = And(the_list)
(即phi_1 = And([Not(500 <= x_1), Not(x_1 <= 500), Not(x_1 <= 300)]))
然后,我可以执行the_list[0],得到Not(500 <= x_1)。
但是,假设我得到了没有列表的连词:
phi_2 = And(Not(500 <= x_1), Not(x_1 <= 500), Not(x_1 <= 300))
如何像访问列表一样访问And 的元素?
【问题讨论】:
-
格式化注释:对内联使用单记号,对单独的代码体使用三记号。用名称
python标记后者会给你着色。 (尝试编辑您的问题,您会看到我应用的标签。)
标签: python list z3 z3py first-order-logic