|
| |||||
9.7 Value expressions |
A comprehended set expression can only be translated if it takes one of the forms
{ e | b : T • b ∈ slm } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ e | b : T • b ∈ slm /\ p } |
where b is a binding, T is a type, e is a translatable expression, slm is a translatable expression of set, list, or map type, and p is a translatable expression of type Bool.
A comprehended list expression can only be translated if it takes one of the forms
〈 e | b in l 〉 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
〈 e | b in l • p 〉 |
where b is a binding, e is a translatable expression, l is a translatable expression of list type, and p is a translatable expression of type Bool.
A comprehended map expression can only be translated if it takes one of the forms
[ e1 ↦ e2 | b :T • b ∈ slm ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[ e1 ↦ e2 | b :T • b ∈ slm /\ p] |
where b is a binding, e1 and e2 are translatable expressions, T is a type, slm is a translatable expression of set, list, or map type, and p is a translatable expression of type Bool.
∀ b : T • b ∈ slm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∀ b : T • b ∈ slm ⇒ p | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∀ b : T • b ∈ slm /\ p ⇒ q | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∃ b : T • b ∈ slm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∃ b : T • b ∈ slm /\ p | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∃! b : T • b ∈ slm | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
∃! b : T • b ∈ slm /\ p |
where b is a binding, T is a type, slm is a translatable expression of set, list or map type, and p and q are translatable expressions of type Bool.
A universal prefix expression (□) is not accepted.
An implicit let expression can only be translated if it has one of the forms
let b : T • b ∈ slm in ... end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
let b : T • b ∈ slm /\ p in ... end |
where b is a binding, T a type, slm a translatable expression of set, list, or map type, and p a translatable expression of type Bool.
An if expression translates to an if expression.
Case expressions are accepted subject to some restrictions on possible patterns when the case is over a variant or record type and involves a function constructor:
9.7 Value expressions | ||||||
|
|