-
Notifications
You must be signed in to change notification settings - Fork 0
/
comptables.py
74 lines (66 loc) · 4 KB
/
comptables.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
from rccrelations import *
#def rcc5compTab(r1, r2):
# if r1 == rcc["<"] and r2 == rcc["<"]: return rcc["<"]
# if r1 == rcc["<"] and r2 == rcc[">"]: return rcc["!<=>o"]
# if r1 == rcc["<"] and r2 == rcc["!"]: return rcc["!"]
# if r1 == rcc["<"] and r2 == rcc["o"]: return rcc["!<o"]
# if r1 == rcc["<"] and r2 == rcc["="]: return rcc["<"]
#
# if r1 == rcc[">"] and r2 == rcc["<"]: return rcc["<=>o"]
# if r1 == rcc[">"] and r2 == rcc[">"]: return rcc[">"]
# if r1 == rcc[">"] and r2 == rcc["!"]: return rcc["!>o"]
# if r1 == rcc[">"] and r2 == rcc["o"]: return rcc[">o"]
# if r1 == rcc[">"] and r2 == rcc["="]: return rcc[">"]
#
# if r1 == rcc["!"] and r2 == rcc["<"]: return rcc["!<o"]
# if r1 == rcc["!"] and r2 == rcc[">"]: return rcc["!"]
# if r1 == rcc["!"] and r2 == rcc["!"]: return rcc["!<=>o"]
# if r1 == rcc["!"] and r2 == rcc["o"]: return rcc["!<o"]
# if r1 == rcc["!"] and r2 == rcc["="]: return rcc["!"]
#
# if r1 == rcc["o"] and r2 == rcc["<"]: return rcc["<o"]
# if r1 == rcc["o"] and r2 == rcc[">"]: return rcc["!>o"]
# if r1 == rcc["o"] and r2 == rcc["!"]: return rcc["!>o"]
# if r1 == rcc["o"] and r2 == rcc["o"]: return rcc["!<=>o"]
# if r1 == rcc["o"] and r2 == rcc["="]: return rcc["o"]
#
# if r1 == rcc["="] and r2 == rcc["<"]: return rcc["<"]
# if r1 == rcc["="] and r2 == rcc[">"]: return rcc[">"]
# if r1 == rcc["="] and r2 == rcc["!"]: return rcc["!"]
# if r1 == rcc["="] and r2 == rcc["o"]: return rcc["o"]
# if r1 == rcc["="] and r2 == rcc["="]: return rcc["="]
def containsymb(rel, symb):
return rel & symb
# if symb == rcc["<"]: return rel & rcc["<"]
# if symb == rcc[">"]: return rel & rcc[">"]
# if symb == rcc["!"]: return rel & rcc["!"]
# if symb == rcc["o"]: return rel & rcc["o"]
# if symb == rcc["="]: return rel & rcc["="]
def r32compTab(r1, r2):
rel = 0
if containsymb(r1, rcc["<"]) and containsymb(r2, rcc["<"]): rel = rel | rcc["<"]
if containsymb(r1, rcc["<"]) and containsymb(r2, rcc[">"]): rel = rel | rcc["!<=>o"]
if containsymb(r1, rcc["<"]) and containsymb(r2, rcc["!"]): rel = rel | rcc["!"]
if containsymb(r1, rcc["<"]) and containsymb(r2, rcc["o"]): rel = rel | rcc["!<o"]
if containsymb(r1, rcc["<"]) and containsymb(r2, rcc["="]): rel = rel | rcc["<"]
if containsymb(r1, rcc[">"]) and containsymb(r2, rcc["<"]): rel = rel | rcc["<=>o"]
if containsymb(r1, rcc[">"]) and containsymb(r2, rcc[">"]): rel = rel | rcc[">"]
if containsymb(r1, rcc[">"]) and containsymb(r2, rcc["!"]): rel = rel | rcc["!>o"]
if containsymb(r1, rcc[">"]) and containsymb(r2, rcc["o"]): rel = rel | rcc[">o"]
if containsymb(r1, rcc[">"]) and containsymb(r2, rcc["="]): rel = rel | rcc[">"]
if containsymb(r1, rcc["!"]) and containsymb(r2, rcc["<"]): rel = rel | rcc["!<o"]
if containsymb(r1, rcc["!"]) and containsymb(r2, rcc[">"]): rel = rel | rcc["!"]
if containsymb(r1, rcc["!"]) and containsymb(r2, rcc["!"]): rel = rel | rcc["!<=>o"]
if containsymb(r1, rcc["!"]) and containsymb(r2, rcc["o"]): rel = rel | rcc["!<o"]
if containsymb(r1, rcc["!"]) and containsymb(r2, rcc["="]): rel = rel | rcc["!"]
if containsymb(r1, rcc["o"]) and containsymb(r2, rcc["<"]): rel = rel | rcc["<o"]
if containsymb(r1, rcc["o"]) and containsymb(r2, rcc[">"]): rel = rel | rcc["!>o"]
if containsymb(r1, rcc["o"]) and containsymb(r2, rcc["!"]): rel = rel | rcc["!>o"]
if containsymb(r1, rcc["o"]) and containsymb(r2, rcc["o"]): rel = rel | rcc["!<=>o"]
if containsymb(r1, rcc["o"]) and containsymb(r2, rcc["="]): rel = rel | rcc["o"]
if containsymb(r1, rcc["="]) and containsymb(r2, rcc["<"]): rel = rel | rcc["<"]
if containsymb(r1, rcc["="]) and containsymb(r2, rcc[">"]): rel = rel | rcc[">"]
if containsymb(r1, rcc["="]) and containsymb(r2, rcc["!"]): rel = rel | rcc["!"]
if containsymb(r1, rcc["="]) and containsymb(r2, rcc["o"]): rel = rel | rcc["o"]
if containsymb(r1, rcc["="]) and containsymb(r2, rcc["="]): rel = rel | rcc["="]
return rel