LF.Term
External LF terms.
type t =
| Variable of {
location : Syncom.Location.t;
identifier : Syncom.Identifier.t;
}
Variable { identifier = "x"; _ }
is the term-level variable with name "x"
. It may be free or bound. If it is free, then an implicit type-level or kind-level Pi binder should be reconstructed for it.
| Constant of {
location : Syncom.Location.t;
identifier : Syncom.Qualified_identifier.t;
}
Constant { identifier = "c"; _ }
is the term-level constant with qualified identifier "c"
.
| Application of {
location : Syncom.Location.t;
applicand : t;
arguments : t Support.List1.t;
}
Application { applicand; arguments; _ }
is the term-level application of applicand
with arguments
.
If applicand = Term.Constant _
with resolved operator description operator
, then List1.length arguments = Operator.arity operator
.
| Abstraction of {
location : Syncom.Location.t;
parameter_identifier : Syncom.Identifier.t Support.Option.t;
parameter_type : Typ.t Support.Option.t;
body : t;
}
Abstraction { parameter_identifier = Option.Some "x"; parameter_type = Option.Some t; body; _ }
is the term \(x : t). body
. The variable "x"
ranges over LF terms. The parameter identifier may be omitted (represented as _
), and the parameter type annotation is typically omitted.
| Wildcard of {
location : Syncom.Location.t;
}
Wildcard { _ }
is the omission _
of a fresh term-level variable. This is analogous to a fresh free variable.
| Type_annotated of {
location : Syncom.Location.t;
term : t;
typ : Typ.t;
}
Type_annotated { term = u; typ = t; _ }
is the term u : t
.