Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
23
Task/Loops-For/Rocq/loops-for.rocq
Normal file
23
Task/Loops-For/Rocq/loops-for.rocq
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Section FOR.
|
||||
Variable T : Type.
|
||||
Variable body : nat -> T -> T.
|
||||
Variable start : nat.
|
||||
|
||||
Fixpoint for_loop n : T -> T :=
|
||||
match n with
|
||||
| O => fun s => s
|
||||
| S n' => fun s => for_loop n' (body (start + n') s)
|
||||
end.
|
||||
|
||||
End FOR.
|
||||
|
||||
Eval vm_compute in
|
||||
for_loop _
|
||||
(fun i =>
|
||||
cons
|
||||
(for_loop _
|
||||
(fun j => cons tt)
|
||||
0 (S i) nil
|
||||
)
|
||||
)
|
||||
0 5 nil.
|
||||
Loading…
Add table
Add a link
Reference in a new issue