def test():
    language = ["p", "q", "r", "s"]
    s0 = worldgen(language)
    s1 = updateFormula(s0, "r")
    s2 = updateLaw(s1, "(r)>((p)|(q))")
    situation = {"p": True}
    # pprint("Result 1:")
    # pprint(Forceable(situation, [s2[5][meta][name], s2[4][meta][name], s2[6][meta][name], s2[7][meta][name]], s2))
    # pprint("Result 2:")
    # pprint(Forceable(situation, ["w_5", "w_4", "w_6", "w_7"], s2))
    w0 = {meta: {name: "w0", FS: True, US: True}, values: {"p": True, "q": False, "r": False, "s": True}}
    w1 = {meta: {name: "w1", FS: True, US: True}, values: {"p": False, "q": True, "r": False, "s": False}}
    w2 = {meta: {name: "w2", FS: True, US: True}, values: {"p": False, "q": False, "r": True, "s": True}}
    cogstate = [w0, w1, w2]
    pprint(getAllBases(w0, cogstate))
from pprint import pprint
from genworlds import worldgen
from updates import updateFormula, updateLaw
from counterfactual import ifItHadBeenTheCase
from subprocess import call
from texoutput import *

# Start the tex file
out = texheader("Hansson's Hamburger puzzle", "The Factual Counterfactual Counter")

# Need propositional letters for "seeing a man walking with a hamburger",
# "snackbar A is open" and "snackbar B is open".
alphabet = ["p", "q", "r"]

# Now we generate the universe
W = worldgen(alphabet)
out += texify(W)

# Update with the fact that we see the man
W = updateFormula(W, "r")
out += texify(W)

# Update with the law that if we see a man with a hamburger, he must have
# got it at one of the snackbars
W = updateLaw(W, "(r)>((p)|(q))")
out += texify(W)

# Update since we see A is open
W = updateFormula(W, "p")
out += texify(W)