7 import Cube (Cube(grid), top)
21 -- | Since the grid size is necessarily positive, all tetrahedrons
22 -- (which comprise cubes of positive volume) must have positive volume
24 prop_all_volumes_positive :: Cube -> Property
25 prop_all_volumes_positive c =
26 (delta > 0) ==> (null nonpositive_volumes)
30 volumes = map volume ts
31 nonpositive_volumes = filter (<= 0) volumes
34 -- | Given in Sorokina and Zeilfelder, p. 78.
35 prop_cijk1_identity :: Cube -> Bool
36 prop_cijk1_identity cube =
37 and [ c t0' i j k 1 ~= (c t1' (i+1) j k 0) * ((b0 t0') (v3 t1')) +
38 (c t1' i (j+1) k 0) * ((b1 t0') (v3 t1')) +
39 (c t1' i j (k+1) 0) * ((b2 t0') (v3 t1')) +
40 (c t1' i j k 1) * ((b3 t0') (v3 t1')) | i <- [0..2],
45 t0 = tetrahedron0 (face0 cube)
46 t1 = tetrahedron1 (face0 cube)
47 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
48 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
50 -- | Given in Sorokina and Zeilfelder, p. 79.
51 prop_c0120_identity1 :: Cube -> Bool
52 prop_c0120_identity1 cube =
53 c t0' 0 1 2 0 ~= (c t0' 0 0 2 1 + c t1' 0 0 2 1) / 2
55 t0 = tetrahedron0 (face0 cube)
56 t1 = tetrahedron1 (face0 cube)
57 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
58 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
61 -- | Given in Sorokina and Zeilfelder, p. 79.
62 prop_c0210_identity1 :: Cube -> Bool
63 prop_c0210_identity1 cube =
64 c t0' 0 2 1 0 ~= (c t0' 0 1 1 1 + c t1' 0 1 1 1) / 2
66 t0 = tetrahedron0 (face0 cube)
67 t1 = tetrahedron1 (face0 cube)
68 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
69 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
72 -- | Given in Sorokina and Zeilfelder, p. 79.
73 prop_c0300_identity1 :: Cube -> Bool
74 prop_c0300_identity1 cube =
75 c t0' 0 3 0 0 ~= (c t0' 0 2 0 1 + c t1' 0 2 0 1) / 2
77 t0 = tetrahedron0 (face0 cube)
78 t1 = tetrahedron1 (face0 cube)
79 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
80 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
82 -- | Given in Sorokina and Zeilfelder, p. 79.
83 prop_c1110_identity :: Cube -> Bool
84 prop_c1110_identity cube =
85 c t0' 1 1 1 0 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
87 t0 = tetrahedron0 (face0 cube)
88 t1 = tetrahedron1 (face0 cube)
89 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
90 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
93 -- | Given in Sorokina and Zeilfelder, p. 79.
94 prop_c1200_identity1 :: Cube -> Bool
95 prop_c1200_identity1 cube =
96 c t0' 1 2 0 0 ~= (c t0' 1 1 0 1 + c t1' 1 1 0 1) / 2
98 t0 = tetrahedron0 (face0 cube)
99 t1 = tetrahedron1 (face0 cube)
100 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
101 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
104 -- | Given in Sorokina and Zeilfelder, p. 79.
105 prop_c2100_identity1 :: Cube -> Bool
106 prop_c2100_identity1 cube =
107 c t0' 2 1 0 0 ~= (c t0' 2 0 0 1 + c t1' 2 0 0 1) / 2
109 t0 = tetrahedron0 (face0 cube)
110 t1 = tetrahedron1 (face0 cube)
111 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
112 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
115 -- | Given in Sorokina and Zeilfelder, p. 79.
116 prop_c0102_identity1 :: Cube -> Bool
117 prop_c0102_identity1 cube =
118 c t0' 0 1 0 2 ~= (c t0' 0 0 1 2 + c t3' 0 0 1 2) / 2
120 t0 = tetrahedron0 (face0 cube)
121 t3 = tetrahedron3 (face0 cube)
122 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
123 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
126 -- | Given in Sorokina and Zeilfelder, p. 79.
127 prop_c0201_identity1 :: Cube -> Bool
128 prop_c0201_identity1 cube =
129 c t0' 0 2 0 1 ~= (c t0' 0 1 1 1 + c t3' 0 1 1 1) / 2
131 t0 = tetrahedron0 (face0 cube)
132 t3 = tetrahedron3 (face0 cube)
133 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
134 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
137 -- | Given in Sorokina and Zeilfelder, p. 79.
138 prop_c0300_identity2 :: Cube -> Bool
139 prop_c0300_identity2 cube =
140 c t0' 3 0 0 0 ~= (c t0' 0 2 1 0 + c t3' 0 2 1 0) / 2
142 t0 = tetrahedron0 (face0 cube)
143 t3 = tetrahedron3 (face0 cube)
144 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
145 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
147 -- | Given in Sorokina and Zeilfelder, p. 79.
148 prop_c1101_identity :: Cube -> Bool
149 prop_c1101_identity cube =
150 c t0' 1 1 0 1 ~= (c t0' 1 1 0 1 + c t3' 1 1 0 1) / 2
152 t0 = tetrahedron0 (face0 cube)
153 t3 = tetrahedron3 (face0 cube)
154 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
155 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
158 -- | Given in Sorokina and Zeilfelder, p. 79.
159 prop_c1200_identity2 :: Cube -> Bool
160 prop_c1200_identity2 cube =
161 c t0' 1 1 1 0 ~= (c t0' 1 1 1 0 + c t3' 1 1 1 0) / 2
163 t0 = tetrahedron0 (face0 cube)
164 t3 = tetrahedron3 (face0 cube)
165 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
166 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
169 -- | Given in Sorokina and Zeilfelder, p. 79.
170 prop_c2100_identity2 :: Cube -> Bool
171 prop_c2100_identity2 cube =
172 c t0' 2 1 0 0 ~= (c t0' 2 0 1 0 + c t3' 2 0 1 0) / 2
174 t0 = tetrahedron0 (face0 cube)
175 t3 = tetrahedron3 (face0 cube)
176 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
177 t3' = Tetrahedron cube (v3 t3) (v2 t3) (v1 t3) (v0 t3)
180 -- | Given in Sorokina and Zeilfelder, p. 79.
181 prop_c3000_identity :: Cube -> Bool
182 prop_c3000_identity cube =
183 c t0' 3 0 0 0 ~= c t0' 2 1 0 0 + c t2' 2 1 0 0 - ((c t0' 2 0 1 0 + c t0' 2 0 0 1)/ 2)
185 t0 = tetrahedron0 (face0 cube)
186 t2 = tetrahedron2 (face5 cube)
187 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
188 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
191 -- | Given in Sorokina and Zeilfelder, p. 79.
192 prop_c2010_identity :: Cube -> Bool
193 prop_c2010_identity cube =
194 c t0' 2 0 1 0 ~= c t0' 1 1 1 0 + c t2' 1 1 1 0 - ((c t0' 1 0 2 0 + c t0' 1 0 1 1)/ 2)
196 t0 = tetrahedron0 (face0 cube)
197 t2 = tetrahedron2 (face5 cube)
198 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
199 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
202 -- | Given in Sorokina and Zeilfelder, p. 79.
203 prop_c2001_identity :: Cube -> Bool
204 prop_c2001_identity cube =
205 c t0' 2 0 0 1 ~= c t0' 1 1 0 1 + c t2' 1 1 0 1 - ((c t0' 1 0 0 2 + c t0' 1 0 1 1)/ 2)
207 t0 = tetrahedron0 (face0 cube)
208 t2 = tetrahedron2 (face5 cube)
209 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
210 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
212 -- | Given in Sorokina and Zeilfelder, p. 79.
213 prop_c1020_identity :: Cube -> Bool
214 prop_c1020_identity cube =
215 c t0' 1 0 2 0 ~= c t0' 0 1 2 0 + c t2' 0 1 2 0 - ((c t0' 0 0 3 0 + c t0' 0 0 2 1)/ 2)
217 t0 = tetrahedron0 (face0 cube)
218 t2 = tetrahedron2 (face5 cube)
219 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
220 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
223 -- | Given in Sorokina and Zeilfelder, p. 79.
224 prop_c1002_identity :: Cube -> Bool
225 prop_c1002_identity cube =
226 c t0' 1 0 0 2 ~= c t0' 0 1 0 2 + c t2' 0 1 0 2 - ((c t0' 0 0 0 3 + c t0' 0 0 1 2)/ 2)
228 t0 = tetrahedron0 (face0 cube)
229 t2 = tetrahedron2 (face5 cube)
230 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
231 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
234 -- | Given in Sorokina and Zeilfelder, p. 79.
235 prop_c1011_identity :: Cube -> Bool
236 prop_c1011_identity cube =
237 c t0' 1 0 1 1 ~= c t0' 0 1 1 1 + c t2' 0 1 1 1 - ((c t0' 0 0 1 2 + c t0' 0 0 2 1)/ 2)
239 t0 = tetrahedron0 (face0 cube)
240 t2 = tetrahedron2 (face5 cube)
241 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
242 t2' = Tetrahedron cube (v3 t2) (v2 t2) (v1 t2) (v0 t2)
245 -- | Given in Sorokina and Zeilfelder, p. 80.
246 prop_c0120_identity2 :: Cube -> Bool
247 prop_c0120_identity2 cube =
248 c t0' 0 1 2 0 ~= (c t0' 1 0 2 0 + c t1' 1 0 2 0) / 2
250 t0 = tetrahedron0 (face0 cube)
251 t1 = tetrahedron0 (face2 (top cube))
252 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
253 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
256 -- | Given in Sorokina and Zeilfelder, p. 80.
257 prop_c0102_identity2 :: Cube -> Bool
258 prop_c0102_identity2 cube =
259 c t0' 0 1 0 2 ~= (c t0' 1 0 0 2 + c t1' 1 0 0 2) / 2
261 t0 = tetrahedron0 (face0 cube)
262 t1 = tetrahedron0 (face2 (top cube))
263 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
264 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
267 -- | Given in Sorokina and Zeilfelder, p. 80.
268 prop_c0111_identity :: Cube -> Bool
269 prop_c0111_identity cube =
270 c t0' 0 1 1 1 ~= (c t0' 1 0 1 1 + c t1' 1 0 1 1) / 2
272 t0 = tetrahedron0 (face0 cube)
273 t1 = tetrahedron0 (face2 (top cube))
274 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
275 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
278 -- | Given in Sorokina and Zeilfelder, p. 80.
279 prop_c0210_identity2 :: Cube -> Bool
280 prop_c0210_identity2 cube =
281 c t0 0 2 1 0 ~= (c t0 1 1 1 0 + c t1 1 1 1 0) / 2
283 t0 = tetrahedron0 (face0 cube)
284 t1 = tetrahedron0 (face2 (top cube))
285 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
286 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
289 -- | Given in Sorokina and Zeilfelder, p. 80.
290 prop_c0201_identity2 :: Cube -> Bool
291 prop_c0201_identity2 cube =
292 c t0 0 2 0 1 ~= (c t0 1 1 0 1 + c t1 1 1 0 1) / 2
294 t0 = tetrahedron0 (face0 cube)
295 t1 = tetrahedron0 (face2 (top cube))
296 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
297 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)
300 -- | Given in Sorokina and Zeilfelder, p. 80.
301 prop_c0300_identity3 :: Cube -> Bool
302 prop_c0300_identity3 cube =
303 c t0 0 3 0 0 ~= (c t0 1 2 0 0 + c t1 1 2 0 0) / 2
305 t0 = tetrahedron0 (face0 cube)
306 t1 = tetrahedron0 (face2 (top cube))
307 t0' = Tetrahedron cube (v3 t0) (v2 t0) (v1 t0) (v0 t0)
308 t1' = Tetrahedron cube (v3 t1) (v2 t1) (v0 t1) (v1 t1)