Packages

  • package root
    Definition Classes
    root
  • package info
    Definition Classes
    root
  • package kwarc
    Definition Classes
    info
  • package mmt
    Definition Classes
    kwarc
  • package api

    This is the main package of the MMT API.

    This is the main package of the MMT API.

    It holds subpackages for all data structures, data containers, and the central algorithms and services.

    Classes directly defined in the package

    Some minor classes that are used throughout MMT are defined in this package, in particular:

    • MMT URIs in the class Path and Namespace
    • processing and content errors in the class Error

    The package also contains root classes for certain types that are subclassed throughout the package. Most importantly:

    • StructuralElement: structure-level (= named) parts in the data structures for the MMT language: documents, theories, constants, ...
    • MMTTask: tasks for a single object: parsing, checking, ...
    • Rule: object-level part of the MMT language that is written in Scala

    Subpackages

    Data structures for the MMT language

    The data structures for the MMT languages are defined in 4 packages corresponding to the 4 levels: - documents: Documents and all other NarrativeElements - modules: Modules (= the toplevel declarations), in particular Theorys and Views - symbols: all Declarations inside modules, in particular Constants - objects: all anonymous Objects (e.g., formulas, functions, etc.), in particular Contexts and Terms

    The former 3 levels are jointly called 'structural' levels. All elements subclass StructuralElement, have an MMT URI, and carry an MMT URI referring to their parent in the MMT abstract syntax tree.

    Structural elements are extensible (via DerivedModules and DerivedDeclarations), and the package patterns defines declaration patterns as a built-in extension.

    All structural elements are mutable and implement the ContainerElement interface for changing their children. Objects, by contrast, are represented as immutable inductive types.(except for carrying metadata.Metadata and objects.ClientProperties). The boundary between structural elements and objects is mediated by ComponentContainers: these are mutable, owned by structural elements, and maintain objects.

    A few auxiliary data structures shifted to separate packages: - opaque: external (i.e., informal, computation) content - informal: partially outdated informal data structures - metadata: metadata annotations to all structural elements or objects

    The MMT main class and its internal state

    The package frontend contains the class Controller, which owns all state relevant for running MMT. Typically, each application creates a single instance of this class. The package also defines several other essential classes, most importantly MMT's extension (=plug-in, add-on) interfaces via the Extension class.

    The package libraries maintains the instances of MMT language data structures, in particular the Library class. Controller owns a Library, which stores all structural elements that have been loaded into memory.

    User interfaces

    The package frontend also contains the main executable classes, in particular the Shell class.

    The package gui collects all classes for building graphical user interfaces. This includes auxiliary classes for use in IDE plugins.

    The package web collects all classes for the HTTP interface of MMT.

    Physical storage of the MMT language files

    The package archives defines MMT Archives (= projects) as well as classes for building and working with archives. The latter include in particular the BuildManager and BuildTarget. Build targets include Importers and [Exporter]]s that translate between MMT and other formats.

    The package backend defines classes for maintaining archives and translating between the MMT URIs of structural elements and their physical storage locations.

    The central algorithms for processing MMT content

    The processing model of MMT consists of several major algorithms. - parser: read strings into MMT data structures - checking: check and refine MMT data structures - uom: pure computation on MMT data structures - proving: theorem proving on MMT data structures (in very early state)) - execution: imperative computation (in very, very early state) - presentation: rendering MMT data structures in user-facing formats (including HTML+presentation MathML)

    All algorithms are defined in Extensions coupled with default implementations. Moreover, all algorithms are split into two separate levels, one for structural elements and objects. See LeveledExtension.

    The package notations maintains the common code for parsing and presentation.

    The package valuebases maintains mathematical databases as a part of MMT.

    Other algorithms on the MMT data structures

    The package ontology contains a relational, semantic web-style ontology and query engine for it.

    The package moc contains change management.

    The package refactoring contains refactoring principles.

    General purpose utility functions

    The package utils defines general purpose APIs for files, URIs, HTML building, etc.

    Definition Classes
    mmt
  • package archives

    This package holds all classes related to MMT Archives (= project).

    This package holds all classes related to MMT Archives (= project).

    The BuildManager allows defining BuildTargets to run on archives, including in particular Importers and Exporters.

    Most archives are stored in hub of git repositories such as and MathHub or GitHub. Such hubs are represented by the class LMHHub, which allows for cloning, etc. archives.

    The list of currently open archives (from which MMT will load content if needed) is maintained by the backend.Backend.

    Definition Classes
    api
  • package backend

    This package maintains the interface between MMT content in persistent physical storage and MMT content loaded into memory.

    This package maintains the interface between MMT content in persistent physical storage and MMT content loaded into memory.

    The class Storage is the interface for individual physical storage containers. Most of the time this corresponds to a folder containing an archives.Archive.

    Content is usually stored in OMDoc XML format, which is parsed by the XMLStreamer.

    The class Backend maintains the registered storages and performs conversion between logical MMT URIs and physical locations.

    The frontend.Controller owns an instance of Backend. Any referenced MMT URI is lazily and transparently loaded from the backend into memory and unloaded if MMT runs out of memory.

    Definition Classes
    api
  • package checking

    The algorithm for checking MMT content.

    The algorithm for checking MMT content. See api for an overview of the algorithms.

    The main interfaces are - Checker: the main interface for checkers (combining a structure and an object checker) - StructureChecker: checking structural elements - ObjectChecker: checking objects

    The main implementations are - MMTStructureChecker for structural elements - RuleBasedChecker for objects

    The latter creates a Solver for each judgment, which perform type reconstruction.

    Structure checking is not extensible except through DerivedElements. Object checking is extensible through Rules.

    Definition Classes
    api
  • package documents

    NarrativeElements are all elements that do not have a semantics of their own.

    NarrativeElements are all elements that do not have a semantics of their own.

    The most important case are Documents. Inside, documents a few other other documents may occur.

    Definition Classes
    api
  • package execution

    The algorithm for imperatively executing MMT content.

    The algorithm for imperatively executing MMT content. This is currently very young and immature.

    See api for an overview of the algorithms.

    Definition Classes
    api
  • package frontend

    This package defines several central classes: - Controller is the main MMT class.

    This package defines several central classes: - Controller is the main MMT class. - Shell is the main executable (which will create one controller). - MMTConfig is the MMT configuration data structure. A controller maintains one configuration. - Extension is the addon/plugin interface of MMT. Every extension has access to one controller instance. - Report handles logging, and every instance of Logger has access to a report instance.

    Definition Classes
    api
  • package gui

    GUIPanel and [GUIFrame]] maintain a swing-based graphical interface to the frontend.Controller and its children.

    GUIPanel and [GUIFrame]] maintain a swing-based graphical interface to the frontend.Controller and its children.

    Definition Classes
    api
  • package informal
    Definition Classes
    api
  • package libraries

    Library maintains the structural elements that have been loaded into memory.

    Library maintains the structural elements that have been loaded into memory. That includes the theory diagram and all documents.

    ImplicitGraph maintains the commutative sub-diagram of implicit morphisms.

    Definition Classes
    api
  • package metadata

    MetaDatum is the stateless class that represents metadata items.

    MetaDatum is the stateless class that represents metadata items.

    MetaData statefully maintains a set of MetaDatums.

    Elements that have metadata inherit from HasMetaData.

    Linker and Tagger make setting and getting metadata easier.

    Definition Classes
    api
  • package moc

    Change is the main class statelessly representing differences/changes.

    Change is the main class statelessly representing differences/changes.

    Differ is a differ for MMT data structures.

    Definition Classes
    api
  • package modules

    MMT Modules, i.e., Theorys and Views.

    MMT Modules, i.e., Theorys and Views.

    Link unifies Views and symbols.Structures, the two kinds of atomic theory morphisms.

    ModuleOrLink unifies the two. That class defines most of the state of a module, in particular the body.

    Definition Classes
    api
  • package notations

    This package maintains the common data structures for parsing and presentation.

    This package maintains the common data structures for parsing and presentation.

    TextNotation is the main notation class. It is similar to MMT objects, in particular it is stateless.

    NotationContainer statefully maintains the notations assigned to a declaration. These are owned by StructuralElements to carry notations, akin to how they carry type/definition.

    Definition Classes
    api
  • package objects

    MMT objects are

    MMT objects are

    AnonymousDiagram, AnonymousTheory, and AnonymousMorphism represent anonymous counterparts to libraries.Library modules.Module}.

    This package also contains various auxiliary classes: - Position defines paths within objects - SubstitutionApplier is the main interface for substitution strategies. - Matcher is a simple matcher.

    Definition Classes
    api
  • AnonymousBody
  • AnonymousDiagram
  • AnonymousDiagramCombinator
  • AnonymousMorphism
  • AnonymousMorphismCombinator
  • AnonymousTheory
  • AnonymousTheoryCombinator
  • Appendage
  • BinaryObjJudgement
  • ComplexMorphism
  • ComplexTerm
  • ComplexTheory
  • CongruenceClosure
  • Context
  • Conversions
  • DerivedOMLFeature
  • DerivedVarDeclFeature
  • DiagramArrow
  • DiagramElement
  • DiagramNode
  • DomainElement
  • Equality
  • EqualityContext
  • Formal
  • Free
  • FreeOrAny
  • IncludeOML
  • IncludeSub
  • IncludeVarDecl
  • Inhabitable
  • Inhabited
  • IsContext
  • IsMorphism
  • IsRealization
  • IsTheory
  • Judgement
  • MatchFail
  • MatchResult
  • MatchSuccess
  • Matcher
  • MemoizedSubstitutionApplier
  • ModExp
  • Morph
  • MorphType
  • OMA
  • OMATTR
  • OMATTRMany
  • OMAorAny
  • OMBIND
  • OMBINDC
  • OMCOMP
  • OMFOREIGN
  • OMID
  • OMIDENT
  • OMINST
  • OML
  • OMLIT
  • OMLITTrait
  • OMLList
  • OMM
  • OMMOD
  • OMPMOD
  • OMS
  • OMSemiFormal
  • OMStructuralInclude
  • OMV
  • Obj
  • PlainSubstitutionApplier
  • Position
  • RealizeOML
  • SemiFormalObject
  • SemiFormalObjectList
  • ShortURIPrinter
  • SmartSubstitutionApplier
  • Stack
  • StatelessTraverser
  • StructureOML
  • StructureSharingSubstitutionApplier
  • StructureSub
  • StructureVarDecl
  • Sub
  • Substitution
  • SubstitutionApplier
  • Subtyping
  • TUnion
  • Term
  • Text
  • TheoryExp
  • TheoryType
  • ThisTypeTrait
  • TorsoForm
  • TorsoNormalForm
  • Traverser
  • Typing
  • UnaryObjJudgement
  • Universe
  • UnknownOMLIT
  • VarDecl
  • WFJudgement
  • XMLNode
  • package ontology

    This package contains a relational ontology and a query engine for it.

    This package contains a relational ontology and a query engine for it.

    The main classes are: - RelationalElement defines the concepts and relation of the ontology (TBox) - RelationalManager extracts the ABox from MMT content - RelStore maintains the model of the ontology (ABox) - RelationGraphExporter allows exporting the ABox as a graph. - Query defines a query language for the ontology - Evaluator implements the query language for a given ABox. - Search maintains classes for faceted search, in particular the facet for MathWebSearch.

    Definition Classes
    api
  • package opaque

    Informal or unknown content that MMT does not process.

    Informal or unknown content that MMT does not process. The main classes are - OpaqueElement: such content - OpaqueElementInterpreter the abstract interface for extensions that interpret it

    Definition Classes
    api
  • package parser

    The algorithm for parsing MMT content (strings to MMT data structures).

    The algorithm for parsing MMT content (strings to MMT data structures). See api for an overview of the algorithms.

    The main interfaces are - Parser: the main interface for parser (combining a structure and an object parser) - StructureParser: parsing structural elements - ObjectParser: parsing objects

    The main implementations are - KeywordBasedParser for structural elements in .mmt files - NotationBasedParser for objects

    The latter creates a Scanner for each string, which applies notations to parse user-defined mixifx syntax.

    Structure parsing is extensible using ParserExtensions. Object parsing is extensible using notations or LexerExtensions.

    Definition Classes
    api
  • package patterns

    Declaration patterns in the sense of Horozal's PhD thesis, realized as two special cases of structural features: - Pattern for the patterns (elaborates to nothing) - Instance for the instances of patterns (elaborates by looking up the pattern)

    Declaration patterns in the sense of Horozal's PhD thesis, realized as two special cases of structural features: - Pattern for the patterns (elaborates to nothing) - Instance for the instances of patterns (elaborates by looking up the pattern)

    Definition Classes
    api
  • package presentation

    The algorithm for presenting MMT content (data structures to user-facing formats).

    The algorithm for presenting MMT content (data structures to user-facing formats). See api for an overview of the algorithms.

    The main interfaces are - Presenter: the main interface for parser (combining a structure and an object parser) - StructurePresenter: presenting structural elements - ObjectPresenter: presenting objects

    The main implementations are (in each case for structural elements and objects) - for OMDoc XML: OMDocPresenter resp. OpenMathPresenter - for plain strings (using the toString methods): TextPresenter resp. ObjectTextPresenter - for nice human-oriented strings: MMTStructurePresenter resp. NotationBasedParser - for HTML: HTMLPresenter resp. MathMLPresenter

    Definition Classes
    api
  • package proving

    The algorithm for proving theorems about MMT content.

    The algorithm for proving theorems about MMT content. This is very premature and experimental.

    See api for an overview of the algorithms.

    The main interfaces are - Prover: object level proving

    Structure level proving does not exist yet.

    The main implementations are - RuleBasedProver for object-level proving

    The latter creates a Searcher for each proving task, which applies search rules to find MMT objects.

    Definition Classes
    api
  • package refactoring
    Definition Classes
    api
  • package symbols

    MMT Declarations are the elements of Modules.

    MMT Declarations are the elements of Modules. The kinds of declarations are documented at Declaration.

    ObjContainer are owned by structural elements, in particular by declarations, to store objects.

    Definition Classes
    api
  • package uom

    The algorithm for immutably computing with MMT content, i.e., simplification (strings to MMT data structures).

    Simplification

    The algorithm for immutably computing with MMT content, i.e., simplification (strings to MMT data structures). See api for an overview of the algorithms.

    The main interfaces are - Simplifier: the main interface for parser (combining a structure and an object simplifier) - StructureSimplifier: simplifying structural elements - ObjectSimplifier: simplifying objects

    The main implementations are - ElaborationBasedSimplifier for structural elements - RuleBasedSimplifier for objects

    Structure simplification is extensible using derived elements. Object simplification is extensible using rules.

    Literals and semantic objects

    This package also contains the classes for using Scala objects as MMT literals.

    SemanticType defines types as sets of Scala objects. SemanticValue defines a distinguished element of such a type. SemanitcOperator defines functions on such types as Scala functions.

    Literals and operations on them are injected into the MMT language by declaring RealizedValue, RealizedType and RealizedOperator rules, which tie a syntactic type/operator (i.e., an MMT term) to a semantic counterpart.

    StandardLiterals defines semantic types for the most important types.

    RealizedTheory represents an MMT theory programmed in Scala, usually as a Scala class.

    Scala companion objects for MMT theories

    TheoryScala and ConstantScala are auxiliary classes that are useful when implementing MMT rules or other logic-specific algorithms.

    Definition Classes
    api
  • package utils

    This package defines various MMT-independent high-level APIs.

    This package defines various MMT-independent high-level APIs. Various basic functions are declared directly in this package object in order to be easily available.

    Most other files in this package are self-contained and independent of the rest of MMT and each other. We describe them in groups below.

    Data structures*

    - Union disjoint union of Scala types - MyList extensions of Scala's lists (via implicit conversions) - HashRelation, HashMapToSet, and HashEquality: hash-related data structures for - While while loops that allow for break and continue

    General purpose utilities

    - Killable tasks that can be notified that they should be canceled. In particular, MMTTasks can be aborted without risking an inconsistent state. - Unparsed for simple parsing of strings - ScalaTo serialization helpers for Scala objects - ValueCache factory methods that introduce structure sharing by resuing previous pointers - XMLToScala framework for conveniently turning a set of case classes into an XML parser for the corresponding schema

    Wrappers for low-level APIs

    MMT provides various APIs that extend or simplify APIs provided Java or Scala: - File file paths and interacting with files - URI URIs - xml various helper function for working with XML and dereferencing URLs (not really a wrapper but fits best here) - ShellCommand commands executed on the system shell

    APIs for external languages

    - Dot the dot languages for graph layouting - JSON the JSON language - HTML API for building HTML pages programmatically

    Definition Classes
    api
  • package valuebases

    This package maintains databases of cocnrete mathematical objects.

    This package maintains databases of cocnrete mathematical objects.

    Concrete objects are special MMT Terms that can be represented as concrete database objects (e.g., JSON). The connection between the two is mediated by Codecs and CodecOerator. The codec-based translation is implemented in the Coder.

    Definition Classes
    api
  • package web

    Server maintains the HTTP interface of MMT.

    Server maintains the HTTP interface of MMT. The server is owned by the frontend.Controller.

    It can be customized by ServerExtensions.

    The REPLServer maintains a set of independent REPL loops for MMT content.

    Definition Classes
    api
p

info.kwarc.mmt.api

objects

package objects

MMT objects are

AnonymousDiagram, AnonymousTheory, and AnonymousMorphism represent anonymous counterparts to libraries.Library modules.Module}.

This package also contains various auxiliary classes: - Position defines paths within objects - SubstitutionApplier is the main interface for substitution strategies. - Matcher is a simple matcher.

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. objects
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait AnonymousBody extends ElementContainer[OML] with DefaultLookup[OML] with ShortURIPrinter

    auxiliary class for storing lists of declarations statefully without giving it a global name

    auxiliary class for storing lists of declarations statefully without giving it a global name

    anonymous modules are object that can be converted into these helper classes using the objects AnonymousTheory and AnonymousMorphism

  2. case class AnonymousDiagram(nodes: List[DiagramNode], arrows: List[DiagramArrow], distNode: Option[LocalName]) extends Product with Serializable

    a diagram in the category of theories and morphisms

    a diagram in the category of theories and morphisms

    nodes

    the nodes

    arrows

    the arrows

    distNode

    the label of a distinguished node to be used if this diagram is used like a theory invariant: codomain of distArrow is distNode

  3. case class AnonymousMorphism(decls: List[OML]) extends AnonymousBody with Product with Serializable

    a morphism given by domain, codomain, and body

  4. case class AnonymousTheory(mt: Option[MPath], decls: List[OML]) extends AnonymousBody with Product with Serializable

    a theory given by meta-theory and body

  5. case class Appendage(head: GlobalName, extremities: List[Term]) extends Product with Serializable

    see TorsoForm for explanation on the intended use

  6. abstract class BinaryObjJudgement extends Judgement

    Common code for some binary judgements

  7. class CongruenceClosure extends AnyRef

    reduces an equality to a list of equalities by applying congruence and alpha-renaming

    reduces an equality to a list of equalities by applying congruence and alpha-renaming

    no context-specific reasoning or simplification is applied always succeeds (returns List(eq) at worst)

  8. case class Context(variables: VarDecl*) extends Obj with ElementContainer[VarDecl] with DefaultLookup[VarDecl] with Product with Serializable

    An MMT context as a list of variable declarations VarDecl.

    An MMT context as a list of variable declarations VarDecl.

    Being a list especially implies that there is an **order of the entries**. For example, this is important when using the Context in an OMBINDC to represent a lambda term: (λxy. x + y) will be represented as OMBINDC whose context has VarDecl entries "x", "y" in that order.
    Another situation where order is important is when later VarDecl declarations refer to previous ones.

    Note that variables is not necessarily meant in a strict sense of only variables, namely a context can also include declarations of a whole theory and all of its (transitively) included theories by use of IncludeVarDecl. There is an helper apply method on the companion object of Context: scala Context(MPath(/* ... */))

    variables

    The context's variables

  9. class DerivedOMLFeature extends AnyRef
  10. class DerivedVarDeclFeature extends AnyRef

    use this to create apply/unapply functions for variable declarations for a specific feature

  11. case class DiagramArrow(label: LocalName, from: LocalName, to: LocalName, morphism: AnonymousMorphism, isImplicit: Boolean) extends DiagramElement with Product with Serializable

    an arrow in an AnonymousDiagram

    an arrow in an AnonymousDiagram

    label

    the label of this arrow

    from

    the label of the domain node in the same diagram

    to

    the label of the codomain node in the same diagram

    morphism

    the morphism attached to this arrow (the same theory may be attached to multiple nodes)

  12. sealed abstract class DiagramElement extends ShortURIPrinter

    used in AnonymousDiagram

  13. case class DiagramNode(label: LocalName, theory: AnonymousTheory) extends DiagramElement with Product with Serializable

    a node in an AnonymousDiagram

    a node in an AnonymousDiagram

    label

    the label of this node

    theory

    the theory attached to this node (the same theory may be attached to multiple nodes)

  14. case class DomainElement(name: LocalName, defined: Boolean, subdomain: Option[(Term, List[LocalName])]) extends Product with Serializable

    an auxiliary class to store domains of Contexts and theory expressions (see TheoryExp)

    an auxiliary class to store domains of Contexts and theory expressions (see TheoryExp)

    if parameter name is an import, subdomain is the imported theory and (if not defined as in symbols.DeclaredStructure and StructureVarDecl) the instantiated names of the partial morphism

    name

    the name

    defined

    true if name has a definiens (including total morphisms in symbols.DefinedStructure and StructureVarDecl)

    subdomain

    see above

  15. case class Equality(stack: Stack, tm1: Term, tm2: Term, tpOpt: Option[Term]) extends Judgement with Product with Serializable

    represents an equality judgement, optionally at a type context |- t1 = t2 : tp if t = Some(tp) or context |- t1 = t2 if t = None

  16. case class EqualityContext(stack: Stack, context1: Context, context2: Context, uptoAlpha: Boolean) extends Judgement with Product with Serializable

    represents an equality judgement between contexts context |- context1 = context2

  17. case class Formal(obj: Term) extends SemiFormalObject with Product with Serializable
  18. case class Inhabitable(stack: Stack, wfo: Term) extends UnaryObjJudgement with WFJudgement with Product with Serializable

    A term wfo is inhabitable if it can occur on the right side of a Typing judgement.

    A term wfo is inhabitable if it can occur on the right side of a Typing judgement. Such terms can be used as the types of constants and variables.

  19. case class Inhabited(stack: Stack, tp: Term) extends UnaryObjJudgement with Product with Serializable

    A term tp is inhabited if it occurs on the right side of a Typing judgement.

    A term tp is inhabited if it occurs on the right side of a Typing judgement. Via Curry-Howard, such terms can be thought of as provable propositions. Therefore, this judgement is usually undecidable.

  20. case class IsContext(stack: Stack, wfo: Context) extends UnaryObjJudgement with WFJudgement with Product with Serializable

    well-formedness of contexts

  21. abstract class Judgement extends HashEquality[Judgement] with HistoryEntry

    the type of object level judgments as used for typing and equality of terms

  22. sealed abstract class MatchResult extends AnyRef

    returned by the Matcher

  23. final case class MatchSuccess(solution: Substitution, total: Boolean) extends MatchResult with Product with Serializable

    solution

    the substitution for the query (template) variables

    total

    true if all query variables were solved; if false, the terms are equal for any value of the unsolved variables

  24. class Matcher extends Logger

    Matches a goal term against a template term.

    Matches a goal term against a template term.

    • Input: terms template and goal
    • Output: substitution solution such that template ^ solution == goal, where Term.^ is the method applying the substitution.

    Full code example see below.

    Examples:
    1. In normed vector spaces you might have the template term ||x - y|| and would like to match the goal term ||(a - b) - c|| with it.
      The matcher will give you the substitution solution = [x := (a - b), y := c]. This is a special case of (typed!) unification. In general, unification seeks a solution substitution such that template solution == goal solution, i.e. the substitution applied on *both* sides. Thus the template usually contains variables intended for substitution ("matching"), but the goal does not. Still, the goal term may contain free variables as in the example above, they will then be part of the solution substitution - but only in the RHS of the substitutions. No equality relation is taken into account except alpha-conversion of bound variables and solution rules.

    2. ,
    3. scala // Construct the goal and template terms // val namespace = DPath(URI("http://example.com")) val module = namespace ? "myModule" val norm = OMID(module ? "norm") val minus = OMID(module ? "minus") // "||(x - y) - z||" val goal = OMA( norm, List( OMA( minus, List( OMA(minus, List(OMV("x"), OMV("y"))), OMV("z") ) ) ) ) // "||a - b||" val template = OMA( norm, List(OMA( minus, List(OMV("a"), OMV("b")) )) ) // Empty rule set because we don't use any logic foundation // specific typing rules (e.g. the rule in LF for function // application) val matcher = new Matcher(ctrl, new MutableRuleSet) val matchResult = matcher( Context(VarDecl(LocalName("x"), LocalName("y"), LocalName("z"))), goal, Context(VarDecl(LocalName("a"), LocalName("b"))), template ) // MatchSuccess(a:=(http://example.com?myModule?minus x y), b:=z,true)

    Note

    The class can be reused for multiple matches using the same RuleSet but is not thread-safe.

    ,

    Beware of situations where the template and goal term share some variables. E.g. take template term = "a", goal term = "a - a". Intuitively, this should be a match with the substitution [a := a - a], but this class cannot handle this. The following code will lead to a MatchFail: scala val matchResult = matcher( Context(VarDecl(LocalName("a"))), OMA(minus, List(OMV("a"), OMV("a"))), Context(VarDecl(LocalName("a"))), OMV("a") ) As a solution you might want to first make your template variables fresh: scala val matchResult = matcher( Context(VarDecl(LocalName("a"))), OMA(minus, List(OMV("a"), OMV("a"))), Context(VarDecl(LocalName("b"))), OMV("b") ) // MatchSuccess(b:=(http://example.com?myModule?minus a a),true) println(matchResult)

  25. class MemoizedSubstitutionApplier extends SubstitutionApplier

    Like SmartSubstitutionApplier, but remembers previous applications.

  26. case class OMA(fun: Term, args: List[Term]) extends Term with Product with Serializable

    An OMA represents an application of a term to a list of terms

    An OMA represents an application of a term to a list of terms

    fun

    the function term

    args

    the list of argument terms (may be Nil)

  27. case class OMATTR(arg: Term, key: OMID, value: Term) extends Term with Product with Serializable

    An OMATTR represents an attributed term.

    An OMATTR represents an attributed term.

    arg

    the term without attribution

    key

    the key (This must be an OMS in OpenMath.)

    value

    the value

  28. case class OMBINDC(binder: Term, context: Context, scopes: List[Term]) extends Term with Product with Serializable

    An OMBINDC represents a binding with arbitrarily many scopes

    An OMBINDC represents a binding with arbitrarily many scopes

    binder

    the binder

    context

    the bound variables (from outside to inside)

    scopes

    the scopes/bodies/matrices of the binder (usually exactly 1)

  29. case class OMFOREIGN(node: Node) extends Term with Product with Serializable

    An OMFOREIGN represents an OpenMath foreign object.

    An OMFOREIGN represents an OpenMath foreign object.

    node

    the XML element holding the foreign object

  30. case class OMID(path: ContentPath) extends Term with Product with Serializable

    An OMID represents an MMT reference

  31. case class OML(name: LocalName, tp: Option[Term], df: Option[Term], nt: Option[TextNotation] = None, featureOpt: Option[String] = None) extends Term with NamedElement with Product with Serializable

    local declarations with type and/or definiens, with scope, but not subject to alpha-renaming and substitution

    local declarations with type and/or definiens, with scope, but not subject to alpha-renaming and substitution

    These could be used for the typed/defined fields in a record type/value or the selection function.

  32. case class OMLIT(value: Any, rt: RealizedType) extends Term with OMLITTrait with Product with Serializable

    A literal consists of a RealizedType rt and a value of SemanticType rt.semType.

    A literal consists of a RealizedType rt and a value of SemanticType rt.semType.

    Literals can be constructed conveniently using RealizedType.apply

    invariant for structurally well-formed literals: the value is valid and normal, i.e, rt.semType.valid(value) and rt.semType.normalform(value) == value

  33. sealed trait OMLITTrait extends Term

    The joint methods of OMLIT and UnknownOMLIT

  34. case class OMV(name: LocalName) extends Term with Product with Serializable

    An OMV represents a reference to a variable.

    An OMV represents a reference to a variable.

    name

    the name of the referenced variable

  35. abstract class Obj extends Content with BaseType with ShortURIPrinter with HashEquality[Obj]

    An Obj represents an MMT object.

    An Obj represents an MMT object. MMT objects are represented by immutable Scala objects.

  36. case class Position(indices: List[Int]) extends Product with Serializable

    A path in the syntax tree of an object

  37. trait SemiFormalObject extends Content
  38. trait SemiFormalObjectList extends AnyRef
  39. trait ShortURIPrinter extends AnyRef
  40. case class Stack(context: Context) extends Product with Serializable
  41. abstract class StatelessTraverser extends Traverser[Unit]

    A StatelessTraverser is like a Traverser but does not carry a state during the traversal.

  42. case class Sub(name: LocalName, target: Term) extends Obj with Product with Serializable

    a case in a substitution

  43. case class Substitution(subs: Sub*) extends Obj with Product with Serializable

    substitution between two contexts

  44. abstract class SubstitutionApplier extends AnyRef

    A SubstitutionApplier is an abstraction for the substitution application function.

    A SubstitutionApplier is an abstraction for the substitution application function.

    Its purpose is to permit optimized versions of substitution that share the traversal and capture-avoidance code.

    A SubstitutionApplier is carried along as an implicit argument of Obj.^^, which implements the shared parts.

  45. case class Subtyping(stack: Stack, tp1: Term, tp2: Term) extends BinaryObjJudgement with Product with Serializable

    represents a subtyping judgement context |- tp1 <: tp2

  46. sealed abstract class Term extends Obj with ThisTypeTrait

    A Term represents an MMT term.

  47. case class Text(format: String, obj: String) extends SemiFormalObject with Product with Serializable
  48. trait ThisTypeTrait extends AnyRef
  49. case class TorsoForm(torso: Term, apps: List[Appendage]) extends HashEquality[TorsoForm] with Product with Serializable

    The torso form of a term is named akin to the head normal forms.

    The torso form of a term is named akin to the head normal forms.

    For example, OMA(h1, OMA(h2, tr, ext2), ext1) is in torso form with tr as the torso and (h1,ext1) and (h2,ext2) as Appendages that are attached to the torso.

    Its torso normal form is TorsoNormalForm(c, Appendage(h1, ext1) :: Appendage(h2, ext2) :: Nil)

    The point of the torso normal form is understood by considering a type theory, whose constructor are paired into introduction and elimination operators. Then the torso form is a useful representation for a series h1, h2, ... of eliminators applied to a term (the torso). The torso is either atomic or a sequence of introductors. In the latter case, a reduction rule (e.g., beta) can be applied, which eventually yields an atomic torso.

    For example, OMA(@,OMA(pi1,c),a) arises from the constant c (of product type) by first projection out a component (a function) and then applying it to a.

  50. case class TorsoNormalForm(unknowns: List[LocalName]) extends Product with Serializable

    In the torso normal form, the torso cannot be further decomposed anymore, typically it is a variable or constant.

    In the torso normal form, the torso cannot be further decomposed anymore, typically it is a variable or constant. See TorsoForm for further explanations.

  51. abstract class Traverser[A] extends AnyRef

    A Traverser is a function on Term defined by context-sensitive induction.

    A Traverser is a function on Term defined by context-sensitive induction.

    The auxiliary methods in the companion object can be used to handle all cases that traverse the object without any change. During the traversal, a value of type State may be used to carry along state.

  52. case class Typing(stack: Stack, tm: Term, tp: Term, tpSymb: Option[GlobalName] = None) extends BinaryObjJudgement with WFJudgement with Product with Serializable

    represents a typing judgement context |- tm : tp tpSymb - optionally specified typing symbol

  53. abstract class UnaryObjJudgement extends Judgement

    Common code for some judgements

  54. case class Universe(stack: Stack, wfo: Term) extends UnaryObjJudgement with WFJudgement with Product with Serializable

    A term univ is a universe if all its inhabitants are Inhabitable.

  55. case class UnknownOMLIT(valueString: String, synType: Term) extends Term with OMLITTrait with Product with Serializable

    degenerate case of OMLIT when no RealizedType was known to parse a literal

    degenerate case of OMLIT when no RealizedType was known to parse a literal

    This class is awkward but necessary to permit a lookup-free parser, which delays parsing of literals to a later phase. UnknownOMLITs are replaced with OMLITs in the libraries.StructureChecker.

    synType

    the type of the this literal

  56. case class VarDecl(name: LocalName, feature: Option[String], tp: Option[Term], df: Option[Term], not: Option[TextNotation]) extends Obj with NamedElement with Product with Serializable

    represents an MMT term variable declaration

    represents an MMT term variable declaration

    name

    name

    tp

    optional type

    df

    optional definiens

    not

    optional notation

  57. trait WFJudgement extends Judgement

    A WFJudgment defines well-formed objects

  58. case class XMLNode(obj: Node) extends SemiFormalObject with Product with Serializable
  59. case class OMSemiFormal(tokens: List[SemiFormalObject]) extends Term with SemiFormalObjectList with Product with Serializable

    An OMSemiFormal represents a mathematical object that mixes formal and informal components

    An OMSemiFormal represents a mathematical object that mixes formal and informal components

    Annotations
    @MMT_TODO( message = ... )
    Deprecated

    this should be replaced with the urtheory for semiformal objects

Value Members

  1. object AnonymousDiagramCombinator

    bridges between AnonymousDiagram and Term

  2. object AnonymousMorphismCombinator

    bridges between AnonymousMorphism and Term

  3. object AnonymousTheoryCombinator

    bridges between AnonymousTheory and Term

  4. object ComplexMorphism
  5. object ComplexTerm

    ComplexTerm provides apply/unapply methods to unify OMA and OMBINDC as well as named arguments and complex binders

    ComplexTerm provides apply/unapply methods to unify OMA and OMBINDC as well as named arguments and complex binders

    It does not subsume the OMID case

  6. object ComplexTheory

    the normal form of a theory expression is a context

    the normal form of a theory expression is a context

    the apply/unapply functions convert between them

  7. object CongruenceClosure extends CongruenceClosure

    trivial case without any assumptions

  8. object Context extends Serializable

    helper object

  9. object Conversions

    Stores all implicit conversions related to MMT objects This is imported in all source files that use conversions

  10. object DerivedOMLFeature
  11. object DerivedVarDeclFeature
  12. object Free
  13. object FreeOrAny

    always matches, possibly with empty context

  14. object IncludeOML extends DerivedOMLFeature with Unnamed
  15. object IncludeSub
  16. object IncludeVarDecl extends DerivedVarDeclFeature
  17. object IsMorphism

    An abbreviation for the meta-level typing judgement for valid morphisms

  18. object IsRealization

    An abbreviation for a IsMorphism into the current theory

  19. object IsTheory

    An abbreviation for the meta-level typing judgement for valid theories

  20. object MatchFail extends MatchResult with Product with Serializable

    definitely not equal

  21. object ModExp extends TheoryScala
  22. object Morph
  23. object MorphType

    MorphType(from,to) is the type of morphisms

  24. object OMATTRMany

    apply/unapply methods for a list of attributions

  25. object OMAorAny

    special application that elides empty argument lists:

    special application that elides empty argument lists:

    returns

    f if args is Nil, OMA(f, args) otherwise; always matches

  26. object OMBIND

    OMBIND represents a binding without condition

  27. object OMCOMP

    An OMCOMP represents the associative composition of a list of morphisms.

    An OMCOMP represents the associative composition of a list of morphisms. Compositions may be nested.

  28. object OMIDENT

    An OMIDENT represents the identity morphism of a theory.

  29. object OMINST

    Covariant interpretation of theory parameters: a morphism m:S(args) --> T is seen as a morphism args,m: S --> T Such morphisms occur in particular if S(args) is included into T, i.e., if m is the identity of S This case is represented by OMINST(S,T,args).

    Covariant interpretation of theory parameters: a morphism m:S(args) --> T is seen as a morphism args,m: S --> T Such morphisms occur in particular if S(args) is included into T, i.e., if m is the identity of S This case is represented by OMINST(S,T,args). args must be well-typed relative to T. invariant: args.nonEmpty (apply method allows it by using OMIDENT instead; unapply method does not match OMIDENT)

  30. object OML extends Serializable
  31. object OMLList
  32. object OMM

    An OMM represents the application of a morphism to a term

  33. object OMMOD

    An OMMOD represents a reference to a module (which may be a theory or a morphism expression).

  34. object OMPMOD

    An OMPMOD represents a reference to a parametric module applied to arguments

  35. object OMS
  36. object OMSemiFormal extends Serializable
  37. object OMStructuralInclude

    OMStructuralInclude(f,t): f -> t is the identity on the meta-theory of f (if any) and renames every declaration f?c in f to t?c For now, f may not have includes.

  38. object OMV extends Serializable

    helper object

  39. object Obj

    Obj contains the parsing methods for objects.

  40. object PlainSubstitutionApplier extends SubstitutionApplier

    the default SubstitutionApplier defined in the usual way

    the default SubstitutionApplier defined in the usual way

    This is used by Obj.^

  41. object Position extends Serializable
  42. object RealizeOML extends DerivedOMLFeature with Unnamed

    a realization declaration is like a structure/include except it *postulates* the existence of a theory morphism if partial, the morphism maps declarations to declarations of the same local name in the containing theory

  43. object SmartSubstitutionApplier extends SubstitutionApplier

    A SubstitutionApplier that only recurses if the subobject has a free variable that is non-trivially affected by the substitution.

  44. object Stack extends Serializable
  45. object StructureOML extends DerivedOMLFeature with Named
  46. object StructureSharingSubstitutionApplier extends SubstitutionApplier

    like SmartSubstitutionApplier but also preserves structure sharing

  47. object StructureSub
  48. object StructureVarDecl extends DerivedVarDeclFeature
  49. object Sub extends Serializable

    helper object

  50. object Substitution extends Serializable

    helper object

  51. object TUnion
  52. object TheoryExp
  53. object TheoryType
  54. object TorsoForm extends Serializable
  55. object Traverser
  56. object VarDecl extends Serializable

    helper object

Inherited from AnyRef

Inherited from Any

Ungrouped