---
layout: default
title : "Examples.Structures.Signatures module (Agda Universal Algebra Library)"
date : "2021-07-16"
author: "agda-algebras development team"
---

### Example signatures for general structures

This is the [Examples.Structures.Signatures][] module of the [Agda Universal Algebra Library][].

Eight tiny signatures for the general `structure` type of the frozen `Legacy.Base`
tree, named by an arity-counting convention: position `k` of the digit string
counts the symbols of arity `k`, so `S001` has one binary symbol and `S111` has one
nullary, one unary, and one binary.  They give the structure examples of
[Examples.Structures.Basic][] and the finite-CSP exercises of
[Exercises.Complexity.FiniteCSP][] something concrete to instantiate.

<!--
```agda
{-# OPTIONS --without-K --exact-split --safe #-}

module Examples.Structures.Signatures where

-- Imports from the Agda Standard Library -------------------------------------
open import Data.Empty                    using () renaming ( ⊄ to šŸ˜ )
open import Data.Unit.Base                using () renaming ( ⊤ to šŸ™ ; tt to šŸŽ )
open import Level                         using () renaming ( 0ā„“ to ā„“ā‚€ )

open import Overture                      using ( šŸš ; šŸ› )
open import Legacy.Base.Structures.Basic  using ( signature )
```
-->


#### Examples of finite signatures

Each is a `signature` record whose `symbol` type is `šŸ˜`, `šŸ™`, `šŸš`, or `šŸ›` and
whose arity map sends a symbol to the finite type of its argument positions: `Sāˆ…`
(no symbols, so bare sets), `S1` (one constant, pointed sets), `S01` (one unary),
`S001` (one binary, magmas and their kin), `S0001` (one ternary, the NAE-3-SAT
relation), `S021` (two unary and one binary), `S101` (one constant and one binary,
monoids), and `S111` (one constant, one unary, and one binary, groups).

```agda
-- The signature with...

-- ... no symbols  (e.g., sets)
Sāˆ… : signature ā„“ā‚€ ā„“ā‚€
Sāˆ… = record { symbol = šŸ˜ ; arity = Ī» () }

-- ... one nullary symbol (e.g., pointed sets)
S1 : signature ā„“ā‚€ ā„“ā‚€
S1 = record { symbol = šŸ™ ; arity = Ī» _ → šŸ˜ }

S01 : signature ā„“ā‚€ ā„“ā‚€ -- ...one unary
S01 = record { symbol = šŸ™ ; arity = Ī» _ → šŸ™ }

-- ...one binary symbol (e.g., magmas, semigroups, semilattices)
S001 : signature ā„“ā‚€ ā„“ā‚€
S001 = record { symbol = šŸ™ ; arity = Ī» _ → šŸš }

-- ...one ternary symbol (e.g., boolean NAE-3-SAT relational structure)
S0001 : signature ā„“ā‚€ ā„“ā‚€
S0001 = record { symbol = šŸ™ ; arity = Ī» _ → šŸ› }

-- ...0 nullary, 2 unary, and 1 binary
S021 : signature ā„“ā‚€ ā„“ā‚€
S021 = record { symbol = šŸ› ; arity = Ī»{ šŸ›.šŸŽ → šŸš ; šŸ›.šŸ → šŸ™ ; šŸ›.šŸ → šŸ™ } }

-- ...one nullary and one binary (e.g., monoids)
S101 : signature ā„“ā‚€ ā„“ā‚€
S101 = record { symbol = šŸš ; arity = Ī»{ šŸš.šŸŽ → šŸ˜ ; šŸš.šŸ → šŸš } }

-- ...one nullary, one unary, and one binary (e.g., groups)
S111 : signature ā„“ā‚€ ā„“ā‚€
S111 = record { symbol = šŸ› ; arity = Ī»{ šŸ›.šŸŽ → šŸ˜ ; šŸ›.šŸ → šŸ™ ; šŸ›.šŸ → šŸš } }
```