Module CLF.Context

External contextual LF contexts.

In the parser, every untyped variable in head position of a context is disambiguated as a context variable.

{ Context.head; bindings; _ } is the context

  • ^ if head = Head.None and bindings = [].
  • x1 : t1, x2 : t2, ..., xn : tn if head = Head.None and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
  • _ if head = Head.Hole and bindings = [].
  • _, x1 : t1, x2 : t2, ..., xn : tn if head = Head.Hole and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
  • g if head = Head.Context_variable { identifier = "g"; _ } and bindings = [].
  • g, x1 : t1, x2 : t2, ..., xn : tn if head = Head.Context_variable { identifier = "g"; _ } and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
module Head : sig ... end
module Pattern : sig ... end

External contextual LF context patterns.