Skip to content

Commit 8fc2bc6

Browse files
authored
update Assignment3 (plfa#1062)
1 parent c6652a7 commit 8fc2bc6

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

courses/TSPL/2024/Assignment3.lagda.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ module Lists where
7474
hiding (downFrom; Tree; leaf; node; merge)
7575
```
7676

77-
#### Exercise `reverse-++-distrib` (practice) (recommended)
77+
#### Exercise `reverse-++-distrib` (recommended)
7878

7979
Show that the reverse of one list appended to another is the
8080
reverse of the second appended to the reverse of the first:
8181

8282
reverse (xs ++ ys) ≡ reverse ys ++ reverse xs
8383

8484

85-
#### Exercise `reverse-involutive` (practice) (recommended)
85+
#### Exercise `reverse-involutive` (recommended)
8686

8787
A function is an _involution_ if when applied twice it acts
8888
as the identity function. Show that reverse is an involution:
@@ -129,7 +129,7 @@ Define a suitable map operator over trees:
129129
-- Your code goes here
130130
```
131131

132-
#### Exercise `product` (practice) (was recommended)
132+
#### Exercise `product` (recommended)
133133

134134
Use fold to define a function to find the product of a list of numbers.
135135
For example:
@@ -140,7 +140,7 @@ For example:
140140
-- Your code goes here
141141
```
142142

143-
#### Exercise `foldr-++` (practice) (was recommended)
143+
#### Exercise `foldr-++` (recommended)
144144

145145
Show that fold and append are related as follows:
146146

@@ -196,7 +196,7 @@ Demonstrate an analogue of `map-is-foldr` for the type of trees.
196196
-- Your code goes here
197197
```
198198

199-
#### Exercise `sum-downFrom` (practice) (was stretch)
199+
#### Exercise `sum-downFrom` (stretch)
200200

201201
Define a function that counts down as follows:
202202
```agda
@@ -241,7 +241,7 @@ Show that if `_⊗_` and `e` form a monoid, then `foldr _⊗_ e` and
241241
```
242242

243243

244-
#### Exercise `Any-++-⇔` (practice) (was recommended)
244+
#### Exercise `Any-++-⇔` (recommended)
245245

246246
Prove a result similar to `All-++-⇔`, but with `Any` in place of `All`, and a suitable
247247
replacement for `_×_`. As a consequence, demonstrate an equivalence relating
@@ -251,15 +251,15 @@ replacement for `_×_`. As a consequence, demonstrate an equivalence relating
251251
-- Your code goes here
252252
```
253253

254-
#### Exercise `All-++-≃` (practice) (was stretch)
254+
#### Exercise `All-++-≃` (stretch)
255255

256256
Show that the equivalence `All-++-⇔` can be extended to an isomorphism.
257257

258258
```agda
259259
-- Your code goes here
260260
```
261261

262-
#### Exercise `¬Any⇔All¬` (practice) (was recommended)
262+
#### Exercise `¬Any⇔All¬` (recommended)
263263

264264
Show that `Any` and `All` satisfy a version of De Morgan's Law:
265265

@@ -280,7 +280,7 @@ If so, prove; if not, explain why.
280280
-- Your code goes here
281281
```
282282

283-
#### Exercise `¬Any≃All¬` (practice) (was stretch)
283+
#### Exercise `¬Any≃All¬` (stretch)
284284

285285
Show that the equivalence `¬Any⇔All¬` can be extended to an isomorphism.
286286
You will need to use extensionality.
@@ -307,7 +307,7 @@ Show that `Any P xs` is isomorphic to `∃[ x ] (x ∈ xs × P x)`.
307307
```
308308

309309

310-
#### Exercise `Any?` (practice) (was stretch)
310+
#### Exercise `Any?` (stretch)
311311

312312
Just as `All` has analogues `all` and `All?` which determine whether a
313313
predicate holds for every element of a list, so does `Any` have
@@ -319,7 +319,7 @@ for some element of a list. Give their definitions.
319319
```
320320

321321

322-
#### Exercise `split` (practice) (was stretch)
322+
#### Exercise `split` (stretch)
323323

324324
The relation `merge` holds when two lists merge to give a third list.
325325
```agda
@@ -382,8 +382,7 @@ module Lambda where
382382
open import Data.String using (String; _≟_)
383383
open import Data.Unit using (tt)
384384
open import Relation.Nullary using (Dec; yes; no; ¬_)
385-
open import Relation.Nullary.Decidable using (False; toWitnessFalse)
386-
open import Relation.Nullary.Negation using (¬?)
385+
open import Relation.Nullary.Decidable using (False; toWitnessFalse; ¬?)
387386
open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl)
388387
```
389388

0 commit comments

Comments
 (0)