-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSuudoku_r24.als
executable file
·95 lines (88 loc) · 1.78 KB
/
Suudoku_r24.als
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
abstract sig Index {}
sig Col extends Index {
cell : Index -> Index
}
abstract sig G01,G02,G03 extends Col {}
one sig C01,C02,C03 extends G01{}
one sig C04,C05,C06 extends G02{}
one sig C07,C08,C09 extends G03{}
fact{
all c : Col , row : Index | one cell[c,row]
}
fact{
all c:Col, r1,r2:Index | (r1=r2)or(not(cell[c,r1]=cell[c,r2]))
}
fact{
all c1,c2:Col, r:Index | (c1=c2)or(not(cell[c1,r]=cell[c2,r]))
}
fact{
all c1,c2:G01, r1,r2:G01 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G01, r1,r2:G02 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G01, r1,r2:G03 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G02, r1,r2:G01 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G02, r1,r2:G02 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G02, r1,r2:G03 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G03, r1,r2:G01 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G03, r1,r2:G02 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact{
all c1,c2:G03, r1,r2:G03 | (r1=r2 and c1=c2)or(not(cell[c1,r1]=cell[c2,r2]))
}
fact {
(cell[C01,C01]=C08)
and
(cell[C02,C03]=C03)
and
(cell[C02,C04]=C06)
and
(cell[C03,C02]=C07)
and
(cell[C03,C05]=C09)
and
(cell[C03,C07]=C02)
and
(cell[C04,C02]=C05)
and
(cell[C04,C06]=C07)
and
(cell[C05,C05]=C04)
and
(cell[C05,C06]=C05)
and
(cell[C05,C07]=C07)
and
(cell[C06,C04]=C01)
and
(cell[C06,C08]=C03)
and
(cell[C07,C03]=C01)
and
(cell[C07,C08]=C06)
and
(cell[C07,C09]=C08)
and
(cell[C08,C03]=C08)
and
(cell[C08,C04]=C05)
and
(cell[C08,C08]=C01)
and
(cell[C09,C02]=C09)
and
(cell[C09,C07]=C04)
}
run{} for 13