core

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaEq

func AlphaEq(a, b ast.Term) bool

AlphaEq compares two core terms modulo alpha (de Bruijn makes this structural).

func Conv

func Conv(env *Env, t, u ast.Term, opts ConvOptions) bool

Conv reports whether t and u are definitionally equal under env. If opts.EnableEta is true, use η-rules for functions (Pi) and pairs (Sigma).

Implementation strategy: 1. Evaluate both terms to Values using NbE 2. Reify both Values back to normal forms 3. Apply η-expansion if enabled 4. Compare normal forms structurally

func ConvLegacy added in v1.2.0

func ConvLegacy(a, b ast.Term, flags EtaFlags) bool

Conv (legacy) - wrapper for backward compatibility

Types

type ConvOptions added in v1.2.0

type ConvOptions struct {
	EnableEta bool // Enable η-equality for functions (Π) and pairs (Σ)
}

ConvOptions controls the behavior of definitional equality checking.

type Env added in v1.2.0

type Env struct {
	// contains filtered or unexported fields
}

Env represents a typing environment for conversion checking. For now, this is a simple wrapper around eval.Env.

func NewEnv added in v1.2.0

func NewEnv() *Env

NewEnv creates a new empty environment.

func (*Env) Extend added in v1.2.0

func (e *Env) Extend(t ast.Term) *Env

Extend adds a term to the environment by evaluating it.

type EtaFlags

type EtaFlags struct{ Pi, Sigma bool }

Legacy API compatibility - kept for existing tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL