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 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
  • DefaultOpaqueElementInterpreter
  • HTMLInterpreter
  • ObjFragment
  • OpaqueChecker
  • OpaqueContext
  • OpaqueElement
  • OpaqueElementInterpreter
  • OpaqueHTMLPresenter
  • OpaqueText
  • OpaqueTextParser
  • OpaqueTextPresenter
  • OpaqueXML
  • ScopeFragment
  • StringFragment
  • TermFragmentInXML
  • TextFragment
  • TextInterpreter
  • UnknownOpaqueElement
c

info.kwarc.mmt.api.opaque

OpaqueElementInterpreter

abstract class OpaqueElementInterpreter extends FormatBasedExtension

an extension that provides (parts of) the meaning of OpaqueElements

Instances of this class must be coupled with a subclass OE <: OpaqueElement. Methods of an OpaqueElementInterpreter will be passed to and must return only instances of OE, never of other OpaqueElements.

OE is not a type parameter of OpaqueElementInterpreter because that is less helpful than one may think. Interpreters are anyway chosen at run time based on the format so that the type information can rarely be exploited and often requires casting anyway.

Therefore, all methods work simply with OpaqueElement. But MMT and all oi:OpaqueElementInterpreter must respect the following invariant: If oe:OpaqueElement and oi.isApplicable(oe.format), then oe.isInstanceOf[oi.OE]. In particular, the 'downcast' method can be used to refine the type of inputs passed to this class.

Source
OpaqueElement.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OpaqueElementInterpreter
  2. FormatBasedExtension
  3. Extension
  4. Logger
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new OpaqueElementInterpreter()

Type Members

  1. case class LocalError(s: String) extends ExtensionError with Product with Serializable

    a custom error class for this extension

    a custom error class for this extension

    Definition Classes
    Extension
  2. abstract type OE <: OpaqueElement

Abstract Value Members

  1. abstract def format: String

    the format of OpaqueElements this can interpret

  2. abstract def fromNode(parent: DPath, nsMap: NamespaceMap, nodes: NodeSeq): OE

    constructs an OpaqueElement from a raw string

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def catchErrors[A](msg: String, recoverWith: ⇒ A)(code: ⇒ A): A

    like its partner but with return value

    like its partner but with return value

    Attributes
    protected
    Definition Classes
    Extension
  6. def catchErrors(msg: String)(code: ⇒ Unit): Unit

    convenience method for wrapping code in error handler that throws LocalError

    convenience method for wrapping code in error handler that throws LocalError

    Attributes
    protected
    Definition Classes
    Extension
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  8. val controller: Controller

    the controller that this extension is added to; only valid after creation of the extension, i.e., will return null if used in a non-lazy val-field

    the controller that this extension is added to; only valid after creation of the extension, i.e., will return null if used in a non-lazy val-field

    Attributes
    protected
    Definition Classes
    Extension
  9. lazy val defaultPrefix: String
    Definition Classes
    Extension
  10. def destroy: Unit

    extension-specific cleanup (override as needed, empty by default)

    extension-specific cleanup (override as needed, empty by default)

    Extensions may create persistent data structures and threads, but they must clean up after themselves in this method

    Definition Classes
    Extension
  11. def destroyWhenRemainingTasksFinished: Unit

    convenience for calling waitUntilRemainingTasksFinished and then destroy

    convenience for calling waitUntilRemainingTasksFinished and then destroy

    Definition Classes
    Extension
  12. def downcast(oe: OpaqueElement): OE

    Casts an opaque element to type OE.

    Casts an opaque element to type OE. Guaranteed to be safe on all input passed to this class.

    Attributes
    protected
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatAlias: List[String]

    aliases for the format that can be used in concrete syntax, override as needed

  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def getFromFirstArgOrEnvvar(args: List[String], name: String, default: String = ""): String
    Attributes
    protected
    Definition Classes
    Extension
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def initOther(e: Extension): Unit

    any extension can initialize other extensions if those are not meant to be added to the ExtensionManager

    any extension can initialize other extensions if those are not meant to be added to the ExtensionManager

    Attributes
    protected
    Definition Classes
    Extension
  21. def isApplicable(f: String): Boolean

    returns

    true if this extension is applicable

    Definition Classes
    OpaqueElementInterpreterFormatBasedExtension
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def log(e: Error): Unit

    logs an error - always logged

    logs an error - always logged

    Attributes
    protected
    Definition Classes
    Logger
  24. def log(s: ⇒ String, subgroup: Option[String] = None): Unit

    logs a message with this logger's logprefix

    logs a message with this logger's logprefix

    Attributes
    protected
    Definition Classes
    Logger
  25. def logError(s: ⇒ String): Unit

    log as an error message

    log as an error message

    Attributes
    protected
    Definition Classes
    Logger
  26. def logGroup[A](a: ⇒ A): A

    wraps around a group to create nested logging

    wraps around a group to create nested logging

    Attributes
    protected
    Definition Classes
    Logger
  27. def logPrefix: String

    the prefix used to identify this extension for logging, by default the class name

    the prefix used to identify this extension for logging, by default the class name

    Definition Classes
    ExtensionLogger
  28. def logTemp(s: ⇒ String): Unit

    temporary logging - always logged

    temporary logging - always logged

    Attributes
    protected
    Definition Classes
    Logger
  29. def makeErrorThrower(msg: String): ErrorHandler

    an ErrorHandler that wraps an error in a LocalError and throws it

    an ErrorHandler that wraps an error in a LocalError and throws it

    Attributes
    protected
    Definition Classes
    Extension
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. val report: Report
    Attributes
    protected
    Definition Classes
    ExtensionLogger
  34. def start(args: List[String]): Unit

    extension-specific initialization (override as needed, empty by default)

    extension-specific initialization (override as needed, empty by default)

    Definition Classes
    Extension
  35. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  36. def toString(): String
    Definition Classes
    AnyRef → Any
  37. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  40. def waitUntilRemainingTasksFinished: Unit

    extensions that process tasks in separate threads should override this and wait until those threads are done

    extensions that process tasks in separate threads should override this and wait until those threads are done

    Definition Classes
    Extension

Inherited from FormatBasedExtension

Inherited from Extension

Inherited from Logger

Inherited from AnyRef

Inherited from Any

Ungrouped