vault backup: 2023-09-12 16:35:48

This commit is contained in:
Louis Gallet 2023-09-12 16:35:48 +02:00
parent e500ac3dac
commit 75bdb42cd6
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY
3 changed files with 40 additions and 8 deletions

View File

@ -10,6 +10,18 @@
{ {
"id": "c82ce15f72f65a11", "id": "c82ce15f72f65a11",
"type": "leaf", "type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Algo/Séminaire/Exercices seminaire.md",
"mode": "source",
"source": false
}
}
},
{
"id": "64e3f10f354fdce4",
"type": "leaf",
"state": { "state": {
"type": "markdown", "type": "markdown",
"state": { "state": {
@ -85,7 +97,7 @@
"state": { "state": {
"type": "backlink", "type": "backlink",
"state": { "state": {
"file": "Algo/Séminaire/Chapter 5 - Recursivity.md", "file": "Algo/Séminaire/Exercices seminaire.md",
"collapseAll": false, "collapseAll": false,
"extraContext": false, "extraContext": false,
"sortOrder": "alphabetical", "sortOrder": "alphabetical",
@ -102,7 +114,7 @@
"state": { "state": {
"type": "outgoing-link", "type": "outgoing-link",
"state": { "state": {
"file": "Algo/Séminaire/Chapter 5 - Recursivity.md", "file": "Algo/Séminaire/Exercices seminaire.md",
"linksCollapsed": false, "linksCollapsed": false,
"unlinkedCollapsed": true "unlinkedCollapsed": true
} }
@ -125,7 +137,7 @@
"state": { "state": {
"type": "outline", "type": "outline",
"state": { "state": {
"file": "Algo/Séminaire/Chapter 5 - Recursivity.md" "file": "Algo/Séminaire/Exercices seminaire.md"
} }
} }
}, },
@ -156,12 +168,13 @@
"command-palette:Open command palette": false "command-palette:Open command palette": false
} }
}, },
"active": "c473a791e2b34194", "active": "c82ce15f72f65a11",
"lastOpenFiles": [ "lastOpenFiles": [
"Algo/Séminaire/Chapter 5 - Recursivity.md",
"Algo/Séminaire/Exercices seminaire.md",
"Algo/Séminaire/assets/fact function response.png", "Algo/Séminaire/assets/fact function response.png",
"Algo/Séminaire/assets/recursivite-meme.png", "Algo/Séminaire/assets/recursivite-meme.png",
"Pasted image 20230912155138.png", "Pasted image 20230912155138.png",
"Algo/Séminaire/Chapter 5 - Recursivity.md",
"Algo/Séminaire/Chapter 4 - A bit of imperative.md", "Algo/Séminaire/Chapter 4 - A bit of imperative.md",
"Algo/Chapter 0 - A bit of imperative/0.1 - Print.md", "Algo/Chapter 0 - A bit of imperative/0.1 - Print.md",
"Algo/Séminaire/Untitled", "Algo/Séminaire/Untitled",
@ -169,7 +182,6 @@
"Algo/Séminaire/Chapter 1 - CAML basics.md", "Algo/Séminaire/Chapter 1 - CAML basics.md",
"Algo/Séminaire/Chapter 2 - Functions.md", "Algo/Séminaire/Chapter 2 - Functions.md",
"Mathématiques/Séminaire/Logics/Logics.md", "Mathématiques/Séminaire/Logics/Logics.md",
"Algo/Séminaire/Exercices seminaire.md",
"Algo/Chapter 0 - A bit of imperative", "Algo/Chapter 0 - A bit of imperative",
"Algo/Séminaire/Chapter 3 - Case analysis.md", "Algo/Séminaire/Chapter 3 - Case analysis.md",
"README.md", "README.md",
@ -186,7 +198,6 @@
"Mathématiques/Séminaire/Logics/Pasted image 20230904101453.png", "Mathématiques/Séminaire/Logics/Pasted image 20230904101453.png",
"Mathématiques/Séminaire/Logics/Pasted image 20230904100934.png", "Mathématiques/Séminaire/Logics/Pasted image 20230904100934.png",
"Mathématiques/Séminaire", "Mathématiques/Séminaire",
"Mathématiques/Séminaire/Logics/Pasted image 20230904100125.png",
"2023-09-01.md", "2023-09-01.md",
"Algo", "Algo",
"Mathématiques", "Mathématiques",

View File

@ -54,3 +54,11 @@ val countdown = int -> unit = ()
2 2
1 1
- : unit = () - : unit = ()
```
Flowchart of CAML evaluation
```mermaid
flowchart LR
A[ctd 3] --> B[ctd 2] --> C[ctd 1] --> D[ctd 0] --> E[ctd -1] --> F[ ] --> E --> D --> C --> B --> A
```
> ctd is countdown

View File

@ -247,3 +247,16 @@ val or3-simple: bool*bool*bool -> bool = <fun>
```Ocaml ```Ocaml
let time_difference (d1, md1, sd1, pos1) (d2, md2, sd2, pos2) let time_difference (d1, md1, sd1, pos1) (d2, md2, sd2, pos2)
``` ```
## Exercise 4.2
```Ocaml
let rec suite n = let a = 0 in
if n <= 0 then
a
else
a + suite (4*(n-1) - 1);;
let rec sequence = function
| 0 -> 1
| n -> 4* sequence(n-1) - 1;;