Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
aa:lab:12 [2024/01/14 13:49] dmihai |
aa:lab:12 [2025/01/23 14:09] (current) dmihai |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ADTs și inducție structurală ====== | + | ====== TDA-uri și inducție structurală ====== |
| | ||
1. Definiți axiome pentru următorii operatori pe tipul ''List'': | 1. Definiți axiome pentru următorii operatori pe tipul ''List'': | ||
- | * ''append'' (concatenarea unei liste la o alta; ''append(Cons(8, Cons(12, Empty)), Cons(3, Cons(6, Empty))) = Cons(8, Cons(12, Cons(3, Cons(6, Empty))))'') | ||
* ''reverse'' (inversează elementele dintr-o listă) | * ''reverse'' (inversează elementele dintr-o listă) | ||
+ | * ''filterEven'' (elimină elementele impare dintr-o listă) | ||
2. Definiți axiome pentru următorii operatori pe tipul ''BTree'': | 2. Definiți axiome pentru următorii operatori pe tipul ''BTree'': | ||
Line 26: | Line 26: | ||
* $math[\forall l_1, l_2 \in \texttt{List}. reverse(append(l_1, l_2)) = append(reverse(l_2), reverse(l_1))]. | * $math[\forall l_1, l_2 \in \texttt{List}. reverse(append(l_1, l_2)) = append(reverse(l_2), reverse(l_1))]. | ||
+ | |||
+ | |||
+ | <note> | ||
+ | Soluțiile acestui laborator se găsesc [[https://ocw.cs.pub.ro/ppcarte/doku.php?id=aa:lab:sol:12|aici]] | ||
+ | </note> | ||