fix: a star in docs

This commit is contained in:
zsq259
2024-06-25 15:51:24 +08:00
parent 1b3eba4657
commit 4c3e84486d
173 changed files with 10755 additions and 6 deletions

View File

@ -0,0 +1,2 @@
class: "PassAllTestsQuestion"
max_points: "2"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/correctSentence1.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "((A | B) & (~A <=> (~B | C)) & (~A | ~B | C))"

View File

@ -0,0 +1,9 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.sentence1()"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/correctSentence2.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "((C <=> (B | D)) & (A >> (~B & ~D)) & (~(B & ~C) >> A) & (~D >> C))"

View File

@ -0,0 +1,9 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.sentence2()"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/correctSentence3.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "((PacmanAlive_1 <=> ((PacmanAlive_0 & ~PacmanKilled_0) | (~PacmanAlive_0 & PacmanBorn_0))) & ~(PacmanAlive_0 & PacmanBorn_0) & PacmanBorn_0)"

View File

@ -0,0 +1,9 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.sentence3()"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/entails.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "True True False True True False"

View File

@ -0,0 +1,22 @@
class: "LogicTest"
success: "PASS"
failure: "NO PASS"
# Python statements initializing variables for the test below.
preamble: """
import logic
A = logic.PropSymbolExpr('A');
B = logic.PropSymbolExpr('B');
C = logic.PropSymbolExpr('C');
D = logic.PropSymbolExpr('D');
ans = [logicPlan.entails(A & B, A), logicPlan.entails(A & B, A | B), logicPlan.entails(A | B, A), logicPlan.entails(~(A & B & C & D), ~A | ~B | ~C | ~D), logicPlan.entails(A >> B, B | ~A), logicPlan.entails(A >> B, A)]
"""
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "ans"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/findModelSentence1.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "[(A, False), (B, True), (C, True)]"

View File

@ -0,0 +1,10 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.modelToString(logicPlan.findModel(logicPlan.sentence1()))"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/findModelSentence2.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "False"

View File

@ -0,0 +1,9 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.modelToString(logicPlan.findModel(logicPlan.sentence2()))"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/findModelSentence3.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "[(PacmanAlive_0, False), (PacmanAlive_1, True), (PacmanBorn_0, True), (PacmanKilled_0, False)]"

View File

@ -0,0 +1,9 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.modelToString(logicPlan.findModel(logicPlan.sentence3()))"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/findModelUnderstandingCheck.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "[(a, True)]"

View File

@ -0,0 +1,10 @@
class: "EvalTest"
success: "PASS"
failure: "NO PASS"
# A python expression to be evaluated. This expression must return the
# same result for the student and instructor's code.
test: "logicPlan.modelToString(logicPlan.findModelUnderstandingCheck())"

View File

@ -0,0 +1,3 @@
# This is the solution file for test_cases/q1/plTrueInverse.test.
# The result of evaluating the test must equal the below when cast to a string.
result: "[(A, True)] does not satisfy ~A : True. [(A, True)] does not satisfy A : False. [(A, False), (B, True)] does not satisfy ~(A >> B) : True. [(A, False), (B, True)] does not satisfy (A >> B) : False. [(A, False), (B, True), (C, True)] does not satisfy ~((A | B) & (~A <=> (~B | C)) & (~A | ~B | C)) : True. [(A, False), (B, True), (C, True)] does not satisfy ((A | B) & (~A <=> (~B | C)) & (~A | ~B | C)) : False. [(PacmanAlive_0, False), (PacmanAlive_1, True), (PacmanBorn_0, True), (PacmanKilled_0, False)] does not satisfy ~((PacmanAlive_1 <=> ((PacmanAlive_0 & ~PacmanKilled_0) | (~PacmanAlive_0 & PacmanBorn_0))) & ~(PacmanAlive_0 & PacmanBorn_0) & PacmanBorn_0) : True. [(PacmanAlive_0, False), (PacmanAlive_1, True), (PacmanBorn_0, True), (PacmanKilled_0, False)] does not satisfy ((PacmanAlive_1 <=> ((PacmanAlive_0 & ~PacmanKilled_0) | (~PacmanAlive_0 & PacmanBorn_0))) & ~(PacmanAlive_0 & PacmanBorn_0) & PacmanBorn_0) : False. "

View File

@ -0,0 +1,30 @@
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"