File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,33 @@ After sorting, the integers are:
44
44
1 2 3
45
45
```
46
46
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
+
47
74
## License
48
75
49
76
Copyright (c) 2015 by David Foster
You can’t perform that action at this time.
0 commit comments