コード例 #1
0
def test_satisfiers_does_not_create_assignment():
    satisfiers(Var("j"), test_model, "some_nonexistent_variable")
    assert "some_nonexistent_variable" not in test_model.assignments
コード例 #2
0
def test_satisfiers_does_not_overwrite_assignment():
    model = WorldModel({Mary}, {"j": John})
    satisfiers(Var("j"), model, "j")
    assert model.assignments["j"] == John
コード例 #3
0
def test_satisfiers_alien_set():
    sset = satisfiers(Call(Var("Alien"), Var("x")), test_model, "x")
    assert sset == set()
コード例 #4
0
def test_satisfiers_human_set():
    sset = satisfiers(Call(Var("Human"), Var("x")), test_model, "x")
    assert sset == {John, Mary}
コード例 #5
0
def test_satisfiers_bad_set():
    sset = satisfiers(Call(Var("Bad"), Var("x")), test_model, "x")
    assert sset == {Mary}
コード例 #6
0
def test_satisfiers_good_set():
    sset = satisfiers(Call(Var("Good"), Var("x")), test_model, "x")
    assert sset == {John}