Context
A context is a sequence of declarations and definitions. A declaration introduces a symbol of a certain type. For instance,
Declaration
(
subject
=
x
,
type
=
int
)
means
``Let
x
be an
int
''.
A definition just gives a name to a meaningful mathematical expression.
data
Declaration
=
Declaration
(
subject
:
Symbol
,
type
:
Math
)
data
Definition
=
Definition
(
subject
:
Symbol
,
body
:
Math
,
type
:
Math
)
data
ContextItem
=
Declaration
|
Definition
data
Context
=
Sequence ContextItem