Theoria.DSL (theoria v0.4.0)

Copy Markdown View Source

Small Elixir DSL for constructing named Theoria syntax terms.

The DSL is deliberately untrusted. It only builds Theoria.Syntax values; terms must still be elaborated and checked by Theoria.Kernel.

Summary

Functions

Imports the term-construction DSL.

Function application.

Non-dependent function type.

Applies fun to all args left-associatively.

A named environment constant.

The current core proposition universe, for APIs that need a checked core term.

Elaborates a named syntax term to a core term.

Elaborates a named syntax term or raises Theoria.Error.

Propositional equality.

Dependent function type with do block syntax.

Lambda abstraction with do block syntax.

The current proposition universe.

Reflexivity proof.

Builds a Theoria syntax term from a small Elixir-like quoted expression.

A type universe. type(0) corresponds to Type 0, whose core sort is Sort 1.

A named bound variable.

Functions

__using__(opts)

(macro)

Imports the term-construction DSL.

app(fun, arg)

Function application.

arrow(domain, codomain)

Non-dependent function type.

call(fun, args)

Applies fun to all args left-associatively.

call(fun, arg1, arg2)

call(fun, arg1, arg2, arg3)

call(fun, arg1, arg2, arg3, arg4)

const(name, levels \\ [])

A named environment constant.

core_prop()

The current core proposition universe, for APIs that need a checked core term.

elab(term)

Elaborates a named syntax term to a core term.

elab!(term)

Elaborates a named syntax term or raises Theoria.Error.

eq(type, left, right)

Propositional equality.

eq_rec(type, motive, base, proof)

Equality recursor.

forall(name, domain, list)

(macro)

Dependent function type with do block syntax.

lam(name, domain, list)

(macro)

Lambda abstraction with do block syntax.

prop()

The current proposition universe.

refl(value)

Reflexivity proof.

term(list)

(macro)

Builds a Theoria syntax term from a small Elixir-like quoted expression.

type(level)

A type universe. type(0) corresponds to Type 0, whose core sort is Sort 1.

var(name)

A named bound variable.