module CFG1Sem where -- Semantic interpretation of a CFG derivation -- In conventional notation: D_e = {John, Mary} data Entity = John | Mary deriving (Eq, Show) john = John mary = Mary like o s = (o == John && s == Mary ) || (o == Mary && s == John ) -- A different way of writing it: by cases like' Mary John = True like' John Mary = True like' _ _ = False r2 tv np = tv np r1 np vp = vp np -- sentence has the same form as in CFG1.hs, -- but a different value (interpretation) sentence = r1 john (r2 like mary)