Stosy - struktura algebraiczna

Z Lem
Skocz do: nawigacji, wyszukiwania

Stosy to struktura algebraiczna znajdująca wiele zastosowań w informatyce.
Definicja
Struktura algebraiczna

[math]A = \langle E \cup S; w, u, p, e, =\rangle [/math]


której uniwersum jest sumą dwu rozłącznych zbiorów [math]E[/math] i [math]S[/math], z działaniami
[math]w\colon E \times S \rightarrow S [/math]
[math]u\colon S \rightarrow S [/math]
[math]n\colon S \rightarrow E [/math]
[math]e\colon S \rightarrow \{true, false\}[/math]
[math]=_E \colon E \times E \rightarrow \{true, false\} [/math]
[math]=_S \colon S \times S \rightarrow \{true, false\} [/math]
które zapewniają prawdziwość następującego zbioru aksjomatów
[math]\forall_{e \in E}\,\forall_{s \in S} \lnot n(w(e,s)) [/math]
[math]\forall_{e \in E}\,\forall_{s \in S} p(w(e,s)) =_E e [/math]
[math]\forall_{e \in E}\,\forall_{s \in S} u(w(e,s)) =_S s [/math]
[math]\forall_{e \in E}\,\forall_{s \in S} \lnot n(s) \implies w(p(s),u(s)) =_S s [/math]
[math]\forall_{s \in S} \{\mathbf{while}\ \lnot n(s) \ \mathbf{do} \ s:= u(s) \ \mathbf{od}\}\ \ltn(s)[/math]