• Keine Ergebnisse gefunden

Definition 7.9 Ist σ : sig 0 → sig Signaturmorphismus, A , B sig-Algebren und h : A → B sig-Homomorphismus, dann ist h| σ := {h σ(s ) | s ∈ S 0 }, wobei sig 0 = (S 0 , F 0 , τ 0 ), ein

N/A
N/A
Protected

Academic year: 2021

Aktie "Definition 7.9 Ist σ : sig 0 → sig Signaturmorphismus, A , B sig-Algebren und h : A → B sig-Homomorphismus, dann ist h| σ := {h σ(s ) | s ∈ S 0 }, wobei sig 0 = (S 0 , F 0 , τ 0 ), ein"

Copied!
19
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Signaturmorphismen - Parameterübergabe

Vergißbilder für Homomorphismen

Definition 7.9 Ist σ : sig 0 → sig Signaturmorphismus, A , B sig-Algebren und h : A → B sig-Homomorphismus, dann ist h| σ := {h σ(s ) | s ∈ S 0 }, wobei sig 0 = (S 0 , F 0 , τ 0 ), ein

sig 0 -Homomorphismus:

(h| σ ) s = h σ(s ) : A σ(s ) → B σ(s )

q q

(A| σ ) s → (B | σ ) s

h| σ heißt Vergißbild von h entlang σ

(2)

Signaturmorphismen - Parameterübergabe

Vergißbilder

Eigenschaften von h| σ ( Vergißbild von h entlang σ) sig 0 σ - sig σ 0 - sig 00

ALG(sig 0 ) | σ

ALG(sig) | σ

0

ALG(sig 00 )

∈ ∈ ∈ ∈

A | σ h|

σ

B | σ A → h B

Verträglichkeit mit Identität, Komposition und Homomorphismen.

(3)

Signaturmorphismen - Parameterübergabe

Parameterspezifikation

ALG(Formal) | incl

ALG(Body) Formal

incl - Body

Actual σ

?

incl’ - Value σ 0

? ALG(Actual)

| σ 6

| incl’ ALG(Value)

| σ

0

6

(4)

Signaturmorphismen - Parameterübergabe

Parameterspezifikation

σ : sig 0 → sig, A , B , sig-Algebren.

h : A → B , sig-Homomorphismus.

σ = {h σ(s ) | s ∈ S 0 }, sig 0 = (S 0 , F 0 , τ 0 ) = mit hσ σ : A| σ → B | σ Vergißbild von h entlang σ.

σ 0 ◦ σ

-

sig 0 σ - sig σ 0 - sig 00

Alg(sig 0 ) ←− |

σ

Alg(sig) ←−Alg(sig |

σ0

00 )

|

0

◦σ)

(5)

Signaturmorphismen - Parameterübergabe

Parameterspezifikation

A | σ | σ

A

B | σ h| σ

? | σ

B h

?

(6)

Semantik der Parameterübergabe (nur Signatur)

Semantik der Parameterübergabe (nur Signatur)

Definition 7.10 Sei Body[Formal] Parameterspezifikation.

σ : Formal → Actual Signaturmorphismus.

Semantik der Parameterübergabe [Actual, σ].

Zuordnung: σ : Formal → Actual

initiale Semantik von Value. D. h.

T Body[Actual,σ]

Betrachte: S ::(T Actual , σ) 7→ T Body[Actual,σ]

Abbildung zwischen init Algebren. Kann aufgefasst werden als Zuordnung

zwischen Formal Algebren → Body-Algebren.

(7)

Semantik der Parameterübergabe (nur Signatur)

Semantik Parameterübergabe

(T Actual | σ 7→ (T Body[Actual,σ] )| σ

0

Actual

- Body[Actual, σ ]

T Body[Actual,σ]

init-Sem.

?

(T Body[Actual,σ] ) |

incl

Vergissbild

?

h init : T Actual init-Sem.

? - (T Body[Actual,σ] ) |

Actual

(8)

Semantik der Parameterübergabe (nur Signatur)

Abbildung zwischen init Algebren

((T Value ) |

σ0

) |

Formal

| incl

T Value ) |

σ0

-

( h

init

)

|σ

(T Actual ) |

σ

Formal

incl - Body

Actual σ

?

incl’ - Value σ 0

?

.

h

init

T Actual

| σ 6

(T Value ) |

Actual

| σ 6

| incl’ T Value

| σ

0

6

(9)

Semantik der Parameterübergabe (nur Signatur)

Abbildung zwischen init Algebren

Formal

sorts elem

ops a, b :→ elem eqns a = b

elem → nat

−→ σ

a → 0 b → 1

Actual

sorts nat

ops 0, 1 :→ nat

A = T Actual A nat = {0, 1}

A | σ ∈ Alg(sig Formal) (A| σ ) elem = {0, 1}

a| A

|

σ

= 0 6= 1 = b| A

|

Gleichung von Formal nicht erfüllt! D. h.

σ

A | σ 6∈ Alg(Formal).

(10)

Semantik der Parameterübergabe (nur Signatur)

Parameterübergabe (Actual , σ )

Body[Formal]

σ : sig(Formal) → sig(Actual) Signatur Morphismus

Formal

incl - Body

Actual σ

?

incl’ - Value = Body[Formal, σ ]

σ 0 (mit Umbenennung)

?

Vor: sig(Actual) und sig(Value) strikt.

(11)

Semantik der Parameterübergabe (nur Signatur)

Parameterübergabe (Actual , σ )

Vergißbilder: | σ : Alg(sig) → Alg(sig 0 )

A | σ für σ : sig 0 → sig h : A → L sig-Homomorphismus

h| σ : A | σ → L | σ

sig 0 -Homomorphismus

(12)

Semantik der Parameterübergabe (nur Signatur)

Parameterübergabe (Actual , σ )

((T Value ) |

σ0

) |

Formal

| incl

T Value ) |

σ0

-

(h

init

)

|σ

(T Actual ) |

σ

∈ Alg(Formal)

.

h

init

T Actual

| σ 6

(T Value ) |

Actual

| σ 6

| incl’ T Value

| σ

0

6

Probleme: 1) (T Actual )| σ 6∈ Alg(Formal), 2) h init keine Bijektion.

(13)

Spezifikationsmorphismus

Spezifikationsmorphismus

Definition

Seien spec 0 = (sig 0 , E 0 ), spec = (sig, E ) (allg.) Spezifikationen. Ein

Signaturmorphismus σ : sig 0 → sig heißt Spezifikationsmorphismus, falls für alle s = t ∈ E 0 gilt σ(s ) = σ(t ) ∈ Th(E ).

Schreibe: σ : spec 0 → spec

Fakt: Für A ∈ Alg(spec) gilt A | σ ∈ Alg(spec 0 ) D. h. | σ : Alg(spec) → Alg(spec 0 )!

Oft verlangt man „nur“ σ(s ) = σ(t ) ∈ ITh(E ).!

(14)

Spezifikationsmorphismus

Spezifikationsmorphismus

Eine Parameterübergabe für Body[Formal] ist ein Paar (Actual, σ):

Actual Spezifikation und σ : Formal → Actual Spezifikationsmorphismus.

(T Actual )| σ ∈ Alg(Formal)

- verlange auch h init Bijektion, syntaktische Einschränkungen.

Spezifikationssprachen

CLEAR, Act-one, -Cip-C, Affirm, ASL, Aspik, OBJ, ASF,

+ neuere

Sprachen: - Spectrum, - Troll.

(15)

Spezifikationsmorphismus

Beispiel

Beispiel 7.7

Formal ::

 

 

 

 

 

 

 

 

 

spec ELEMENT use BOOL

sorts elem

ops . ≤ . : elem, elem → bool eqns x ≤ x = true

imp(x ≤ x and y ≤ z , x ≤ z ) = true

x ≤ y or y ≤ x = true

(16)

Spezifikationsmorphismus

Beispiel (Forts.)

spec LIST[ELEMENT]

use ELEMENT

sorts list

ops nil :→ list

· : elem, list → list

insert : elem, list → list

case : bool, list, list → list

sorted : list → bool

(17)

Spezifikationsmorphismus

Beispiel (Forts.)

eqns insert(x , nil) = x .nil

insert(x , y .l ) = case(x ≤ y , x . insert(y , l ), y . insert(x , l )) case(true, l 1 , l 2 ) = l 1

case(false, l 1 , l 2 ) = l 2 sorted(nil) = true sorted(x , nil) = true

sorted(x , y , l ) = if x ≤ y then sorted(y , l ) else false

Eigenschaft: sorted(insert(x , l )) = true

(18)

Spezifikationsmorphismus

Beispiel (Forts)

ACTUAL ≡ BOOL

σ : elem → bool, bool → bool . ≤ . → impl

Die Gleichungen von ELEMENT sind in Th(BOOL)

Spezifikationsmorphismus

(19)

Spezifikationsmorphismus

Beispiel (Forts.)

ACTUAL ≡ NAT

σ : bool → nat elem → nat true → suc(0) nicht erlaubt false → 0

not → suc or → plus and → times .. .

. ≤ . → · · ·

kein Spezifikationsmorphismus not(false) = true

not(true) = false gilt nicht!.

Abbildung

Abbildung zwischen init Algebren
Abbildung zwischen init Algebren

Referenzen

ÄHNLICHE DOKUMENTE

[r]

Seit Juli 2006 fördert Oxfam Deutschland deshalb zusammen mit Oxfam Australien und Oxfam Irland lokale Organisationen in Simbabwe.. Sie bieten

Oxfam ist nach wie vor überzeugt, dass politische und wirtschaftliche Rahmenbedingungen verändert werden müssen, um Armut zu überwinden. Not- und Katastrophenhilfe,

Universit¨ at T¨ ubingen T¨ ubingen, den 24.01.2018 Mathematisches

Universit¨ at T¨ ubingen T¨ ubingen, den 26.01.2016 Mathematisches

Die untenstehenden Grafiken zeigen, dass die Form der Verteilung des Mittelwerts von unabh¨ angigen Zufallsvariablen auch dann der Normalverteilung immer ¨ ahnlicher wird, wenn

Die Schließungseigenschaft ergibt sich daraus, dass die sukzessive Spiegelung an einer ungeraden Anzahl kopunktaler Geraden auf eine einzige Geradenspiegelung reduziert

Nun verändern wir eine Kopie des Dreieckes mit dem Längenfaktor λ und setzen diese Kopie verdreht gemäß Abbildung 2 an... In der Situation der Abbildung 3 ist es nun so,