Notation | Description |
---|---|
∀x. P x | Universal quantification; for all x the proposition P holds for x |
∃x. P x | Existential quantification; there exists some x such that the proposition P holds for x |
P ⇒ Q | Implication; P implies Q |
P ⋀ Q | Conjunction; P and Q |
Notation | Description |
---|---|
e ∈ A | e is an element of the set A |
e ∉ A | e is not an element of the set A |
{ x₀, x₁, ... xₙ } | A set consisting of values from x₀ to xₙ |
{ e ∈ A | p(e) } | A set consisting of the elements of A for which the proposition p holds |
|A| | The cardinality of the set A; a measure of the number of elements in A |
∅ | The empty set |
𝔹 | The booleans |
ℕ | The natural numbers |
ℝ | The real numbers |
ℤ | The integers |
[a, b] | A closed interval in a set (given separately or implicit from the types of a and b), from a to b, including a and b |
(a, b] | A closed interval in a set (given separately or implicit from the types of a and b), from a to b, excluding a but including b |
[a, b) | A closed interval in a set (given separately or implicit from the types of a and b), from a to b, including a but excluding b |
(a, b) | A closed interval in a set (given separately or implicit from the types of a and b), from a to b, excluding a and b |
A ⊂ B | A is a subset of, and is not equal to, B |
A ⊆ B | A is a subset of, or is equal to, B |
S = { 1, 2, 3 } tuples(S, 0) = { () } tuples(S, 1) = { (1, ()), (2, ()), (3, ()) } tuples(S, 2) = { (1, (1, ())), (2, (1, ())), (3, (1, ())), (1, (2, ())), (2, (2, ())), (3, (2, ())), (1, (3, ())), (2, (3, ())), (3, (3, ())) }
Notation | Description | Example |
---|---|---|
x : A | The term x is of type A | 23 : ℕ |
A → B | The type of functions from values of type A to values of type B | even : ℕ → 𝔹 |
A × B | The type of products of A and B | (23, true) : ℕ × 𝔹 |
Notation | Description | Example |
---|---|---|
Γ | The current typing environment | Γ |
∅ | The empty typing environment | ∅ |
Γ, x | The typing environment Γ extended with the variable x [3] | Γ, x where x ∉ dom(Γ) |
dom(Γ) | The set of distinct variables in Γ | dom((∅, x, y)) = { x, y } |
Γ ⊢ P | The environment Γ implies P | Γ ⊢ 23 : ℕ (in the current typing environment, 23 is of type ℕ) |
Γ ⊢ ◇ | The environment Γ is well-formed | ∅ ⊢ ◇ (the empty typing environment is well-formed) |
if true then if false then true else if if true then false else true end then false else true end end else true end
if true then if false then true else if if true then false else true end then false else true end end else true end → by if_true to: if false then true else if if true then false else true end then false else true end end → by if_false to: if if true then false else true end then false else true end → by if_condition to: if false then false else true end → by if_false to: true
Codepoint | Name |
---|---|
U+0009 | Horizontal tab |
U+000A | Line feed |
U+000C | Form feed |
U+000D | Carriage return |
U+0020 | Space |
Codepoint(s) | Name |
---|---|
U+000A | Line feed |
U+000D | Carriage return |
U+000D U+000A | Carriage return immediately followed by line feed |
digit_nonzero = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; digit = "0" | digit_nonzero ; integer = "0" | ( ["-"] , digit_nonzero , { digit } ) ;
real = ["-"] , digit , { digit } , "." , digit , { digit } ;
boolean_literal = "true" | "false" ;
letter_lower = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ; letter_upper = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ; letter = letter_lower | letter_upper ; name_lower = letter_lower , { letter | digit | "-" | "_" } ; name_upper = letter_upper , { letter | digit | "-" | "_" } ;
type_path = name_lower | name_upper , "." , name_lower ; value_declaration = "value" , name_lower , [ ":" , type_path ] , "=" , expression ; function_formal_parameter = name_lower , ":" , type_path ; function_formal_parameters = "(" , function_formal_parameter, { "," , function_formal_parameter } , ")" ; function_declaration = "function" , name_lower , function_formal_parameters , ":" , type_path , "=" , expression ; term_declaration = value_declaration | function_declaration ;
value x = 23; value y = I.plus x 24; function identity ( x : integer ) : integer = x;
type t is record x : integer, y : integer end; type u is record x : integer, y : integer end;
type t is record x : integer, x : integer end;
record_type_field = name_lower , ":" , type_path ; record_type_expression = "record" , record_type_field , { "," , record_type_field } , "end" ; type_declaration = "type" , name_lower , "is" , type_expression ; type_expression = record_type_expression ;
type t is record x : integer, y : integer, z : integer end; type u is record v0 : t, v1 : t, v2 : t end;
shader_parameter_declaration = "parameter" , name_lower , ":" , type_path ; shader_vertex_input_declaration = "in" , name_lower , ":" , type_path ; shader_vertex_output_declaration = "out" , name_lower , ":" , type_path ; shader_vertex_output_declaration = "out" , "vertex" , name_lower , ":" , type_path ; shader_vertex_parameter = shader_parameter_declaration | shader_vertex_input_declaration | shader_vertex_output_declaration | shader_vertex_output_main_declaration ; shader_vertex_parameters = { shader_vertex_parameter , ";" } ; shader_vertex_output_assignment = "out" , name_lower , "=" , term_path ; shader_vertex_output_assignments = shader_vertex_output_assignment , ";" , { shader_vertex_output_assignments } ; shader_vertex_declaration = "vertex" , name_lower , "is" , shader_vertex_parameters , [ "with" , local_declarations ] , "as" , shader_vertex_output_assignments , "end" ; shader_fragment_input_declaration = "in" , name_lower , ":" , type_path ; shader_fragment_output_declaration = "out" , name_lower , ":" , type_path , "as" , integer_literal ; shader_fragment_parameter = shader_parameter_declaration | shader_fragment_input_declaration | shader_fragment_output_declaration ; shader_fragment_parameters = { shader_fragment_parameter , ";" } ; shader_fragment_discard_declaration = "discard" , "(" , expression , ")" ; shader_fragment_local_declaration = local_declaration | shader_fragment_discard_declaration ; shader_fragment_local_declarations = shader_fragment_local_declaration , ";" , { shader_fragment_local_declarations } ; shader_fragment_output_assignment = "out" , name_lower , "=" , term_path ; shader_fragment_output_assignments = shader_fragment_output_assignment , ";" , { shader_fragment_output_assignments } ; shader_fragment_declaration = "fragment" , name_lower , "is" , shader_fragment_parameters , [ "with" , shader_fragment_local_declarations ] , "as" , shader_fragment_output_assignments , "end" ; shader_program_declaration = "program" , name_lower , "is" , "vertex" , shader_path , ";" , "fragment" , shader_path , ";" , "end" ; shader_declaration = "shader" , ( shader_vertex_declaration | shader_fragment_declaration | shader_program_declaration ) ; shader_declarations = { shader_declaration , ";" } ;
shader vertex v is parameter mm_modelview : matrix_4x4f; parameter mm_projection : matrix_4x4f; parameter mm_normal : matrix_3x3f; in position : vector_4f; in normal : vector_3f; out vertex r_position : vector_4f; out r_normal : vector_3f; with value p_result = M4.multiply_vector (M4.multiply (mm_projection, mm_modelview), position); value n_result = M3.multiply_vector (mm_normal, normal); as out r_position = p_result; out r_normal = n_result; end;
shader fragment f is parameter texture_0 : sampler_2d; in uv : vector_2f; out out0 : vector_4f as 0; with value rgba = T.texture (texture_0, uv); as out out0 = rgba; end;
∀s. 0 <= s <= |I| - 1 ⇒ ∃t. (0 <= t <= |O| - 1 ⋀ ((name(Iₛ) = name(Oₜ) ⋀ type(Iₛ) = type(Oₜ)))
∀s. 0 <= s <= |P| - 1 ⇒ ∃t. (0 <= t <= |Q| - 1 ⋀ name(Iₛ) = name(Oₜ)) ⇒ type(Iₛ) = type(Oₜ)
package com.example; module Y is value k = 23; end; module X is import com.example.Y; value z = Y.k; end;
package com.example; module X is import com.example_0.Y; import com.example_1.Y as Z; value z = Y.k; value q = Z.p; end;
package_path = name_lower , { "." , name_lower } ; import_path = package_path , "." , name_upper ; import_declaration = "import" , import_path , [ "as" , name_upper ] ; import_declarations = { import_declaration , ";" } ; module_level_declarations = { value_declarations | function_declarations | type_declarations | shader_declarations } ; module_declaration = "module" , name_upper , "is" , import_declarations , module_level_declarations , "end" ; module_declarations = module_declaration , ";" , { module_declaration , ";" } ;
package_path = name_lower , { "." , name_lower } ; package_declaration = "package" , package_path ;
term_path = name_lower | name_upper , "." , name_lower ; type_path = name_lower | name_upper , "." , name_lower ; variable_or_application_expression = term_path [ "(" , expression , { "," , expression } , ")" ] ; new_parameters = "(" , expression , { "," , expression } , ")" ; new_expression = "new" , type_path , new_parameters ; record_expression_fields = "{" , name_lower , "=" , expression , { "," name_lower , "=" , expression } , "}" ; record_expression = "record" , type_path , record_expression_fields ; local_declaration = "value" , name_lower , [ ":" , type_path ] , "=" , expression ; local_declarations = local_declaration , ";" , { local_declarations } ; let_expression = "let" , local_declarations , "in" , expression , "end" ; conditional_expression = "if" , expression , "then" , expression , "else" , expression , "end" ; matrix_column_access_expression = "column" , expression , integer_literal ; expression_pre = integer_literal | real_literal | boolean_literal | variable_or_application_expression | conditional_expression | matrix_column_access_expression | let_expression | new_expression | record_expression ; expression_projection = "." , name_lower ; expression_swizzle_names = "[" , name_lower , { "," , name_lower } , "]" ; expression = expression_pre , { expression_swizzle | expression_projection } ;
Type | Constructor type |
---|---|
vector_2i | (integer, integer) → vector_2i |
vector_3i | (integer, integer, integer) → vector_3i |
vector_4i | (integer, integer, integer, integer) → vector_4i |
vector_2f | (float, float) → vector_2f |
vector_3f | (float, float, float) → vector_3f |
vector_4f | (float, float, float, float) → vector_4f |
Type | Constructor type |
---|---|
vector_2i | vector_2i → vector_2i |
vector_3i | (integer, vector_2i) → vector_3i |
vector_3i | (vector_2i, integer) → vector_3i |
vector_3i | vector_3i → vector_3i |
vector_4i | (vector_2i, integer, integer) → vector_4i |
vector_4i | (integer, vector_2i, integer) → vector_4i |
vector_4i | (vector_2i, vector_2i) → vector_4i |
vector_4i | (integer, integer, vector_2i) → vector_4i |
vector_4i | (vector_3i, integer) → vector_4i |
vector_4i | (integer, vector_3i) → vector_4i |
vector_4i | vector_4i → vector_4i |
vector_2f | vector_2f → vector_2f |
vector_3f | (float, vector_2f) → vector_3f |
vector_3f | (vector_2f, float) → vector_3f |
vector_3f | vector_3f → vector_3f |
vector_4f | (vector_2f, float, float) → vector_4f |
vector_4f | (float, vector_2f, float) → vector_4f |
vector_4f | (vector_2f, vector_2f) → vector_4f |
vector_4f | (float, float, vector_2f) → vector_4f |
vector_4f | (vector_3f, float) → vector_4f |
vector_4f | (float, vector_3f) → vector_4f |
vector_4f | vector_4f → vector_4f |
Type | Constructor type |
---|---|
matrix_3x3f | (vector_3f, vector_3f, vector_3f) → matrix_3x3f |
matrix_4x4f | (vector_4f, vector_4f, vector_4f, vector_4f) → matrix_4x4f |
function or (x : boolean, y : boolean) : boolean
function absolute (x : float) : float
function arc_cosine (x : float) : float
function arc_sine (x : float) : float
function arc_tangent (x : float) : float
function ceiling (x : float) : float
function clamp (x : float, min : float, max : float) : float
function divide (x : float, y : float) : float
function equals (x : float, y : float) : boolean
function floor (x : float) : float
function greater (x : float, y : float) : boolean
function greater_or_equal (x : float, y : float) : boolean
function interpolate (x : float, y : float, a : float) : float
function is_infinite (x : float) : boolean
function is_nan (x : float) : boolean
function lesser (x : float, y : float) : boolean
function lesser_or_equal (x : float, y : float) : boolean
function log2 (x : float) : float
function maximum (x : float, y : float) : float
function minimum (x : float, y : float) : float
function modulo (x : float, y : float) : float
function multiply (x : float, y : float) : float
function power (x : float, n : float) : float
function round (x : float) : float
function sign (x : float) : float
function square_root (x : float) : float
function subtract (x : float, y : float) : float
function tangent (x : float) : float
function truncate (x : float) : float
function divide (x : integer, y : integer) : integer
function multiply (x : integer, y : integer) : integer
function subtract (x : integer, y : integer) : integer
function multiply (m0 : matrix_3x3f, m1 : matrix_3x3f) : matrix_3x3f
function multiply_vector (m : matrix_3x3f, v : vector_3f) : vector_3f
function multiply (m0 : matrix_4x4f, m1 : matrix_4x4f) : matrix_4x4f
function multiply_vector (m : matrix_4x4f, v : vector_4f) : vector_4f
function texture (t : sampler_2d, uv : vector_2f) : vector_4f
function texture_with_offset (t : sampler_2d, uv : vector_2f, o : vector_2i) : vector_4f
function texture_with_lod (t : sampler_2d, uv : vector_2f, lod : float) : vector_4f
function add (v0 : vector_2f, v1 : vector_2f) : vector_2f
function add_scalar (v : vector_2f, x : float) : vector_2f
function divide (v0 : vector_2f, v1 : vector_2f) : vector_2f
function divide_scalar (v : vector_2f, x : float) : vector_2f
function dot (v0 : vector_2f, v1 : vector_2f) : float
function interpolate (v0 : vector_2f, v1 : vector_2f, t : float) : vector_2f
function magnitude (v : vector_2f) : float
function multiply (v0 : vector_2f, v1 : vector_2f) : vector_2f
function multiply_scalar (v0 : vector_2i, x : float) : vector_3f
function negate (v : vector_2f) : vector_2f
function normalize (v : vector_2f) : vector_2f
function reflect (i : vector_2f, n : vector_2f) : vector_2f
function refract (i : vector_2f, n : vector_2f, e : float) : vector_2f
function subtract (v0 : vector_2f, v1 : vector_2f) : vector_2f
function add (v0 : vector_2i, v1 : vector_2i) : vector_2i
function add_scalar (v : vector_2i, x : integer) : vector_2i
function divide (v0 : vector_2i, v1 : vector_2i) : vector_2i
function divide_scalar (v : vector_2i, x : integer) : vector_2i
function dot (v0 : vector_2i, v1 : vector_2i) : integer
function interpolate (v0 : vector_2i, v1 : vector_2i, t : float) : vector_2i
function magnitude (v : vector_2i) : float
function multiply (v0 : vector_2i, v1 : vector_2i) : vector_2i
function multiply_scalar (v0 : vector_2i, x : integer) : vector_3f
function negate (v : vector_2i) : vector_2i
function normalize (v : vector_2i) : vector_2i
function reflect (i : vector_2i, n : vector_2i) : vector_2i
function refract (i : vector_2i, n : vector_2i, e : float) : vector_2i
function subtract (v0 : vector_2i, v1 : vector_2i) : vector_2i
function add (v0 : vector_3f, v1 : vector_3f) : vector_3f
function add_scalar (v : vector_3f, x : integer) : vector_3f
function divide (v0 : vector_3f, v1 : vector_3f) : vector_3f
function divide_scalar (v : vector_3f, x : integer) : vector_3f
function cross (v0 : vector_3f, v1 : vector_3f) : vector_3f
function dot (v0 : vector_3f, v1 : vector_3f) : integer
function interpolate (v0 : vector_3f, v1 : vector_3f, t : float) : vector_3f
function magnitude (v : vector_3f) : float
function multiply (v0 : vector_3f, v1 : vector_3f) : vector_3f
function multiply_scalar (v0 : vector_3f, x : float) : vector_3f
function negate (v : vector_3f) : vector_3f
function normalize (v : vector_3f) : vector_3f
function reflect (i : vector_3f, n : vector_3f) : vector_3f
function refract (i : vector_3f, n : vector_3f, e : float) : vector_3f
function subtract (v0 : vector_3f, v1 : vector_3f) : vector_3f
function add (v0 : vector_3i, v1 : vector_3i) : vector_3i
function add_scalar (v : vector_3i, x : integer) : vector_3i
function divide (v0 : vector_3i, v1 : vector_3i) : vector_3i
function divide_scalar (v : vector_3i, x : integer) : vector_3i
function dot (v0 : vector_3i, v1 : vector_3i) : integer
function interpolate (v0 : vector_3i, v1 : vector_3i, t : float) : vector_3i
function magnitude (v : vector_3i) : float
function multiply (v0 : vector_3i, v1 : vector_3i) : vector_3i
function multiply_scalar (v0 : vector_3i, x : float) : vector_3i
function negate (v : vector_3i) : vector_3i
function normalize (v : vector_3i) : vector_3i
function reflect (i : vector_3i, n : vector_3i) : vector_3i
function refract (i : vector_3i, n : vector_3i, e : float) : vector_3i
function subtract (v0 : vector_3i, v1 : vector_3i) : vector_3i
function add (v0 : vector_4f, v1 : vector_4f) : vector_4f
function add_scalar (v : vector_4f, x : integer) : vector_4f
function divide (v0 : vector_4f, v1 : vector_4f) : vector_4f
function divide_scalar (v : vector_4f, x : integer) : vector_4f
function dot (v0 : vector_4f, v1 : vector_4f) : integer
function interpolate (v0 : vector_4f, v1 : vector_4f, t : float) : vector_4f
function magnitude (v : vector_4f) : float
function multiply (v0 : vector_4f, v1 : vector_4f) : vector_4f
function multiply_scalar (v0 : vector_4f, x : float) : vector_4f
function negate (v : vector_4f) : vector_4f
function normalize (v : vector_4f) : vector_4f
function reflect (i : vector_4f, n : vector_4f) : vector_4f
function refract (i : vector_4f, n : vector_4f, e : float) : vector_4f
function subtract (v0 : vector_4f, v1 : vector_4f) : vector_4f
function add (v0 : vector_4i, v1 : vector_4i) : vector_4i
function add_scalar (v : vector_4i, x : integer) : vector_4i
function divide (v0 : vector_4i, v1 : vector_4i) : vector_4i
function divide_scalar (v : vector_4i, x : integer) : vector_4i
function dot (v0 : vector_4i, v1 : vector_4i) : integer
function interpolate (v0 : vector_4i, v1 : vector_4i, t : float) : vector_4i
function magnitude (v : vector_4i) : float
function multiply (v0 : vector_4i, v1 : vector_4i) : vector_4i
function multiply_scalar (v0 : vector_4i, x : float) : vector_4i
function negate (v : vector_4i) : vector_4i
function normalize (v : vector_4i) : vector_4i
function reflect (i : vector_4i, n : vector_4i) : vector_4i
function refract (i : vector_4i, n : vector_4i, e : float) : vector_4i
function subtract (v0 : vector_4i, v1 : vector_4i) : vector_4i
(* Terminals *) digit_nonzero = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ; digit = "0" | digit_nonzero ; letter_lower = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" ; letter_upper = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" ; letter = letter_lower | letter_upper ; name_lower = letter_lower , { letter | digit | "-" | "_" } ; name_upper = letter_upper , { letter | digit | "-" | "_" } ; integer_literal = "0" | ( ["-"] , digit_nonzero , { digit } ) ; real_literal = ["-"] , digit , { digit } , "." , digit , { digit } ; boolean_literal = "true" | "false" ; (* Non-terminals *) package_path = name_lower , { "." , name_lower } ; package_declaration = "package" , package_path ; import_path = package_path , "." , name_upper ; import_declaration = "import" , import_path , [ "as" , name_upper ] ; import_declarations = { import_declaration , ";" } ; type_path = name_lower | name_upper , "." , name_lower ; term_path = name_lower | name_upper , "." , name_lower ; shader_path = name_lower | name_upper , "." , name_lower ; value_declaration = "value" , name_lower , [ ":" , type_path ] , "=" , expression ; value_declarations = { value_declaration , ";" } ; function_formal_parameter = name_lower , ":" , type_path ; function_formal_parameters = "(" , function_formal_parameter, { "," , function_formal_parameter } , ")" ; function_declaration = "function" , name_lower , function_formal_parameters , ":" , type_path , "=" , expression ; term_declaration = value_declaration | function_declaration ; record_type_field = name_lower , ":" , type_path ; record_type_expression = "record" , record_type_field , { "," , record_type_field } , "end" ; type_declaration = "type" , name_lower , "is" , type_expression ; type_declarations = { type_declaration , ";" } ; type_expression = record_type_expression ; variable_or_application_expression = term_path [ "(" , expression , { "," , expression } , ")" ] ; new_parameters = "(" , expression , { "," , expression } , ")" ; new_expression = "new" , type_path , new_parameters ; record_expression_fields = "{" , name_lower , "=" , expression , { "," name_lower , "=" , expression } , "}" ; record_expression = "record" , type_path , record_expression_fields ; local_declaration = "value" , name_lower , [ ":" , type_path ] , "=" , expression ; local_declarations = local_declaration , ";" , { local_declarations } ; let_expression = "let" , local_declarations , "in" , expression , "end" ; conditional_expression = "if" , expression , "then" , expression , "else" , expression , "end" ; matrix_column_access_expression = "column" , expression , integer_literal ; expression_pre = integer_literal | real_literal | boolean_literal | variable_or_application_expression | conditional_expression | matrix_column_access_expression | let_expression | new_expression | record_expression ; expression_projection = "." , name_lower ; expression_swizzle_names = "[" , name_lower , { "," , name_lower } , "]" ; expression = expression_pre , { expression_swizzle | expression_projection } ; shader_parameter_declaration = "parameter" , name_lower , ":" , type_path ; shader_vertex_input_declaration = "in" , name_lower , ":" , type_path ; shader_vertex_output_declaration = "out" , name_lower , ":" , type_path ; shader_vertex_output_main_declaration = "out" , "vertex" , name_lower , ":" , type_path ; shader_vertex_parameter = shader_parameter_declaration | shader_vertex_input_declaration | shader_vertex_output_declaration | shader_vertex_output_main_declaration ; shader_vertex_parameters = { shader_vertex_parameter , ";" } ; shader_vertex_output_assignment = "out" , name_lower , "=" , term_path ; shader_vertex_output_assignments = shader_vertex_output_assignment , ";" , { shader_vertex_output_assignments } ; shader_vertex_declaration = "vertex" , name_lower , "is" , shader_vertex_parameters , [ "with" , local_declarations ] , "as" , shader_vertex_output_assignments , "end" ; shader_fragment_input_declaration = "in" , name_lower , ":" , type_path ; shader_fragment_output_declaration = "out" , name_lower , ":" , type_path , "as" , integer_literal ; shader_fragment_output_depth_declaration = "out" , "depth", name_lower , ":" , type_path ; shader_fragment_parameter = shader_parameter_declaration | shader_fragment_input_declaration | shader_fragment_output_declaration | shader_fragment_output_depth_declaration ; shader_fragment_parameters = { shader_fragment_parameter , ";" } ; shader_fragment_discard_declaration = "discard" , "(" , expression , ")" ; shader_fragment_local_declaration = local_declaration | shader_fragment_discard_declaration ; shader_fragment_local_declarations = shader_fragment_local_declaration , ";" , { shader_fragment_local_declarations } ; shader_fragment_output_assignment = "out" , name_lower , "=" , term_path ; shader_fragment_output_assignments = shader_fragment_output_assignment , ";" , { shader_fragment_output_assignments } ; shader_fragment_declaration = "fragment" , name_lower , "is" , shader_fragment_parameters , [ "with" , shader_fragment_local_declarations ] , "as" , shader_fragment_output_assignments , "end" ; shader_program_declaration = "program" , name_lower , "is" , "vertex" , shader_path , ";" , "fragment" , shader_path , ";" , "end" ; shader_declaration = "shader" , ( shader_vertex_declaration | shader_fragment_declaration | shader_program_declaration ) ; shader_declarations = { shader_declaration , ";" } ; module_level_declarations = { value_declarations | function_declarations | type_declarations | shader_declarations } ; module_declaration = "module" , name_upper , "is" , import_declarations , module_level_declarations , "end" ; module_declarations = module_declaration , ";" , { module_declaration , ";" } ; unit = package_declaration , ";" , module_declarations ;