Documentation
¶
Index ¶
- Variables
- type Abst
- func (la Abst) AlphaEquivalent(other Term) bool
- func (la Abst) AorReduce() (Term, error)
- func (la Abst) BetaReduce(sub Term) Term
- func (la Abst) EtaReduce() Term
- func (la Abst) NorReduce() (Term, error)
- func (la Abst) Reduce() (Term, error)
- func (la Abst) Serialize() string
- func (la Abst) String() string
- func (la Abst) WHNF() Abst
- type Appl
- type Term
- type Var
Constants ¶
This section is empty.
Variables ¶
var MaxReductions = 10000
MaxReductions determines the maximum amount of expansions before we give up use a negative value to have no limit (use with care...)
Functions ¶
This section is empty.
Types ¶
type Abst ¶ added in v1.1.0
type Abst [1]Term
Abst represents a lambda abstraction
func (Abst) AlphaEquivalent ¶ added in v1.1.0
AlphaEquivalent checks whether a Abst and a Term are identical
func (Abst) AorReduce ¶ added in v1.1.0
AorReduce reduces a lambda abstraction using applicative order
func (Abst) BetaReduce ¶ added in v1.1.0
BetaReduce substitutes the locally bound variable of the Abst by sub
func (Abst) Serialize ¶ added in v1.1.0
Serialize returns the lambda abstraction as a De Bruijn index representation
type Appl ¶ added in v1.1.0
type Appl [2]Term
Appl represents an application
func (Appl) AlphaEquivalent ¶ added in v1.1.0
AlphaEquivalent checks whether the Appl is identical to a Term
func (Appl) Serialize ¶ added in v1.1.0
Serialize returns the application as a De Bruijn index representation
type Term ¶ added in v1.1.0
type Term interface { AlphaEquivalent(Term) bool EtaReduce() Term String() string Reduce() (Term, error) NorReduce() (Term, error) AorReduce() (Term, error) WHNF() Abst Serialize() string // contains filtered or unexported methods }
Term is a general type to represent both Applns, Absts and Vars
func Deserialize ¶ added in v1.1.0
Deserialize turns a De Bruijn index representation into the internal representation
func MustDeserialize ¶ added in v1.1.0
MustDeserialize turns a De Bruijn index representation into the internal representation, panics on error
type Var ¶ added in v1.1.0
type Var uint
Var is the De Bruijn index of a variable minus one
func (Var) AlphaEquivalent ¶ added in v1.1.0
AlphaEquivalent checks whether a Var and a Term are identical
func (Var) Serialize ¶ added in v1.1.0
Serialize returns the variable as a De Bruijn index representation