Files
PPCA-AIPacMan-2024/logic/test_cases/q1/plTrueInverse.test
2024-06-25 15:51:24 +08:00

31 lines
807 B
Plaintext

class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# Python statements initializing variables for the test below.
preamble: """
import logic
from logicPlan import plTrueInverse, findModel, sentence1, sentence3, modelToString
A = logic.PropSymbolExpr('A')
B = logic.PropSymbolExpr('B')
results = {}
for expr in [A, A >> B, sentence1(), sentence3()]:
model = findModel(expr)
results[~expr] = plTrueInverse(model, ~expr), model
results[expr] = plTrueInverse(model, expr), model
ans = ''
for key, value in results.items():
ans += modelToString(value[1]) + ' does not satisfy ' + repr(key) + ' : ' + str(value[0]) + '. '
"""
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "ans"