forked from math-comp/finmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorder.v
More file actions
2859 lines (2298 loc) · 100 KB
/
order.v
File metadata and controls
2859 lines (2298 loc) · 100 KB
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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(*************************************************************************)
(* Copyright (C) 2012 - 2016 (Draft) *)
(* C. Cohen *)
(* Based on prior works by *)
(* D. Dreyer, G. Gonthier, A. Nanevski, P-Y Strub, B. Ziliani *)
(* *)
(* This program is free software: you can redistribute it and/or modify *)
(* it under the terms of the GNU General Public License as published by *)
(* the Free Software Foundation, either version 3 of the License, or *)
(* (at your option) any later version. *)
(* *)
(* This program is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)
(* GNU General Public License for more details. *)
(* *)
(* You should have received a copy of the GNU General Public License *)
(* along with this program. If not, see <http://www.gnu.org/licenses/>. *)
(*************************************************************************)
From mathcomp
Require Import ssreflect ssrbool eqtype ssrfun ssrnat choice seq.
From mathcomp
Require Import fintype tuple bigop path finset.
(*****************************************************************************)
(* This files definies a ordered and decidable relations on a *)
(* type as canonical structure. One need to import Order.Theory to get *)
(* the theory of such relations. The scope order_scope (%O) contains *)
(* fancier notation for this kind of ordeering. *)
(* *)
(* porderType == the type of partially ordered types *)
(* orderType == the type of totally ordered types *)
(* latticeType == the type of distributive lattices *)
(* blatticeType == ... with a bottom elemnt *)
(* tlatticeType == ... with a top element *)
(* tblatticeType == ... with both a top and a bottom *)
(* cblatticeType == ... with a complement to, and bottom *)
(* tcblatticeType == ... with a top, bottom, and general complement *)
(* *)
(* Each of these structure take a first argument named display, of type unit *)
(* instanciating it with tt or an unknown key will lead to a default display *)
(* Optionally, one can configure the display by setting one owns notation *)
(* on operators instanciated for their particular display *)
(* One example of this is the reverse display ^r, every notation with the *)
(* suffix ^r (e.g. x <=^r y) is about the reversal order, in order not to *)
(* confuse the normal order with its reversal. *)
(* *)
(* PorderType pord_mixin == builds an ordtype from a a partial order mixin *)
(* containing le, lt and refl, antisym, trans of le *)
(* LatticeType lat_mixin == builds a distributive lattice from a porderType *)
(* meet and join and axioms *)
(* OrderType le_total == builds an order type from a lattice *)
(* and from a proof of totality *)
(* ... *)
(* *)
(* We provide a canonical structure of orderType for natural numbers (nat) *)
(* for finType and for pairs of ordType by lexicographic orderering. *)
(* *)
(* leP ltP ltgtP are the three main lemmas for case analysis *)
(* *)
(* We also provide specialized version of some theorems from path.v. *)
(* *)
(* There are three distinct uses of the symbols <, <=, > and >=: *)
(* 0-ary, unary (prefix) and binary (infix). *)
(* 0. <%O, <=%O, >%O, >=%O stand respectively for lt, le, gt and ge. *)
(* 1. (< x), (<= x), (> x), (>= x) stand respectively for *)
(* (gt x), (ge x), (lt x), (le x). *)
(* So (< x) is a predicate characterizing elements smaller than x. *)
(* 2. (x < y), (x <= y), ... mean what they are expected to. *)
(* These convention are compatible with haskell's, *)
(* where ((< y) x) = (x < y) = ((<) x y), *)
(* except that we write <%O instead of (<). *)
(*****************************************************************************)
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Delimit Scope order_scope with O.
Local Open Scope order_scope.
Reserved Notation "<= y" (at level 35).
Reserved Notation ">= y" (at level 35).
Reserved Notation "< y" (at level 35).
Reserved Notation "> y" (at level 35).
Reserved Notation "<= y :> T" (at level 35, y at next level).
Reserved Notation ">= y :> T" (at level 35, y at next level).
Reserved Notation "< y :> T" (at level 35, y at next level).
Reserved Notation "> y :> T" (at level 35, y at next level).
Reserved Notation "x >=< y" (at level 70, no associativity).
Reserved Notation ">=< x" (at level 35).
Reserved Notation ">=< y :> T" (at level 35, y at next level).
Reserved Notation "x >< y" (at level 70, no associativity).
Reserved Notation ">< x" (at level 35).
Reserved Notation ">< y :> T" (at level 35, y at next level).
Reserved Notation "x <=^r y" (at level 70, y at next level).
Reserved Notation "x >=^r y" (at level 70, y at next level, only parsing).
Reserved Notation "x <^r y" (at level 70, y at next level).
Reserved Notation "x >^r y" (at level 70, y at next level, only parsing).
Reserved Notation "x <=^r y :> T" (at level 70, y at next level).
Reserved Notation "x >=^r y :> T" (at level 70, y at next level, only parsing).
Reserved Notation "x <^r y :> T" (at level 70, y at next level).
Reserved Notation "x >^r y :> T" (at level 70, y at next level, only parsing).
Reserved Notation "<=^r y" (at level 35).
Reserved Notation ">=^r y" (at level 35).
Reserved Notation "<^r y" (at level 35).
Reserved Notation ">^r y" (at level 35).
Reserved Notation "<=^r y :> T" (at level 35, y at next level).
Reserved Notation ">=^r y :> T" (at level 35, y at next level).
Reserved Notation "<^r y :> T" (at level 35, y at next level).
Reserved Notation ">^r y :> T" (at level 35, y at next level).
Reserved Notation "x >=<^r y" (at level 70, no associativity).
Reserved Notation ">=<^r x" (at level 35).
Reserved Notation ">=<^r y :> T" (at level 35, y at next level).
Reserved Notation "x ><^r y" (at level 70, no associativity).
Reserved Notation "><^r x" (at level 35).
Reserved Notation "><^r y :> T" (at level 35, y at next level).
Reserved Notation "x <=^r y <=^r z" (at level 70, y, z at next level).
Reserved Notation "x <^r y <=^r z" (at level 70, y, z at next level).
Reserved Notation "x <=^r y <^r z" (at level 70, y, z at next level).
Reserved Notation "x <^r y <^r z" (at level 70, y, z at next level).
Reserved Notation "x <=^r y ?= 'iff' c" (at level 70, y, c at next level,
format "x '[hv' <=^r y '/' ?= 'iff' c ']'").
Reserved Notation "x <=^r y ?= 'iff' c :> T" (at level 70, y, c at next level,
format "x '[hv' <=^r y '/' ?= 'iff' c :> T ']'").
(* Reserved notation for lattice operations. *)
Reserved Notation "A `&` B" (at level 48, left associativity).
Reserved Notation "A `|` B" (at level 52, left associativity).
Reserved Notation "A `\` B" (at level 50, left associativity).
Reserved Notation "~` A" (at level 35, right associativity).
(* Reserved notation for reverse lattice operations. *)
Reserved Notation "A `&^r` B" (at level 48, left associativity).
Reserved Notation "A `|^r` B" (at level 52, left associativity).
Reserved Notation "A `\^r` B" (at level 50, left associativity).
Reserved Notation "~^r` A" (at level 35, right associativity).
Reserved Notation "\meet_ i F"
(at level 41, F at level 41, i at level 0,
format "'[' \meet_ i '/ ' F ']'").
Reserved Notation "\meet_ ( i <- r | P ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \meet_ ( i <- r | P ) '/ ' F ']'").
Reserved Notation "\meet_ ( i <- r ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \meet_ ( i <- r ) '/ ' F ']'").
Reserved Notation "\meet_ ( m <= i < n | P ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \meet_ ( m <= i < n | P ) '/ ' F ']'").
Reserved Notation "\meet_ ( m <= i < n ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \meet_ ( m <= i < n ) '/ ' F ']'").
Reserved Notation "\meet_ ( i | P ) F"
(at level 41, F at level 41, i at level 50,
format "'[' \meet_ ( i | P ) '/ ' F ']'").
Reserved Notation "\meet_ ( i : t | P ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\meet_ ( i : t ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\meet_ ( i < n | P ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \meet_ ( i < n | P ) '/ ' F ']'").
Reserved Notation "\meet_ ( i < n ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \meet_ ( i < n ) F ']'").
Reserved Notation "\meet_ ( i 'in' A | P ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \meet_ ( i 'in' A | P ) '/ ' F ']'").
Reserved Notation "\meet_ ( i 'in' A ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \meet_ ( i 'in' A ) '/ ' F ']'").
Reserved Notation "\join_ i F"
(at level 41, F at level 41, i at level 0,
format "'[' \join_ i '/ ' F ']'").
Reserved Notation "\join_ ( i <- r | P ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \join_ ( i <- r | P ) '/ ' F ']'").
Reserved Notation "\join_ ( i <- r ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \join_ ( i <- r ) '/ ' F ']'").
Reserved Notation "\join_ ( m <= i < n | P ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \join_ ( m <= i < n | P ) '/ ' F ']'").
Reserved Notation "\join_ ( m <= i < n ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \join_ ( m <= i < n ) '/ ' F ']'").
Reserved Notation "\join_ ( i | P ) F"
(at level 41, F at level 41, i at level 50,
format "'[' \join_ ( i | P ) '/ ' F ']'").
Reserved Notation "\join_ ( i : t | P ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\join_ ( i : t ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\join_ ( i < n | P ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \join_ ( i < n | P ) '/ ' F ']'").
Reserved Notation "\join_ ( i < n ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \join_ ( i < n ) F ']'").
Reserved Notation "\join_ ( i 'in' A | P ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \join_ ( i 'in' A | P ) '/ ' F ']'").
Reserved Notation "\join_ ( i 'in' A ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \join_ ( i 'in' A ) '/ ' F ']'").
Reserved Notation "\meet^r_ i F"
(at level 41, F at level 41, i at level 0,
format "'[' \meet^r_ i '/ ' F ']'").
Reserved Notation "\meet^r_ ( i <- r | P ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \meet^r_ ( i <- r | P ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( i <- r ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \meet^r_ ( i <- r ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( m <= i < n | P ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \meet^r_ ( m <= i < n | P ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( m <= i < n ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \meet^r_ ( m <= i < n ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( i | P ) F"
(at level 41, F at level 41, i at level 50,
format "'[' \meet^r_ ( i | P ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( i : t | P ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\meet^r_ ( i : t ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\meet^r_ ( i < n | P ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \meet^r_ ( i < n | P ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( i < n ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \meet^r_ ( i < n ) F ']'").
Reserved Notation "\meet^r_ ( i 'in' A | P ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \meet^r_ ( i 'in' A | P ) '/ ' F ']'").
Reserved Notation "\meet^r_ ( i 'in' A ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \meet^r_ ( i 'in' A ) '/ ' F ']'").
Reserved Notation "\join^r_ i F"
(at level 41, F at level 41, i at level 0,
format "'[' \join^r_ i '/ ' F ']'").
Reserved Notation "\join^r_ ( i <- r | P ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \join^r_ ( i <- r | P ) '/ ' F ']'").
Reserved Notation "\join^r_ ( i <- r ) F"
(at level 41, F at level 41, i, r at level 50,
format "'[' \join^r_ ( i <- r ) '/ ' F ']'").
Reserved Notation "\join^r_ ( m <= i < n | P ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \join^r_ ( m <= i < n | P ) '/ ' F ']'").
Reserved Notation "\join^r_ ( m <= i < n ) F"
(at level 41, F at level 41, i, m, n at level 50,
format "'[' \join^r_ ( m <= i < n ) '/ ' F ']'").
Reserved Notation "\join^r_ ( i | P ) F"
(at level 41, F at level 41, i at level 50,
format "'[' \join^r_ ( i | P ) '/ ' F ']'").
Reserved Notation "\join^r_ ( i : t | P ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\join^r_ ( i : t ) F"
(at level 41, F at level 41, i at level 50,
only parsing).
Reserved Notation "\join^r_ ( i < n | P ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \join^r_ ( i < n | P ) '/ ' F ']'").
Reserved Notation "\join^r_ ( i < n ) F"
(at level 41, F at level 41, i, n at level 50,
format "'[' \join^r_ ( i < n ) F ']'").
Reserved Notation "\join^r_ ( i 'in' A | P ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \join^r_ ( i 'in' A | P ) '/ ' F ']'").
Reserved Notation "\join^r_ ( i 'in' A ) F"
(at level 41, F at level 41, i, A at level 50,
format "'[' \join^r_ ( i 'in' A ) '/ ' F ']'").
Fact unit_irrelevance (x y : unit) : x = y.
Proof. by case: x; case: y. Qed.
Module Order.
(**************)
(* STRUCTURES *)
(**************)
Module POrder.
Section ClassDef.
Structure mixin_of (T : eqType) := Mixin {
le : rel T;
lt : rel T;
_ : forall x y, lt x y = (x != y) && (le x y);
_ : reflexive le;
_ : antisymmetric le;
_ : transitive le
}.
Record class_of T := Class {
base : Choice.class_of T;
mixin : mixin_of (EqType T base)
}.
Local Coercion base : class_of >-> Choice.class_of.
Structure type (disp : unit) := Pack { sort; _ : class_of sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition pack disp :=
fun b bT & phant_id (Choice.class bT) b =>
fun m => Pack disp (@Class T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> Choice.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Canonical eqType.
Canonical choiceType.
Notation porderType := type.
Notation porderMixin := mixin_of.
Notation POrderMixin := Mixin.
Notation POrderType disp T m := (@pack T disp _ _ id m).
Notation "[ 'porderType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'porderType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'porderType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'porderType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'porderType' 'of' T ]" := [porderType of T for _]
(at level 0, format "[ 'porderType' 'of' T ]") : form_scope.
Notation "[ 'porderType' 'of' T 'with' disp ]" := [porderType of T for _ with disp]
(at level 0, format "[ 'porderType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End POrder.
Import POrder.Exports.
Bind Scope cpo_sort with POrder.sort.
Module Import POrderDef.
Section Def.
Variable (display : unit).
Local Notation porderType := (porderType display).
Variable (T : porderType).
Definition le (R : porderType) : rel R := POrder.le (POrder.class R).
Local Notation "x <= y" := (le x y) : order_scope.
Definition lt (R : porderType) : rel R := POrder.lt (POrder.class R).
Local Notation "x < y" := (lt x y) : order_scope.
Definition comparable (R : porderType) : rel R :=
fun (x y : R) => (x <= y) || (y <= x).
Local Notation "x >=< y" := (comparable x y) : order_scope.
Local Notation "x >< y" := (~~ (x >=< y)) : order_scope.
Definition ge : simpl_rel T := [rel x y | y <= x].
Definition gt : simpl_rel T := [rel x y | y < x].
Definition leif (x y : T) C : Prop := ((x <= y) * ((x == y) = C))%type.
Definition le_of_leif x y C (le_xy : @leif x y C) := le_xy.1 : le x y.
CoInductive le_xor_gt (x y : T) : bool -> bool -> Set :=
| LerNotGt of x <= y : le_xor_gt x y true false
| GtrNotLe of y < x : le_xor_gt x y false true.
CoInductive lt_xor_ge (x y : T) : bool -> bool -> Set :=
| LtrNotGe of x < y : lt_xor_ge x y false true
| GerNotLt of y <= x : lt_xor_ge x y true false.
CoInductive comparer (x y : T) :
bool -> bool -> bool -> bool -> bool -> bool -> Set :=
| ComparerEq of x = y : comparer x y
true true true true false false
| ComparerLt of x < y : comparer x y
false false true false true false
| ComparerGt of y < x : comparer x y
false false false true false true.
CoInductive incomparer (x y : T) :
bool -> bool -> bool -> bool -> bool -> bool -> bool -> bool -> Set :=
| InComparerEq of x = y : incomparer x y
true true true true false false true true
| InComparerLt of x < y : incomparer x y
false false true false true false true true
| InComparerGt of y < x : incomparer x y
false false false true false true true true
| InComparer of x >< y : incomparer x y
false false false false false false false false.
End Def.
End POrderDef.
Prenex Implicits lt le leif.
Arguments ge {_ _}.
Arguments gt {_ _}.
Module Import POSyntax.
Notation "<=%O" := le : order_scope.
Notation ">=%O" := ge : order_scope.
Notation "<%O" := lt : order_scope.
Notation ">%O" := gt : order_scope.
Notation "<?=%O" := leif : order_scope.
Notation ">=<%O" := comparable : order_scope.
Notation "><%O" := (fun x y => ~~ (comparable x y)) : order_scope.
Notation "<= y" := (ge y) : order_scope.
Notation "<= y :> T" := (<= (y : T)) : order_scope.
Notation ">= y" := (le y) : order_scope.
Notation ">= y :> T" := (>= (y : T)) : order_scope.
Notation "< y" := (gt y) : order_scope.
Notation "< y :> T" := (< (y : T)) : order_scope.
Notation "> y" := (lt y) : order_scope.
Notation "> y :> T" := (> (y : T)) : order_scope.
Notation ">=< y" := (comparable y) : order_scope.
Notation ">=< y :> T" := (>=< (y : T)) : order_scope.
Notation "x <= y" := (le x y) : order_scope.
Notation "x <= y :> T" := ((x : T) <= (y : T)) : order_scope.
Notation "x >= y" := (y <= x) (only parsing) : order_scope.
Notation "x >= y :> T" := ((x : T) >= (y : T)) (only parsing) : order_scope.
Notation "x < y" := (lt x y) : order_scope.
Notation "x < y :> T" := ((x : T) < (y : T)) : order_scope.
Notation "x > y" := (y < x) (only parsing) : order_scope.
Notation "x > y :> T" := ((x : T) > (y : T)) (only parsing) : order_scope.
Notation "x <= y <= z" := ((x <= y) && (y <= z)) : order_scope.
Notation "x < y <= z" := ((x < y) && (y <= z)) : order_scope.
Notation "x <= y < z" := ((x <= y) && (y < z)) : order_scope.
Notation "x < y < z" := ((x < y) && (y < z)) : order_scope.
Notation "x <= y ?= 'iff' C" := (leif x y C) : order_scope.
Notation "x <= y ?= 'iff' C :> R" := ((x : R) <= (y : R) ?= iff C)
(only parsing) : order_scope.
Notation ">=< x" := (comparable x) : order_scope.
Notation ">=< x :> T" := (>=< (x : T)) (only parsing) : order_scope.
Notation "x >=< y" := (comparable x y) : order_scope.
Notation ">< x" := (fun y => ~~ (comparable x y)) : order_scope.
Notation ">< x :> T" := (>< (x : T)) (only parsing) : order_scope.
Notation "x >< y" := (~~ (comparable x y)) : order_scope.
Coercion le_of_leif : leif >-> is_true.
End POSyntax.
Module Lattice.
Section ClassDef.
Structure mixin_of d (T : porderType d) := Mixin {
meet : T -> T -> T;
join : T -> T -> T;
_ : commutative meet;
_ : commutative join;
_ : associative meet;
_ : associative join;
_ : forall y x, meet x (join x y) = x;
_ : forall y x, join x (meet x y) = x;
_ : forall x y, (x <= y) = (meet x y == x);
_ : left_distributive meet join;
}.
Record class_of d (T : Type) := Class {
base : POrder.class_of T;
mixin : mixin_of (POrder.Pack d base)
}.
Local Coercion base : class_of >-> POrder.class_of.
Structure type (display : unit) :=
Pack { sort; _ : class_of display sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack b0 (m0 : mixin_of (@POrder.Pack disp T b0)) :=
fun bT b & phant_id (@POrder.class disp bT) b =>
fun m & phant_id m0 m => Pack (@Class disp T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> POrder.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> POrder.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Notation latticeType := type.
Notation latticeMixin := mixin_of.
Notation LatticeMixin := Mixin.
Notation LatticeType T m := (@pack T _ _ m _ _ id _ id).
Notation "[ 'latticeType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'latticeType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'latticeType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'latticeType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'latticeType' 'of' T ]" := [latticeType of T for _]
(at level 0, format "[ 'latticeType' 'of' T ]") : form_scope.
Notation "[ 'latticeType' 'of' T 'with' disp ]" := [latticeType of T for _ with disp]
(at level 0, format "[ 'latticeType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End Lattice.
Export Lattice.Exports.
Module Import LatticeDef.
Section LatticeDef.
Context {display : unit}.
Local Notation latticeType := (latticeType display).
Definition meet {T : latticeType} : T -> T -> T := Lattice.meet (Lattice.class T).
Definition join {T : latticeType} : T -> T -> T := Lattice.join (Lattice.class T).
End LatticeDef.
End LatticeDef.
Module Import LatticeSyntax.
Notation "x `&` y" := (meet x y).
Notation "x `|` y" := (join x y).
End LatticeSyntax.
Module Total.
Section ClassDef.
Local Notation mixin_of T := (total (<=%O : rel T)).
Record class_of d (T : Type) := Class {
base : Lattice.class_of d T;
mixin : total (<=%O : rel (POrder.Pack d base))
}.
Local Coercion base : class_of >-> Lattice.class_of.
Structure type d := Pack { sort; _ : class_of d sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack b0 (m0 : mixin_of (@Lattice.Pack disp T b0)) :=
fun bT b & phant_id (@Lattice.class disp bT) b =>
fun m & phant_id m0 m => Pack (@Class disp T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
Definition latticeType := @Lattice.Pack disp cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> Lattice.class_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> POrder.type.
Coercion latticeType : type >-> Lattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Notation orderType := type.
Notation OrderType T m := (@pack T _ _ m _ _ id _ id).
Notation "[ 'orderType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'orderType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'orderType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'orderType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'orderType' 'of' T ]" := [orderType of T for _]
(at level 0, format "[ 'orderType' 'of' T ]") : form_scope.
Notation "[ 'orderType' 'of' T 'with' disp ]" := [orderType of T for _ with disp]
(at level 0, format "[ 'orderType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End Total.
Import Total.Exports.
Module BLattice.
Section ClassDef.
Structure mixin_of d (T : porderType d) := Mixin {
bottom : T;
_ : forall x, bottom <= x;
}.
Record class_of d (T : Type) := Class {
base : Lattice.class_of d T;
mixin : mixin_of (POrder.Pack d base)
}.
Local Coercion base : class_of >-> Lattice.class_of.
Structure type d := Pack { sort; _ : class_of d sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack b0 (m0 : mixin_of (@Lattice.Pack disp T b0)) :=
fun bT b & phant_id (@Lattice.class disp bT) b =>
fun m & phant_id m0 m => Pack (@Class disp T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
Definition latticeType := @Lattice.Pack disp cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> Lattice.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> POrder.type.
Coercion latticeType : type >-> Lattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Notation blatticeType := type.
Notation blatticeMixin := mixin_of.
Notation BLatticeMixin := Mixin.
Notation BLatticeType T m := (@pack T _ _ m _ _ id _ id).
Notation "[ 'blatticeType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'blatticeType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'blatticeType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'blatticeType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'blatticeType' 'of' T ]" := [blatticeType of T for _]
(at level 0, format "[ 'blatticeType' 'of' T ]") : form_scope.
Notation "[ 'blatticeType' 'of' T 'with' disp ]" := [blatticeType of T for _ with disp]
(at level 0, format "[ 'blatticeType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End BLattice.
Export BLattice.Exports.
Module Import BLatticeDef.
Definition bottom {disp : unit} {T : blatticeType disp} : T :=
BLattice.bottom (BLattice.class T).
End BLatticeDef.
Module Import BLatticeSyntax.
Notation "0" := bottom : order_scope.
Notation "\join_ ( i <- r | P ) F" :=
(\big[@join _ _/0%O]_(i <- r | P%B) F%O) : order_scope.
Notation "\join_ ( i <- r ) F" :=
(\big[@join _ _/0%O]_(i <- r) F%O) : order_scope.
Notation "\join_ ( i | P ) F" :=
(\big[@join _ _/0%O]_(i | P%B) F%O) : order_scope.
Notation "\join_ i F" :=
(\big[@join _ _/0%O]_i F%O) : order_scope.
Notation "\join_ ( i : I | P ) F" :=
(\big[@join _ _/0%O]_(i : I | P%B) F%O) (only parsing) : order_scope.
Notation "\join_ ( i : I ) F" :=
(\big[@join _ _/0%O]_(i : I) F%O) (only parsing) : order_scope.
Notation "\join_ ( m <= i < n | P ) F" :=
(\big[@join _ _/0%O]_(m <= i < n | P%B) F%O) : order_scope.
Notation "\join_ ( m <= i < n ) F" :=
(\big[@join _ _/0%O]_(m <= i < n) F%O) : order_scope.
Notation "\join_ ( i < n | P ) F" :=
(\big[@join _ _/0%O]_(i < n | P%B) F%O) : order_scope.
Notation "\join_ ( i < n ) F" :=
(\big[@join _ _/0%O]_(i < n) F%O) : order_scope.
Notation "\join_ ( i 'in' A | P ) F" :=
(\big[@join _ _/0%O]_(i in A | P%B) F%O) : order_scope.
Notation "\join_ ( i 'in' A ) F" :=
(\big[@join _ _/0%O]_(i in A) F%O) : order_scope.
End BLatticeSyntax.
Module TBLattice.
Section ClassDef.
Structure mixin_of d (T : porderType d) := Mixin {
top : T;
_ : forall x, x <= top;
}.
Record class_of d (T : Type) := Class {
base : BLattice.class_of d T;
mixin : mixin_of (POrder.Pack d base)
}.
Local Coercion base : class_of >-> BLattice.class_of.
Structure type d := Pack { sort; _ : class_of d sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack b0 (m0 : mixin_of (@BLattice.Pack disp T b0)) :=
fun bT b & phant_id (@BLattice.class disp bT) b =>
fun m & phant_id m0 m => Pack (@Class disp T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
Definition latticeType := @Lattice.Pack disp cT xclass.
Definition blatticeType := @BLattice.Pack disp cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> BLattice.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion porderType : type >-> POrder.type.
Coercion latticeType : type >-> Lattice.type.
Coercion blatticeType : type >-> BLattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Canonical blatticeType.
Notation tblatticeType := type.
Notation tblatticeMixin := mixin_of.
Notation TBLatticeMixin := Mixin.
Notation TBLatticeType T m := (@pack T _ _ m _ _ id _ id).
Notation "[ 'tblatticeType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'tblatticeType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'tblatticeType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'tblatticeType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'tblatticeType' 'of' T ]" := [tblatticeType of T for _]
(at level 0, format "[ 'tblatticeType' 'of' T ]") : form_scope.
Notation "[ 'tblatticeType' 'of' T 'with' disp ]" := [tblatticeType of T for _ with disp]
(at level 0, format "[ 'tblatticeType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End TBLattice.
Export TBLattice.Exports.
Module Import TBLatticeDef.
Definition top disp {T : tblatticeType disp} : T :=
TBLattice.top (TBLattice.class T).
End TBLatticeDef.
Module Import TBLatticeSyntax.
Notation "1" := top : order_scope.
Notation "\meet_ ( i <- r | P ) F" :=
(\big[meet/1]_(i <- r | P%B) F%O) : order_scope.
Notation "\meet_ ( i <- r ) F" :=
(\big[meet/1]_(i <- r) F%O) : order_scope.
Notation "\meet_ ( i | P ) F" :=
(\big[meet/1]_(i | P%B) F%O) : order_scope.
Notation "\meet_ i F" :=
(\big[meet/1]_i F%O) : order_scope.
Notation "\meet_ ( i : I | P ) F" :=
(\big[meet/1]_(i : I | P%B) F%O) (only parsing) : order_scope.
Notation "\meet_ ( i : I ) F" :=
(\big[meet/1]_(i : I) F%O) (only parsing) : order_scope.
Notation "\meet_ ( m <= i < n | P ) F" :=
(\big[meet/1]_(m <= i < n | P%B) F%O) : order_scope.
Notation "\meet_ ( m <= i < n ) F" :=
(\big[meet/1]_(m <= i < n) F%O) : order_scope.
Notation "\meet_ ( i < n | P ) F" :=
(\big[meet/1]_(i < n | P%B) F%O) : order_scope.
Notation "\meet_ ( i < n ) F" :=
(\big[meet/1]_(i < n) F%O) : order_scope.
Notation "\meet_ ( i 'in' A | P ) F" :=
(\big[meet/1]_(i in A | P%B) F%O) : order_scope.
Notation "\meet_ ( i 'in' A ) F" :=
(\big[meet/1]_(i in A) F%O) : order_scope.
End TBLatticeSyntax.
Module CBLattice.
Section ClassDef.
Structure mixin_of d (T : blatticeType d) := Mixin {
sub : T -> T -> T;
_ : forall x y, y `&` sub x y = bottom;
_ : forall x y, (x `&` y) `|` sub x y = x
}.
Record class_of d (T : Type) := Class {
base : BLattice.class_of d T;
mixin : mixin_of (BLattice.Pack base)
}.
Local Coercion base : class_of >-> BLattice.class_of.
Structure type d := Pack { sort; _ : class_of d sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack b0 (m0 : mixin_of (@BLattice.Pack disp T b0)) :=
fun bT b & phant_id (@BLattice.class disp bT) b =>
fun m & phant_id m0 m => Pack (@Class disp T b m).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
Definition latticeType := @Lattice.Pack disp cT xclass.
Definition blatticeType := @BLattice.Pack disp cT xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> BLattice.class_of.
Coercion mixin : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> POrder.type.
Coercion latticeType : type >-> Lattice.type.
Coercion blatticeType : type >-> BLattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Canonical blatticeType.
Notation cblatticeType := type.
Notation cblatticeMixin := mixin_of.
Notation CBLatticeMixin := Mixin.
Notation CBLatticeType T m := (@pack T _ _ m _ _ id _ id).
Notation "[ 'cblatticeType' 'of' T 'for' cT ]" := (@clone T _ cT _ _ erefl id)
(at level 0, format "[ 'cblatticeType' 'of' T 'for' cT ]") : form_scope.
Notation "[ 'cblatticeType' 'of' T 'for' cT 'with' disp ]" :=
(@clone T _ cT disp _ (unit_irrelevance _ _) id)
(at level 0, format "[ 'cblatticeType' 'of' T 'for' cT 'with' disp ]") : form_scope.
Notation "[ 'cblatticeType' 'of' T ]" := [cblatticeType of T for _]
(at level 0, format "[ 'cblatticeType' 'of' T ]") : form_scope.
Notation "[ 'cblatticeType' 'of' T 'with' disp ]" := [cblatticeType of T for _ with disp]
(at level 0, format "[ 'cblatticeType' 'of' T 'with' disp ]") : form_scope.
End Exports.
End CBLattice.
Export CBLattice.Exports.
Module Import CBLatticeDef.
Definition sub {disp : unit} {T : cblatticeType disp} : T -> T -> T :=
CBLattice.sub (CBLattice.class T).
End CBLatticeDef.
Module Import CBLatticeSyntax.
Notation "x `\` y" := (sub x y).
End CBLatticeSyntax.
Module CTBLattice.
Section ClassDef.
Record mixin_of d (T : tblatticeType d) (sub : T -> T -> T) := Mixin {
compl : T -> T;
_ : forall x, compl x = sub top x
}.
Record class_of d (T : Type) := Class {
base : TBLattice.class_of d T;
mixin1 : CBLattice.mixin_of (BLattice.Pack base);
mixin2 : @mixin_of d (TBLattice.Pack base) (CBLattice.sub mixin1)
}.
Local Coercion base : class_of >-> TBLattice.class_of.
Local Coercion base2 d T (c : class_of d T) :=
CBLattice.Class (mixin1 c).
Structure type d := Pack { sort; _ : class_of d sort }.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (disp : unit) (cT : type disp).
Definition class := let: Pack _ c as cT' := cT return class_of _ cT' in c.
Definition clone disp' c of (disp = disp') & phant_id class c :=
@Pack disp' T c.
Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of _ xT).
Definition pack :=
fun bT b & phant_id (@TBLattice.class disp bT)
(b : TBLattice.class_of disp T) =>
fun m1T m1 & phant_id (@CBLattice.class disp m1T)
(@CBLattice.Class disp T b m1) =>
fun (m2 : @mixin_of disp (@TBLattice.Pack disp T b) (CBLattice.sub m1)) =>
Pack (@Class disp T b m1 m2).
Definition eqType := @Equality.Pack cT xclass.
Definition choiceType := @Choice.Pack cT xclass.
Definition porderType := @POrder.Pack disp cT xclass.
Definition latticeType := @Lattice.Pack disp cT xclass.
Definition blatticeType := @BLattice.Pack disp cT xclass.
Definition tblatticeType := @TBLattice.Pack disp cT xclass.
Definition cblatticeType := @CBLattice.Pack disp cT xclass.
Definition tbd_cblatticeType :=
@CBLattice.Pack disp tblatticeType xclass.
End ClassDef.
Module Import Exports.
Coercion base : class_of >-> TBLattice.class_of.
Coercion base2 : class_of >-> CBLattice.class_of.
Coercion mixin1 : class_of >-> CBLattice.mixin_of.
Coercion mixin2 : class_of >-> mixin_of.
Coercion sort : type >-> Sortclass.
Coercion eqType : type >-> Equality.type.
Coercion choiceType : type >-> Choice.type.
Coercion porderType : type >-> POrder.type.
Coercion latticeType : type >-> Lattice.type.
Coercion blatticeType : type >-> BLattice.type.
Coercion tblatticeType : type >-> TBLattice.type.
Coercion cblatticeType : type >-> CBLattice.type.
Canonical eqType.
Canonical choiceType.
Canonical porderType.
Canonical latticeType.
Canonical blatticeType.
Canonical tblatticeType.
Canonical cblatticeType.