Skip to content

Commit 136cb0f

Browse files
committed
README: Explain how to see the proof term.
1 parent 88719f8 commit 136cb0f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,33 @@ After sorting, the integers are:
4444
1 2 3
4545
```
4646

47+
## See the Proof Term!
48+
49+
Another way to run the program is to run it directly using the Idris
50+
interpreter. The advantage here is that you can see not just the resulting
51+
sorted output list but also the resulting proof terms of the algorithm.
52+
53+
```
54+
$ idris --nobanner InsertionSort.idr
55+
*InsertionSort> insertionSort [2,1]
56+
MkSigma [1, 2]
57+
(IsSortedMany 1 2 [] Oh (IsSortedOne 2),
58+
SamenessIsTransitive (PrependXIsPrependX 2
59+
(SamenessIsTransitive (PrependXIsPrependX 1
60+
NilIsNil)
61+
(PrependXIsPrependX 1
62+
NilIsNil)))
63+
(PrependXYIsPrependYX 2
64+
1
65+
NilIsNil)) : Sigma (Vect 2
66+
Integer)
67+
(\xs' =>
68+
(IsSorted xs',
69+
ElemsAreSame [2,
70+
1]
71+
xs'))
72+
```
73+
4774
## License
4875

4976
Copyright (c) 2015 by David Foster

0 commit comments

Comments
 (0)