forked from readablesystems/cs260r-17
-
Notifications
You must be signed in to change notification settings - Fork 0
/
l02.v
29 lines (16 loc) · 715 Bytes
/
l02.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Module Lecture2.
Require Import List.
Require Import Arith.
Require Import Omega. (* the `omega` tactic knows arithmetic *)
Import ListNotations. (* `[]`, `[a; b; c]` notation *)
(* Let's define our own functions on lists and prove
some things about them.
These functions are recursive on the `list` type,
so they are defined with `Function` (not `Definition`). *)
(* xlength should return the length of a list. *)
(* xappend should append two lists together. *)
(* xreverse should reverse a list in O(N^2) time. *)
(* xireverse should reverse a list in O(N) time. *)
(* Use `Eval compute` to test out your functions. *)
(* Now, prove some things! *)
End Lecture2.