Articulo de referencia

Algebraic semantics (computer science)

In computer science , algebraic semantics is a form of axiomatic semantics based on algebraic laws for describing and reasoning about program specifications in a formal manner. ...

In computer science, algebraic semantics is a form of axiomatic semantics based on algebraic laws for describing and reasoning about program specifications in a formal manner.[1][2][3][4]

Syntax

The syntax of an algebraic specification is formulated in two steps: (1) defining a formal signature of data types and operation symbols, and (2) interpreting the signature through sets and functions.

Definition of a signature

The signature of an algebraic specification defines its formal syntax. The word "signature" is used like the concept of "key signature" in musical notation.

A signature consists of a set S {\displaystyle S} of data types, known as sorts, together with a family Σ {\displaystyle \Sigma } of sets, each set containing operation symbols (or simply symbols) that relate the sorts. We use Σ s 1 s 2 . . . s n ,   s {\displaystyle \Sigma _{s_{1}s_{2}...s_{n},~s}} to denote the set of operation symbols relating the sorts s 1 ,   s 2 ,   . . . ,   s n S {\displaystyle s_{1},~s_{2},~...,~s_{n}\in S} to the sort s S {\displaystyle s\in S} .

For example, for the signature of integer stacks, we define two sorts, namely, i n t {\displaystyle int} and s t a c k {\displaystyle stack} , and the following family of operation symbols:

Σ Λ ,   s t a c k = { n e w } Σ i n t   s t a c k ,   s t a c k = { p u s h } Σ s t a c k ,   s t a c k = { p o p } Σ s t a c k ,   i n t = { d e p t h , t o p } {\displaystyle {\begin{aligned}\Sigma _{\Lambda ,~stack}&=\{{\rm {new}}\}\\\Sigma _{int~stack,~stack}&=\{{\rm {push}}\}\\\Sigma _{stack,~stack}&=\{{\rm {pop}}\}\\\Sigma _{stack,~int}&=\{{\rm {depth}},{\rm {top}}\}\\\end{aligned}}}

where Λ {\displaystyle \Lambda } denotes the empty string.

Set-theoretic interpretation of signature

An algebra A {\displaystyle A} interprets the sorts and operation symbols as sets and functions. Each sort s {\displaystyle s} is interpreted as a set A s {\displaystyle A_{s}} , which is called the carrier of A {\displaystyle A} of sort s {\displaystyle s} , and each symbol σ {\displaystyle \sigma } in Σ s 1 s 2 . . . s n ,   s {\displaystyle \Sigma _{s_{1}s_{2}...s_{n},~s}} is mapped to a function σ A : A s 1 × A s 2 ×   . . . ×   A s n {\displaystyle \sigma _{A}:A_{s_{1}}\times A_{s_{2}}\times ~...\times ~A_{s_{n}}} , which is called an operation of A {\displaystyle A} .

With respect to the signature of integer stacks, we interpret the sort i n t {\displaystyle int} as the set Z {\displaystyle \mathbb {Z} } of integers, and interpret the sort s t a c k {\displaystyle stack}