fix: a star in docs
This commit is contained in:
2
logic/test_cases/q1/CONFIG
Normal file
2
logic/test_cases/q1/CONFIG
Normal file
@ -0,0 +1,2 @@
|
||||
class: "PassAllTestsQuestion"
|
||||
max_points: "2"
|
3
logic/test_cases/q1/correctSentence1.solution
Normal file
3
logic/test_cases/q1/correctSentence1.solution
Normal 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))"
|
9
logic/test_cases/q1/correctSentence1.test
Normal file
9
logic/test_cases/q1/correctSentence1.test
Normal 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()"
|
||||
|
3
logic/test_cases/q1/correctSentence2.solution
Normal file
3
logic/test_cases/q1/correctSentence2.solution
Normal 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))"
|
9
logic/test_cases/q1/correctSentence2.test
Normal file
9
logic/test_cases/q1/correctSentence2.test
Normal 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()"
|
||||
|
3
logic/test_cases/q1/correctSentence3.solution
Normal file
3
logic/test_cases/q1/correctSentence3.solution
Normal 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)"
|
9
logic/test_cases/q1/correctSentence3.test
Normal file
9
logic/test_cases/q1/correctSentence3.test
Normal 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()"
|
||||
|
3
logic/test_cases/q1/entails.solution
Normal file
3
logic/test_cases/q1/entails.solution
Normal 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"
|
22
logic/test_cases/q1/entails.test
Normal file
22
logic/test_cases/q1/entails.test
Normal 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"
|
||||
|
||||
|
3
logic/test_cases/q1/entailsLong.solution
Normal file
3
logic/test_cases/q1/entailsLong.solution
Normal file
File diff suppressed because one or more lines are too long
20
logic/test_cases/q1/entailsLong.test
Normal file
20
logic/test_cases/q1/entailsLong.test
Normal file
File diff suppressed because one or more lines are too long
3
logic/test_cases/q1/findModelSentence1.solution
Normal file
3
logic/test_cases/q1/findModelSentence1.solution
Normal 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)]"
|
10
logic/test_cases/q1/findModelSentence1.test
Normal file
10
logic/test_cases/q1/findModelSentence1.test
Normal 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()))"
|
||||
|
||||
|
3
logic/test_cases/q1/findModelSentence2.solution
Normal file
3
logic/test_cases/q1/findModelSentence2.solution
Normal 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"
|
9
logic/test_cases/q1/findModelSentence2.test
Normal file
9
logic/test_cases/q1/findModelSentence2.test
Normal 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()))"
|
||||
|
3
logic/test_cases/q1/findModelSentence3.solution
Normal file
3
logic/test_cases/q1/findModelSentence3.solution
Normal 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)]"
|
9
logic/test_cases/q1/findModelSentence3.test
Normal file
9
logic/test_cases/q1/findModelSentence3.test
Normal 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()))"
|
||||
|
3
logic/test_cases/q1/findModelUnderstandingCheck.solution
Normal file
3
logic/test_cases/q1/findModelUnderstandingCheck.solution
Normal 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)]"
|
10
logic/test_cases/q1/findModelUnderstandingCheck.test
Normal file
10
logic/test_cases/q1/findModelUnderstandingCheck.test
Normal 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())"
|
||||
|
||||
|
3
logic/test_cases/q1/plTrueInverse.solution
Normal file
3
logic/test_cases/q1/plTrueInverse.solution
Normal 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. "
|
30
logic/test_cases/q1/plTrueInverse.test
Normal file
30
logic/test_cases/q1/plTrueInverse.test
Normal 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"
|
||||
|
||||
|
Reference in New Issue
Block a user