Sum type
Type
context | X,Y,Z … type |
rule | a : Xνl(a) : X+Y(+lI) |
rule | b : Yνr(b) : X+Y(+rI) |
rule | Γ, x : X ⊢ f : ZΓ, y : Y ⊢ g : Zc : X+YΓ ⊢ [ifc matches νl(x) do f(x), elseifc matches νr(y) do g(y)] : Z(+E) |
Discussion
Notation
The matching-term is generally written
[νlx.f(x), νry.g(y)](c),
which is shorter but less suggestive.
Logic
Note how the rules reflect the logical “or”.