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.

Proof. We prove this for δ, but the case for σ is identical. For the purpose of contradiction suppose there are two<br />

declarations f (P) and f (Q) in δ. Since both f (P) and f (Q) are applicable without coercion to the call f (X) we have<br />

X ≼ P ∩ Q. <strong>The</strong>refore it is not the case that P Q. By the overloading restrictions, P ≠ Q and either P ♦ Q or<br />

there is a declaration f (P ∩ Q) visible at Z. Since it cannot be the case that P ♦ Q there must exist a declaration<br />

f (P ∩ Q) visible at Z. Since P ∩ Q ≼ P and P ∩ Q ≼ Q we know f (P ∩ Q) is applicable without coercion to the<br />

call f (X). Since P ≠ Q either P ∩ Q ≺ P or P ∩ Q ≺ Q. Either case contradicts our assumption.<br />

<strong>The</strong>orem 2. If |Σ| ≠ 0 then |σ| = 1. Also, if |Σ| ≠ 0 then |δ| = 1.<br />

Proof. Follows from Lemmas 5, 6 and 7.<br />

<strong>The</strong>orem 3. If σ = {S} and δ = {D} then D ≼ S.<br />

Proof. If the declaration with parameter type S and the declaration with parameter type D satisfy the Subtype Rule<br />

then the theorem is proved. Otherwise, by the definition of σ we have σ ⊆ Σ. <strong>The</strong>refore S ∈ Σ. By Lemma 4, S ∈ ∆.<br />

Notice that S, D ∈ ∆ implies X ≼ S and X ≼ D. <strong>The</strong>refore, S ̸♦ D. By the More Specific Rule for Functions, there<br />

must exist a declaration with parameter type S ∩ D. Because X ≼ (S ∩ D), (S ∩ D) ∈ ∆. Notice (S ∩ D) ≼ S<br />

and (S ∩ D) ≼ D. By the definition of δ, we have ¬∃D ′ ∈ ∆ : D ′ ≺ D. In particular, (S ∩ D) ⊀ D. <strong>The</strong>refore<br />

(S ∩ D) = D.<br />

339

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

Saved successfully!

Ooh no, something went wrong!