@@ -57,8 +57,7 @@ def test():
57
57
)
58
58
59
59
p2_and_p2a .upward ()
60
- assert all ([p2_and_p2a .state (groundings = g )
61
- is GT [g ] for g in GT ]), "FAILED 😔"
60
+ assert all ([p2_and_p2a .state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
62
61
assert len (p2_and_p2a .state ()) == len (GT ), "FAILED 😔"
63
62
64
63
model = Model ()
@@ -92,14 +91,10 @@ def test():
92
91
93
92
model .add_knowledge (p2_and_p2b )
94
93
95
- GT = dict ([
96
- (('s1' , 's7' ), TRUE ),
97
- (('s3' , 's7' ), FALSE ),
98
- (('s4' , 's7' ), FALSE )])
94
+ GT = dict ([(("s1" , "s7" ), TRUE ), (("s3" , "s7" ), FALSE ), (("s4" , "s7" ), FALSE )])
99
95
100
96
model [p2_and_p2b ].upward ()
101
- assert all ([model [p2_and_p2b ].state (groundings = g ) is GT [g ]
102
- for g in GT ]), "FAILED 😔"
97
+ assert all ([model [p2_and_p2b ].state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
103
98
assert len (model [p2_and_p2b ].state ()) == len (GT ), "FAILED 😔"
104
99
# New test case
105
100
model = Model ()
@@ -130,12 +125,9 @@ def test():
130
125
p2_and_p2c = And (p2 (x , y ), p2a (x , y , bind = {x : ["s1" , "s2" ], y : "s6" }))
131
126
model .add_knowledge (p2_and_p2c )
132
127
133
- GT = dict ([
134
- (('s1' , 's6' ), FALSE ),
135
- (('s2' , 's6' ), FALSE )])
128
+ GT = dict ([(("s1" , "s6" ), FALSE ), (("s2" , "s6" ), FALSE )])
136
129
model [p2_and_p2c ].upward ()
137
- assert all ([model [p2_and_p2c ].state (groundings = g ) is GT [g ]
138
- for g in GT ]), "FAILED 😔"
130
+ assert all ([model [p2_and_p2c ].state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
139
131
assert len (model [p2_and_p2c ].state ()) == len (GT ), "FAILED 😔"
140
132
# 1 variable vs 2 variables bound
141
133
model = Model ()
@@ -157,13 +149,9 @@ def test():
157
149
p1_and_p2 = And (p1 (x , bind = {x : ["s1" , "s2" ]}), p2 (x , y ))
158
150
159
151
model .add_knowledge (p1_and_p2 )
160
- GT = dict ([
161
- (('s1' , 's6' ), TRUE ),
162
- (('s2' , 's6' ), FALSE ),
163
- (('s1' , 's7' ), TRUE )])
152
+ GT = dict ([(("s1" , "s6" ), TRUE ), (("s2" , "s6" ), FALSE ), (("s1" , "s7" ), TRUE )])
164
153
model [p1_and_p2 ].upward ()
165
- assert all ([model [p1_and_p2 ].state (groundings = g ) is GT [g ]
166
- for g in GT ]), "FAILED 😔"
154
+ assert all ([model [p1_and_p2 ].state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
167
155
assert len (model [p1_and_p2 ].state ()) == len (GT ), "FAILED 😔"
168
156
# New test case
169
157
model = Model ()
@@ -194,10 +182,8 @@ def test():
194
182
p2_and_p3 = And (p2 (x , y ), p3 (x , z , y , bind = {z : "s4" }))
195
183
model .add_knowledge (p2_and_p3 )
196
184
model [p2_and_p3 ].upward ()
197
- GT = dict ([
198
- (('s1' , 's7' , 's4' ), TRUE )])
199
- assert all ([model [p2_and_p3 ].state (groundings = g ) is GT [g ]
200
- for g in GT ]), "FAILED 😔"
185
+ GT = dict ([(("s1" , "s7" , "s4" ), TRUE )])
186
+ assert all ([model [p2_and_p3 ].state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
201
187
assert len (model [p2_and_p3 ].state ()) == len (GT ), "FAILED 😔"
202
188
# New test case
203
189
model = Model ()
@@ -221,10 +207,8 @@ def test():
221
207
model .add_knowledge (p2_and_p2r )
222
208
223
209
p2_and_p2r .upward ()
224
- GT = dict ([
225
- (('s1' , 's7' ), FALSE )])
226
- assert all ([model [p2_and_p2r ].state (groundings = g ) is GT [g ]
227
- for g in GT ]), "FAILED 😔"
210
+ GT = dict ([(("s1" , "s7" ), FALSE )])
211
+ assert all ([model [p2_and_p2r ].state (groundings = g ) is GT [g ] for g in GT ]), "FAILED 😔"
228
212
assert len (model [p2_and_p2r ].state ()) == len (GT ), "FAILED 😔"
229
213
return
230
214
0 commit comments