-
Notifications
You must be signed in to change notification settings - Fork 4
/
pureNTScript.sml
34 lines (28 loc) · 1 KB
/
pureNTScript.sml
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
30
31
32
33
34
open HolKernel Parse boolLib bossLib;
val _ = new_theory "pureNT";
val _ = set_grammar_ancestry ["list"]
Datatype:
ppegnt = nDecls | nDecl | nTyBase | nTy | nTyConDecl | nTyApp
| nPat | nAPat | nFunRHS
| nExp | nExpEQ | nLSafeExp | nLSafeExpEQ | nIExp | nIExpEQ
| nFExp | nFExpEQ | nFExp2 | nAExp | nAExpEQ
| nLit | nOp
| nEqBindSeq | nEqBindSeq' | nEqBind | nFreeEqBind | nValBinding
| nDoStmt | nDoBlock | nBlockLayout | nDoStmtEQ | nPatAlt | nPatAlts
| nDoStmtSeq | nDoStmtSeqEQ | nDoBlockLayout
End
val distinct_ths = let
val ntlist = TypeBase.constructors_of ``:ppegnt``
fun recurse [] = []
| recurse (t::ts) = let
val eqns = map (fn t' => mk_eq(t,t')) ts
val ths0 = map (SIMP_CONV (srw_ss()) []) eqns
val ths1 = map (CONV_RULE (LAND_CONV (REWR_CONV EQ_SYM_EQ))) ths0
in
ths0 @ ths1 @ recurse ts
end
in
recurse ntlist
end
Theorem pureNTs_distinct[compute] = LIST_CONJ distinct_ths
val _ = export_theory();