-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresolve.txt
161 lines (111 loc) · 1.65 KB
/
resolve.txt
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
interface D { type T }
interface C {
type T1
module X[D1: D] {
type T = D1.T
type T2 = T1
}
}
module A[B: C] {
module E { type T = Int } : D
module F = B.X[E]
}
module C1 { type T1 = Bool } : C
module G = A[C1]
symbols
D -> ...
D.T -> ...
C -> ...
C.T1 -> ...
A -> ...
A.E -> ...
A.E.T -> ...
C1 -> ...
C1.T1 -> ...
Root:
D -> D
C -> C
A -> A
C1 -> C1
G -> Alias(A, A.B -> C1)
C1:
T1 -> C1.T1
C1.X -> Alias(C.X)
A:
B -> Alias(C)
E -> A.E
F -> Alias(A.B.X, A.B.X.D -> A.E)
A.E:
T -> A.E.T
initial subst:
[empty]
initial path:
G.B.T1
follow alias G -> A[B -> C1]
add subst:
A.B -> C1
---
A -> G
new path after alias:
A.B.T1
apply subst:
C1.T1
-----
initial subst:
[empty]
initial path:
G.F.T
follow alias G -> A[B -> C1]
add subst:
A.B -> C1
---
A -> G
apply old subst to new subst:
A.B -> C1
---
A -> G
new paths after alias:
A.F.T
apply subst:
A.F.T
follow alias A.F -> A.B.X[D1 -> A.E]
add subst:
A.B.X.D1 -> A.E
---
A.B.X -> A.F
apply old subst to new subst:
C1.X.D1 -> A.E
---
C1.X -> A.F
new path after alias:
C1.X.T
apply subst:
C1.X.T
follow alias C1.X -> C.X
add subst:
---
C.X -> C1.X
apply old subst to new subst:
---
C.X -> C1.X
new path after alias:
C.X.T
apply subst:
C.X.T
found symbol:
type C.X.T = C.X.D1.T
found subst:
[ C.X -> C1.X,
C1.X.D1 -> A.E,
C1.X -> A.F,
A.B.X.D1 -> A.E
A.B.X -> A.F
A.B -> C1
A -> G
apply subst to symbol name:
C.X.T -> C1.X.T -> A.F.T -> G.F.T
apply subst to symbol:
C.X.D1.T -> C1.X.D1.T -> A.E.T -> G.E.T
type C.X.T = G.E.T