Explain parenthesis rules

This commit is contained in:
Manuel Thalmann 2024-06-17 00:23:26 +02:00
parent 7b20e2a047
commit bfb920ca74

View file

@ -30,6 +30,11 @@ pretty x = case x of
-------------------- --------------------
-- Exercise 2 -- Exercise 2
-------------------- --------------------
-- Rule 1: Function bodies in (L{param}.{body}) span as much as possible:
-- Lx.A B C == Lx.(A B C)
-- Rule 2: Function invocations (application) are left bound
-- A B C == ((A B) C)
-- ((Lx.(x z)) (Ly.(x y))) -- ((Lx.(x z)) (Ly.(x y)))
-- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x))))) -- ((Lx.(x z)) (Ly.(w (Lw.(((w y) z) x)))))
-- (Lx.((x y) (Lx.(y x)))) -- (Lx.((x y) (Lx.(y x))))