module _ where open import bool open import eq {- 0. set up agda. Visit the installation section of the agda website: https://agda.readthedocs.io/en/latest/getting-started/installation.html Also, get a copy of the text book: https://dl.acm.org/citation.cfm?id=2841316 The book points to the IAL agda library but it points to an old version. You want the latest, which you can get here: https://github.com/cedille/ial If that causes you trouble, there is a virtual machine that has everything set up that's linked from the course webpage. To solve the rest of these exercises, I recommend you create a file in the same directory as the IAL library you've checked out (icky, I know). I will grade your homework by putting it there to try it out. It is also possible to use a `.agda-lib` file but don't worry if you don't get that sorted out. Keystroke quick reference (but see the text!) c-c c-l: load the buffer & typecheck c-c c-,: tell me what's in the hole c-c c-c: case split on the variable I just wrote in the hole c-c c-a: do an easy proof c-c c-r: replace the hole with its current contents (ie finish this case/proof) -} {- 1. Do exercises 1.1 and 1.2 (page 14) in the text. Just write what they evaluate to here. You don't need to open bool.agda as this file already imports it, but you're welcome to. NB: opening bool.agda will be useful to understand `imp` in the optional part of problem 3. -} {- 2. Do exercise 2.3 (page 41) in the text -} {- 3. prove the following identities: -} distrbl : ∀ b1 b2 b3 -> b1 || (b2 && b3) ≡ (b1 || b2) && (b1 || b3) distrbl b1 b2 b3 = ? ||-comm : ∀ b1 b2 -> b1 || b2 ≡ b2 || b1 ||-comm b1 b2 = ? demorgan2 : ∀ b1 b2 -> ~ (b1 || b2) ≡ (~ b1) && (~ b2) demorgan2 b1 b2 = ? {- I accidentally left the proofs of these identites in the file. Feel free to give them a try but they are optional. --robby curry : ∀ (b1 b2 b3 : 𝔹) -> b1 imp (b2 imp b3) ≡ (b1 && b2) imp b3 curry b1 b2 b3 = ? demorgan : ∀ b1 b2 -> ~ (b1 && b2) ≡ ~ b1 || ~ b2 demorgan b1 b2 = ? imp-not-or : ∀ b1 b2 -> ~ b1 || b2 ≡ b1 imp b2 imp-not-or b1 b2 = ? -}