package lf
- Alphabetic
- Public
- All
Type Members
- trait ApplySolutionRule extends SolutionRule
-
abstract
class
ArgumentChecker extends AnyRef
common code for rules regarding the elimination-form: inference and reduction
-
case class
AtomicJudgement(rl: String, operator: GlobalName, arguments: List[Term]) extends Product with Serializable
c(args) where c is a constant with a certain role
- class BinaryLFConstantScala extends ConstantScala
-
case class
CompareTo(pattern: Term, position: Int) extends MatchStep with Product with Serializable
a fixed term in the template, typically an OMS
-
case class
ComplexJudgement(parameters: Context, hypotheses: List[AtomicJudgement], thesis: AtomicJudgement) extends Product with Serializable
{params} Atomic1 -> ...
{params} Atomic1 -> ... -> Atomicn -> Atomic
-
case class
DeclarativeRule(arguments: List[RuleArgument], conclusion: AtomicJudgement) extends Product with Serializable
simplest case: {params} Complex1 -> ...
simplest case: {params} Complex1 -> ... -> Complexn -> Atomic general case: parameters and assumptions may alternate
- case class Fix(name: List[LocalName]) extends ProofStep with Product with Serializable
- class FouraryLFConstantScala extends ConstantScala
-
class
GeneratedDepthRule extends MatchingSimplificationRule
a simplification rule generated by SimplificationRuleGenerator
- trait GeneratedRule extends AnyRef
-
class
GeneratedSolutionRule extends ValueSolutionRule
a solution rule generated by SimplificationRuleGenerator
a solution rule generated by SimplificationRuleGenerator
names.inside is such that all variables in names.before and names.after as well as the right hand side (which must be a variable) occur in it positions in names.inside are counted from 0
-
class
GenericApplyTerm extends InferenceAndTypingRule
Elimination: the type inference rule f : Pi x:A.B , conforms(t,A) ---> f t : B [x/t]
Elimination: the type inference rule f : Pi x:A.B , conforms(t,A) ---> f t : B [x/t]
This rule works for B:U for any universe U
This rule implements currying and all arguments at once
-
class
GenericBeta extends ComputationRule
the beta-reduction rule reducible(s,A) ---> (lambda x:A.t) s = t [x/s]
the beta-reduction rule reducible(s,A) ---> (lambda x:A.t) s = t [x/s]
the reducibility judgment is left abstract, usually the typing judgment s:A
This rule also normalizes nested applications so that it implicitly implements the currying rule (f s) t = f(s,t).
- class Injectivity extends TermBasedEqualityRule
- case class LFClassicHOLPreprocessor(ded: GlobalName, and: GlobalName, not: GlobalName, forall: Option[GlobalName] = None, or: Option[GlobalName] = None, implies: Option[GlobalName] = None, equiv: Option[GlobalName] = None, exists: Option[GlobalName] = None, equal: Option[GlobalName] = None) extends Preprocessor with Product with Serializable
- case class LFError(msg: String) extends Exception with Product with Serializable
- case class LFHOASElim(hoas: ViewFinderHOAS) extends Preprocessor with Product with Serializable
-
class
LFOperator extends Operator
for LF terms using Apply and Lambda
-
abstract
class
LFRealizationInScala extends RealizationInScala
base class of all realization classes generated by ScalaExporter
- class LFSym extends AnyRef
-
abstract
class
MatchStep extends AnyRef
tree structure of a Term optimized for efficient matching
- class MatchStepCompiler extends AnyRef
-
class
NotationGenerator extends ChangeListener
A ChangeListerner that adds notations for constants that are inference rules and do not provide notations.
A ChangeListerner that adds notations for constants that are inference rules and do not provide notations.
A constant is an inference rule if it takes some parameters (of non-judgment types) and some hypotheses (of judgment type) and return a judgment types.
For parsing, it makes the parameters implicit.
For presentation, it renders a proof tree with the hypotheses above, the infered type below, and the symbol name and the parameters to the left of the horizontal line.
- class NullaryLFConstantScala extends ConstantScala
-
case class
OuterInnerNames(outer: GlobalName, implArgsOuter: List[Int], before: List[LocalName], innerPos: Int, inner: GlobalName, implArgsInner: List[Int], inside: List[LocalName], after: List[LocalName]) extends Product with Serializable
convenience class for storing the names of an OuterInnerTerm
convenience class for storing the names of an OuterInnerTerm
- outer
outer operator
- implArgsOuter
positions of the implicit arguments of 'outer' (counting from 0)
- before
names of the before arguments (excluding implicit ones)
- innerPos
of innner term (= before.length)
- implArgsInner
positions of the implicit arguments of 'inner' (counting from 0)
- inside
names of the inside-arguments (excluding implicit ones)
- after
names of the after arguments (excluding implicit ones) this represents a left hand side of the form (excluding implicit arguments) outer(before,inner(inside),after) where before, inside, after do not include the implicit arguments
- trait PiOrArrowRule extends AnyRef
-
class
PlainBinderScala extends ConstantScala
auxiliary con/destructor for plain HOAS binders, e.g., forall [x:a] b with forall : (a -> prop) -> prop
auxiliary con/destructor for plain HOAS binders, e.g., forall [x:a] b with forall : (a -> prop) -> prop
See also TypedBinderScala
- class Plugin extends api.frontend.Plugin
-
case class
RecurseIntoOMA(children: List[MatchStep], position: Int) extends MatchStep with Product with Serializable
an OMA whose children must be matched recursively
- class RewriteRule extends SimplificationRule
-
abstract
class
RuleArgument extends AnyRef
argument of a declarative rule: a parameter or an assumption
- case class RuleAssumption(judgment: ComplexJudgement) extends RuleArgument with Product with Serializable
-
abstract
class
RuleGenerator extends ChangeListener
a first step towards generalizing the SimplificationRuleGenerator towards arbitrary rules
a first step towards generalizing the SimplificationRuleGenerator towards arbitrary rules
the usefulness is unclear because such rules usually theorem proving anyway the DeclarativeRule abstractions are very nice though it could also be interesting bootstrap the LF rules this way
-
class
RuleMatcher extends AnyRef
defines pattern matchers on terms for InferenceRules
- case class RuleParameter(name: LocalName, tp: Term) extends RuleArgument with Product with Serializable
- class ScalaExporter extends GenericScalaExporter
-
class
SimpleIrrelevanceRule extends TypeBasedSolutionRule
Irrelevance rules for (usually atomic) types that introduce proof irrelevance (as opposed to complex that happen to be irrelevant because their components are): - terms of these types are always equal - unknowns terms of these types are found using proof search; if provided, a default value is used to recover if search fails
- class SimplificationRuleGenerator extends ChangeListener
-
trait
SolutionRules extends LFRealizationInScala
this can be mixed into Scala-models of MMT theories to simplify adding additional rules
-
case class
SolveVariable(name: LocalName, position: Int) extends MatchStep with Product with Serializable
a template variable that is to be matched
- class TPTPPresenter extends Presenter
- class TernaryLFConstantScala extends ConstantScala
-
class
Twelf extends ExternalImporter with ChangeListener
importer wrapper for Twelf, which starts the catalog
-
class
TwelfParser extends Parser
A TextReader parses Twelf
-
class
TypedBinderScala extends ConstantScala
auxiliary con/destructor for plain HOAS binders that take an extra argument for the variable type, e.g., forall S [x:tm S] b with forall {s} (tm s -> prop) -> prop
auxiliary con/destructor for plain HOAS binders that take an extra argument for the variable type, e.g., forall S [x:tm S] b with forall {s} (tm s -> prop) -> prop
See also PlainBinderScala
-
class
TypedRelationalExtractor extends RelationalExtractor
The TypedRelationalExtractor adds a few more typing related informations to the .rel files.
- class UnaryLFConstantScala extends ConstantScala
- case class ViewFinderHOAS(tpS: GlobalName, exprS: GlobalName, lambdaS: GlobalName, applyS: GlobalName, arrowS: GlobalName) extends Product with Serializable
Value Members
-
object
Apply extends LFSym
provides apply/unapply methods for application of a term to a single argument the unapply method transparently handles associativity (currying) of application
-
object
ApplyGeneral
like ApplySpine, but also covers the case n=0, akin to FunType
like ApplySpine, but also covers the case n=0, akin to FunType
note that ApplySpine(f, Nil) != ApplyGeneral(f, Nil)
-
object
ApplySpine
provides apply/unapply methods for application of a term to a list of arguments the unapply method transparently handles associativity (currying) of application
provides apply/unapply methods for application of a term to a list of arguments the unapply method transparently handles associativity (currying) of application
Does *not* handle empty argument lists!
-
object
ApplyTerm extends GenericApplyTerm
the usual inference rule with conforms(t,A) = t:A
-
object
Arrow extends LFSym
provides apply/unapply methods for simple function type formation the unapply method does not match a dependent function type, even if the variable does not occur
-
object
BackwardPiElimination extends BackwardSearch
the proof step ?:A ----> e(?,...?) for e:Pi x1:A1,...,xn:An.A' where A' ^ s = A for some substitution s
the proof step ?:A ----> e(?,...?) for e:Pi x1:A1,...,xn:An.A' where A' ^ s = A for some substitution s
This rule works for any universe U and the case n=0. This rule replace ?'s in the result with their terms if they can be inferred through unification.
-
object
Beta extends GenericBeta
the usual beta-reduction rule s : A ---> (lambda x:A.t) s = t [x/s]
-
object
Binder
auxiliary con/destructor for HOAS binders, e.g., forall [x:a] b
- object Common
-
object
DropTypeAttribution extends ComputationRule
|- (t:A) = t
-
object
EqualityTerm extends InferenceRule
the type inference rule |- A : X, |- B : Y, |- X = Y ---> |- (A = B) : kind for identity kinds This rule goes beyond LF but it does not harm because it only adds kinds and thus do not affect types and terms
-
object
ExpandArrow extends ComputationRule
A simplification rule that implements A -> B = Pi x:A.B for fresh x.
A simplification rule that implements A -> B = Pi x:A.B for fresh x. LocalName.Anon is used for x
-
object
Extensionality extends ExtensionalityRule with PiOrArrowRule
equality-checking: the extensionality rule (equivalent to Eta) x:A|-f x = g x : B ---> f = g : Pi x:A.
equality-checking: the extensionality rule (equivalent to Eta) x:A|-f x = g x : B ---> f = g : Pi x:A. B If possible, the name of the new variable x is taken from f, g, or their type; otherwise, a fresh variable is invented.
- object FixRule extends ProofStepRule
-
object
FlattenCurrying extends ComputationRule
computation rule for apply that normalizes currying by rewriting terms into uncurried form
- object ForwardPiElimination extends ForwardSearch
-
object
FunTerm
Helper object with apply/unapply for matching and constructing LF functions, i.e.
Helper object with apply/unapply for matching and constructing LF functions, i.e. LF function type *inhabitants*.
The methods automatically curry and uncurry.
LF functions:
// Represent [a1: t1] [a2: t2] ... [an: tn] b // where ai is the bound variable and ti the given type FunTerm(List((a1, t1), ..., (an, tn)), b)
Say you already have a (definiens) term and now want to add an abstraction over the variable
x
:val defComponent: Term = ... val newTypeComponent = FunTerm( List((LocalName("x"), typeOfX)), defComponent )
Example: -
object
FunType
Helper object with apply/unapply for matching and constructing LF function types.
Helper object with apply/unapply for matching and constructing LF function types.
The methods - automaticallycurry and uncurry. - and include the case n=0, in particular, unapply always matches!
"Normal" LF function type:
// Represent a1 -> ... -> an -> b FunType(List((None, a1),...,(None, an)), b)
Dependently typed LF function type:
// Pi x1:a1. ... Pi xn:an. b FunType(List((Some(x1), a1),...,(Some(xn), an)), b)
You can also mix both styles.
Say you want to check whether a given term (of a type component) is a function type to
prop
:val typeComponent: Term = ... val propSymbol = GlobalName(...) // Give some specific MPath and LocalName match typeComponent { case FunType(args, OMS(propSymbol)) => ... case _ => ... }
, Say you already have a type and now want to add dependent types in front of it
// We have typeComponent and now want // {x: S} typeComponent val typeComponent: Term = ... val dependentVariableType: Term = ... val dependentTypes = List((Some(LocalName("x")), dependentVariableType)) val newTypeComponent = FunType(dependentTypes, typeComponent)
Examples: - object JudgmentTypes
- object KindInhabitable extends InhabitableRule
- object LF
- object LFConstantScala
-
object
LFEquality
provides apply/unapply methods for the LF equality symbol
-
object
LFHOAS extends HOASNotation
added by rule in LF theory
-
object
Lambda extends LFSym
provides apply/unapply methods for lambda abstraction
provides apply/unapply methods for lambda abstraction
for example, it permits constructing and pattern-matching terms as Lambda(variable-name, type, scope)
unapply curries automatically
-
object
LambdaCongruence extends TermHeadBasedEqualityRule
Congruence for Lambda
Congruence for Lambda
We cannot use CongruenceRule here because we have to flatten nested lambdas in addition.
This rule is a special case of Extensionality, but it does not make use of the type.
-
object
LambdaTerm extends IntroductionRule
Introduction: the type inference rule x:A|-t:B ---> lambda x:A.t : Pi x:A.B This rule works for B:U for any universe U
-
object
NormalizeCurrying extends TermBasedEqualityRule
equality rule for apply that only considers currying
- object OfType
-
object
PLF
helper object for polymorphic LF
-
object
Pi extends LFSym
provides apply/unapply methods for dependent function type formation
provides apply/unapply methods for dependent function type formation
the unapply method also matches a simple function type
unapply curries automatically
-
object
PiCongruence extends TermBasedEqualityRule with PiOrArrowRule
Congruence for Pi
Congruence for Pi
We cannot use HeadBasedEqualityRule here because we have to flatten nested Pis and consider -> in addition.
-
object
PiIntroduction extends BackwardInvertible
the proof step ?:Pi x:A.B ----> lambda x:A.(?:B)
the proof step ?:Pi x:A.B ----> lambda x:A.(?:B)
This rule works for any universe U
-
object
PiIrrelevanceRule extends TypeBasedSolutionRule with PiOrArrowRule
x:A |- ? : B ---> |- ? : Pi x:A.B
-
object
PiTerm extends FormationRule with PiOrArrowRule
Formation: the type inference rule x:A:type|-B:U ---> Pi x:A.B : U This rule works for any universe U
-
object
PiType extends TypingRule with PiOrArrowRule
type-checking: the type checking rule x:A|-f x:B ---> f : Pi x:A.B
-
object
PolymorphicApplyTerm extends EliminationRule
infers the type of a beta-redex whose lambda is not well-typed by itself because it quantifies over too large a universe
-
object
Realize extends ParametricRule
realize an LF-type/function as a SemanticType or SemanticOperator
-
object
ShallowPolymorphism extends InhabitableRule with PiOrArrowRule
A:U for some universe U ---> c: {x:A} B allowed
A:U for some universe U ---> c: {x:A} B allowed
This allows, e.g., declaring list: type -> type or id: {a:type} a -> a
- object SimplificationRuleGenerator
-
object
Skip extends MatchStep with Product with Serializable
an object that does not have to be compared, typically an implicit argument
-
object
Solve extends ValueSolutionRule with ApplySolutionRule
solution: This rule tries to solve for an unknown by applying lambda-abstraction on both sides and eta-reduction on the left.
solution: This rule tries to solve for an unknown by applying lambda-abstraction on both sides and eta-reduction on the left. Its effect is, for example, that X x = t is reduced to X = lambda x.t where X is a meta- and x an object variable.
- object SolveMultiple extends ValueSolutionRule
-
object
SolveType extends TypeSolutionRule with ApplySolutionRule
This rule tries to solve for an unknown by applying lambda-abstraction on both sides and eta-reduction on the left.
This rule tries to solve for an unknown by applying lambda-abstraction on both sides and eta-reduction on the left. Its effect is, for example, that X x = t is reduced to X = lambda x.t where X is a meta- and x an object variable.
-
object
StandardArgumentChecker extends ArgumentChecker
default implementation: type-check against expected type if not covered; skip if covered
- object TPTP
- object TPTPObjectPresenter extends ObjectPresenter
- object TermIrrelevanceRule extends ParametricRule
- object TheoryTypeWithLF extends ComputationRule
-
object
Twelf
helper methods for Twelf
- object TypeAttribution extends BinaryConstantScala
-
object
TypeAttributionTerm extends InferenceRule
|- t:A ---> |- (t:A) : A
- object TypeInhabitable extends InhabitableRule
- object Typed
-
object
Univ
provides apply/unapply methods for a universes in particular, Univ(1), Univ(2) are type and kind, respectively
-
object
UnivTerm extends InferenceRule
the type inference rule type:kind
-
object
UniverseKind extends UniverseRule
the rule that makes kind a valid universe
-
object
UniverseType extends UniverseRule
the rule that makes type a valid universe