19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

opr ⊗,opr ⊕,opr ≈<br />

extends { BinaryOperatorT, ⊗, BinaryOperatorT, ⊕, ReflexiveT, ≈, SymmetricT, ≈ }<br />

property ∀(a:T, b: T, c:T) (a ⊗ (b ⊕ c)) :≈: ((a ⊗ b) ⊕ (a ⊗ c))<br />

end<br />

<strong>The</strong> trait ApproximatelyLeftDistributive requires the operator ⊗ to be approximately left distributive over the<br />

operator ⊕ ; that is, the expressions a ⊗ (b ⊕ c) and (a ⊗ b) ⊕ (a ⊗ c) always produce results that are “close enough”<br />

to each other as determined by the specified ≈ predicate.<br />

trait LeftDistributiveT extends LeftDistributiveT, ⊗, ⊕,opr ⊗,opr ⊕<br />

extends { ApproximatelyLeftDistributiveT, ⊗, ⊕, =, EquivalenceRelationT, = }<br />

end<br />

<strong>The</strong> trait LeftDistributive requires the operator ⊗ to be left distributive over the operator ⊕ ; that is, the expressions<br />

a ⊗ (b ⊕ c) and (a ⊗ b) ⊕ (a ⊗ c) always produce equal results.<br />

trait ApproximatelyRightDistributiveT extends ApproximatelyRightDistributiveT, ⊗, ⊕, ≈,<br />

opr ⊗,opr ⊕,opr ≈<br />

extends { BinaryOperatorT, ⊗, BinaryOperatorT, ⊕, ReflexiveT, ≈, SymmetricT, ≈ }<br />

property ∀(a:T, b: T, c:T) ((a ⊕ b) ⊗ c) :≈: ((a ⊗ c) ⊕ (b ⊗ c))<br />

end<br />

<strong>The</strong> trait ApproximatelyRightDistributive requires the operator ⊗ to be approximately right distributive over the<br />

operator ⊕ ; that is, the expressions (a ⊕ b) ⊗ c and (a ⊗ c) ⊕ (b ⊗ c) always produce results that are “close enough”<br />

to each other as determined by the specified ≈ predicate.<br />

trait RightDistributiveT extends RightDistributiveT, ⊗, ⊕,opr ⊗,opr ⊕<br />

extends { ApproximatelyRightDistributiveT, ⊗, ⊕, =, EquivalenceRelationT, = }<br />

end<br />

<strong>The</strong> trait RightDistributive requires the operator ⊗ to be right distributive over the operator ⊕ ; that is, the expressions<br />

(a ⊕ b) ⊗ c and (a ⊗ c) ⊕ (b ⊗ c) always produce equal results.<br />

trait ApproximatelyDistributiveT extends ApproximatelyDistributiveT, ⊗, ⊕, ≈,<br />

opr ⊗,opr ⊕,opr ≈<br />

extends { ApproximatelyLeftDistributiveT, ⊗, ⊕, ≈,<br />

ApproximatelyRightDistributiveT, ⊗, ⊕, ≈ }<br />

end<br />

<strong>The</strong> trait ApproximatelyDistributive requires the operator ⊗ to be both approximately left distributive and approximately<br />

right distributive over the operator ⊕ .<br />

trait DistributiveT extends DistributiveT, ⊗, ⊕,opr ⊗,opr ⊕<br />

extends { ApproximatelyDistributiveT, ⊗, ⊕, =, LeftDistributiveT, ⊗, ⊕, RightDistributiveT, ⊗, ⊕ }<br />

end<br />

<strong>The</strong> trait Distributive requires the operator ⊗ to be both left distributive and right distributive over the operator ⊕ .<br />

trait HasLeftIdentityT extends HasLeftIdentityT, ⊙,opr ⊙<br />

extends { BinaryOperatorT, ⊙, EquivalenceRelationT, = }<br />

isLeftIdentity():Boolean<br />

property ∀(a:T, b: T) a.isLeftIdentity() →: ((a ⊙ b) = b)<br />

end<br />

254

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

Saved successfully!

Ooh no, something went wrong!