Library UniMath.Algebra.Universal.Signatures

Signatures for universal algebra.

Gianluca Amato, Marco Maggesi, Cosimo Perini Brogi 2019-2021

Require Import UniMath.MoreFoundations.Notations.
Require Import UniMath.Combinatorics.StandardFiniteSets.

Require Export UniMath.Combinatorics.DecSet.
Require Import UniMath.Combinatorics.MoreLists.

Local Open Scope stn.

A signature is given by a decidable set of sorts, a set of of operation symbols and a map from operation symbols to pair (l,, s) where l is the arity (or domain) and s is the sort (or range).

Definition signature : UU := (S: decSet) (O: hSet), O list S × S.

Definition sorts (σ: signature) := pr1 σ.

Definition names (σ: signature) := pr12 σ.

Definition ar (σ: signature) := pr22 σ.

Definition arity {σ: signature} (nm: names σ) : list (sorts σ) := pr1 (ar σ nm).

Definition sort {σ: signature} (nm: names σ) : sorts σ := pr2 (ar σ nm).

Helper function for creating signatures.
A signature may be alternatively specified trough a signature_simple. In a simple signature, the types for sorts and operation symbols are standard finite sets, and the map from operations symbols to domain and range is replaced by a list. In this way, the definition of a new signature is made simpler.
We have decided to define new types for simple signatures instead of only defining helper functions, since this make it simpler to define simplified means of defining a new algebra, too.