Examples.Structures.Basic¶
Examples of Structures¶
This is the Examples.Structures.Basic module of the Agda Universal Algebra Library.
Two tiny worked examples of the general structure type of the frozen
Legacy.Base tree, which packages operation symbols and relation symbols in one
signature pair: a purely algebraic structure and a purely relational one. The
signatures come from Examples.Structures.Signatures.
SL is a three-element meet semilattice presented as a structure with one binary
operation symbol (S001) and no relation symbols (Sā
). The meet of two distinct
elements is š, so the induced order has bottom š below the incomparable pair
š, š.
-- An example of a (purely) algebraic structure is a 3-element meet semilattice. SL : structure S001 -- (one binary operation symbol) Sā -- (no relation symbols) {Ļ = 0ā} SL = record { carrier = š ; op = Ī» _ x ā meet (x š.š) (x š.š) ; rel = Ī» () } where meet : š ā š ā š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š meet š.š š.š = š.š
An example of a (purely) relational structure is the 2 element structure with the ternary NAE-3-SAT relation, R = S³ - {(0,0,0), (1,1,1)} (where S = {0, 1}).
data NAE3SAT : Pred (š Ć š Ć š) 0ā where r1 : (š.š , š.š , š.š) ā NAE3SAT r2 : (š.š , š.š , š.š) ā NAE3SAT r3 : (š.š , š.š , š.š) ā NAE3SAT r4 : (š.š , š.š , š.š) ā NAE3SAT r5 : (š.š , š.š , š.š) ā NAE3SAT r6 : (š.š , š.š , š.š) ā NAE3SAT nae3sat : structure Sā -- (no operation symbols) S0001 -- (one ternary relation symbol) nae3sat = record { carrier = š ; op = Ī» () ; rel = Ī» _ x ā ((x š.š) , (x š.š) , (x š.š)) ā NAE3SAT }