19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Function/method name lookup: Fname(fd) = f<br />

−−−−−−−−−−−→<br />

Fname(fαextends { −→ K}( −→ x:τ):τ = e) = f<br />

Types of values: type(v) = τ<br />

type(O −→ τ ( −→ v )) = O −→ τ <br />

Finding witnesses from the static type of the receiver: witness p (τ, τ) = S<br />

witness p (τ, τ ′ ) =<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

[ ] if τ ′ = Object<br />

match(C −→ τ , C −→ τ ′ ) if τ = C −→ τ and τ ′ = C −→ τ ′ <br />

S n · · · S 1 if τ = C −→ τ , τ ′ = C ′ −→ τ ′ , C ≠ C ′ ,<br />

C −−−−−−−−−→ αextends extends { −→ N } ∈ p,<br />

and witness p ([ −→ τ / −→ α ]N i , C ′ −→ τ ′ ) = S i for N i ∈ { −→ N }<br />

[ ] otherwise<br />

Match two types to get substitutions: match(τ, τ) = S<br />

match(τ, τ ′ ) =<br />

⎧<br />

⎪⎨<br />

⎪⎩<br />

[ ] if τ = τ ′<br />

[τ ′ /β] if τ = β<br />

S n · · · S 1 if τ = C −→ τ , τ ′ = C −→ τ ′ , and match(S i−1 · · · S 1 τ i , τ ′ i ) = S i for 1 ≤ i ≤ n<br />

[ ] otherwise<br />

Figure A.8: Dynamic Semantics of Core <strong>Fortress</strong> with Where Clauses (II)<br />

321

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!