| Some definitions of interest. |
|
assert | Def b == if b True else False fi |
| | Thm* b: . b Prop |
|
count_pairs | Def count(x < y in L | P(x;y))
Def == sum(if (i< j) P(L[i];L[j]) 1 else 0 fi | i < ||L||; j < ||L||) |
| | Thm* T:Type, L:T List, P:(T T  ). count(x < y in L | P(x,y))  |
|
guarded_permutation | Def guarded_permutation(T;P)
Def == ( L1,L2. i: (||L1||-1). P(L1,i) & L2 = swap(L1;i;i+1) T List)^* |
| | Thm* T:Type, P:(L:(T List)  (||L||-1) Prop).
Thm* guarded_permutation(T;P) (T List) (T List) Prop |
|
int_seg | Def {i..j } == {k: | i k < j } |
| | Thm* m,n: . {m..n } Type |
|
swap | Def swap(L;i;j) == (L o (i, j)) |
| | Thm* T:Type, L:T List, i,j: ||L||. swap(L;i;j) T List |
|
length | Def ||as|| == Case of as; nil 0 ; a.as' ||as'||+1 (recursive) |
| | Thm* A:Type, l:A List. ||l||  |
| | Thm* ||nil||  |
|
nat | Def == {i: | 0 i } |
| | Thm* Type |
|
not | Def A == A  False |
| | Thm* A:Prop. ( A) Prop |
|
select | Def l[i] == hd(nth_tl(i;l)) |
| | Thm* A:Type, l:A List, n: . 0 n  n<||l||  l[n] A |