-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.py
286 lines (245 loc) · 6.7 KB
/
a.py
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
import functions as f
import numpy as np
# a) demonstrating that conv(ld(R)) is the same as ld(conv(R)) for all 11 relationships
def prt1_a_disjoin():
disjoin = np.array([[0, 0, 1], [0, 0, 1], [1, 1, 1]])
print("conv(ld(R))")
print("For: DISJOIN")
print(disjoin)
x = f.lft_dual(disjoin)
print("-> to contains with left dual.")
print(x)
f.converse(x)
print("-> to INSIDE with converse.")
print(x)
print("ld(conv(R))")
disjoin = np.array([[0, 0, 1], [0, 0, 1], [1, 1, 1]])
print('For: DISJOIN')
print(disjoin)
y = f.converse(disjoin)
print('-> to disjoin with converse.')
print(y)
y = f.lft_dual(y)
print('-> to CONTAINS with left dual.')
print(y)
print("\n")
def prt1_a_embrace():
embrace = np.array([[1, 1, 1], [1, 0, 0], [1, 0, 0]])
print("conv(ld(R))")
print("For: EMBRACE")
print(embrace)
x = f.lft_dual(embrace)
print("-> to inside with left dual.")
print(x)
f.converse(x)
print("-> to CONTAINS with converse.")
print(x)
print("ld(conv(R))")
embrace = np.array([[1, 1, 1], [1, 0, 0], [1, 0, 0]])
print('For: EMBRACE')
print(embrace)
y = f.converse(embrace)
print('-> to embrace with converse.')
print(y)
y = f.lft_dual(y)
print('-> to INSIDE with left dual.')
print(y)
print("\n")
def prt1_a_attach():
attach = np.array([[0, 0, 1], [0, 1, 0], [1, 0, 0]])
print("conv(ld(R))")
print("For: ATTACH")
print(attach)
x = f.lft_dual(attach)
print("-> to equals with left dual.")
print(x)
f.converse(x)
print("-> to EQUALS with converse.")
print(x)
print("ld(conv(R))")
attach = np.array([[0, 0, 1], [0, 1, 0], [1, 0, 0]])
print('For: ATTACH')
print(attach)
y = f.converse(attach)
print('-> to attach with converse.')
print(y)
y = f.lft_dual(y)
print('-> to EQUALS with left dual.')
print(y)
print("\n")
def prt1_a_entwined():
entwined = np.array([[1, 1, 1], [1, 1, 0], [1, 0, 0]])
print("conv(ld(R))")
print("For: ENTWINED")
print(entwined)
x = f.lft_dual(entwined)
print("-> to coveredBy with left dual.")
print(x)
f.converse(x)
print("-> to COVERS with converse.")
print(x)
print("ld(conv(R))")
entwined = np.array([[1, 1, 1], [1, 1, 0], [1, 0, 0]])
print('For: ENTWINED')
print(entwined)
y = f.converse(entwined)
print('-> to entwined with converse.')
print(y)
y = f.lft_dual(y)
print('-> to COVEREDBY with left dual.')
print(y)
print("\n")
def prt1_a_meet():
meet = np.array([[0, 0, 1], [0, 1, 1], [1, 1, 1]])
print("conv(ld(R))")
print("For: MEET")
print(meet)
x = f.lft_dual(meet)
print("-> to covers with left dual.")
print(x)
f.converse(x)
print("-> to COVEREDBY with converse.")
print(x)
print("ld(conv(R))")
meet = np.array([[0, 0, 1], [0, 1, 1], [1, 1, 1]])
print('For: MEET')
print(meet)
y = f.converse(meet)
print('-> to meet with converse.')
print(y)
y = f.lft_dual(y)
print('-> to COVERS with left dual.')
print(y)
print("\n")
def prt1_a_overlap():
overlap = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]])
print("conv(ld(R))")
print("For: OVERLAP")
print(overlap)
x = f.lft_dual(overlap)
print("-> to OVERLAP with left dual.")
print(x)
f.converse(x)
print("-> to OVERLAP with converse.")
print(x)
print("ld(conv(R))")
overlap = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]])
print('For: OVERLAP')
print(overlap)
y = f.converse(overlap)
print('-> to OVERLAP with converse.')
print(y)
y = f.lft_dual(y)
print('-> to OVERLAP with left dual.')
print(y)
print("\n")
def prt1_a_coveredBy():
coveredBy = np.array([[1, 0, 0], [1, 1, 0], [1, 1, 1]])
print("conv(ld(R))")
print("For: COVEREDBY")
print(coveredBy)
x = f.lft_dual(coveredBy)
print("-> to entwined with left dual.")
print(x)
f.converse(x)
print("-> to ENTWINED with converse.")
print(x)
print("ld(conv(R))")
coveredBy = np.array([[1, 0, 0], [1, 1, 0], [1, 1, 1]])
print('For: COVEREDBY')
print(coveredBy)
y = f.converse(coveredBy)
print('-> to covers with converse.')
print(y)
y = f.lft_dual(y)
print('-> to MEET with left dual.')
print(y)
print("\n")
def prt1_a_covers():
covers = np.array([[1, 1, 1], [0, 1, 1], [0, 0, 1]])
print("conv(ld(R))")
print("For: COVERS")
print(covers)
x = f.lft_dual(covers)
print("-> to meet with left dual.")
print(x)
f.converse(x)
print("-> to MEET with converse.")
print(x)
print("ld(conv(R))")
covers = np.array([[1, 1, 1], [0, 1, 1], [0, 0, 1]])
print('For: COVERS')
print(covers)
y = f.converse(covers)
print('-> to coveredBy with converse.')
print(y)
y = f.lft_dual(y)
print('-> to ENTWINED with left dual.')
print(y)
print("\n")
def prt1_a_inside():
inside = np.array([[1, 0, 0], [1, 0, 0], [1, 1, 1]])
print("conv(ld(R))")
print("For: INSIDE")
print(inside)
x = f.lft_dual(inside)
print("-> to embrace with left dual.")
print(x)
f.converse(x)
print("-> to EMBRACE with converse.")
print(x)
print("ld(conv(R))")
inside = np.array([[1, 0, 0], [1, 0, 0], [1, 1, 1]])
print('For: INSIDE')
print(inside)
y = f.converse(inside)
print('-> to contains with converse.')
print(y)
y = f.lft_dual(y)
print('-> to DISJOIN with left dual.')
print(y)
print("\n")
def prt1_a_equals():
equals = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
print("conv(ld(R))")
print("For: EQUALS")
print(equals)
x = f.lft_dual(equals)
print("-> to attach with left dual.")
print(x)
f.converse(x)
print("-> to ATTACH with converse.")
print(x)
print("ld(conv(R))")
equals = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
print('For: EQUALS')
print(equals)
y = f.converse(equals)
print('-> to equals with converse.')
print(y)
y = f.lft_dual(y)
print('-> to ATTACH with left dual.')
print(y)
print("\n")
def prt1_a_contains():
contains = np.array([[1, 1, 1], [0, 0, 1], [0, 0, 1]])
print("conv(ld(R))")
print("For: CONTAINS")
print(contains)
x = f.lft_dual(contains)
print("-> to disjoint with left dual.")
print(x)
f.converse(x)
print("-> to DISJOIN with converse.")
print(x)
print("ld(conv(R))")
contains = np.array([[1, 1, 1], [0, 0, 1], [0, 0, 1]])
print('For: CONTAINS')
print(contains)
y = f.converse(contains)
print('-> to inside with converse.')
print(y)
y = f.lft_dual(y)
print('-> to EMBRACE with left dual.')
print(y)
print("\n")