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 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 actions
    Definition Classes
    frontend
  • ArchiveConf
  • BackendConf
  • ChangeListener
  • Closure
  • Component
  • ConfEntry
  • ConsoleHandler
  • Controller
  • ControllerState
  • DatabaseConf
  • Deps
  • Elaboration
  • EnvVarConf
  • Extension
  • ExtensionConf
  • ExtensionManager
  • FileHandler
  • FileServerHere
  • ForeignConf
  • FormatBasedExtension
  • FormatConf
  • Get
  • HtmlFileHandler
  • InteractiveSimplifier
  • LMHConf
  • LeveledExtension
  • Logger
  • MMTConfig
  • MMTILoop
  • MMTInterpolator
  • MMTScript
  • MMTScriptEngine
  • Make
  • MakeAbstract
  • MakeConcrete
  • MathPathConf
  • Memory
  • NamespaceConf
  • NotFound
  • Notify
  • Output
  • Plugin
  • Present
  • Print
  • ProfileConf
  • REPLExtension
  • ROController
  • ROMemory
  • RecordingHandler
  • Report
  • ReportHandler
  • Respond
  • Run
  • SemanticsConf
  • Shell
  • ShellArguments
  • ShellExtension
  • ShellSendCommand
  • StandardIOHelper
  • StandardREPL
  • StructureTrffaverser
  • TextFileHandler
  • ToFile
  • ToWindow

class Controller extends ROController with ActionHandling with Logger

A Controller is the central class maintaining all MMT content and extensions.

Every application (e.g., Shell) typically creates one controller. The controller creates and owns one instance of many MMT clasess (see the documentation of the respective fields below).

It also maintains the MMTConfig and exectures Actions.

Source
Controller.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Controller
  2. Logger
  3. ActionHandling
  4. LMHActionHandling
  5. PrintActionHandling
  6. MathPathActionHandling
  7. ExecActionHandling
  8. DefineActionHandling
  9. ControlActionHandling
  10. CheckActionHandling
  11. ArchiveActionHandling
  12. ROController
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Controller(report_: Report = new Report)

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. def add(nw: StructuralElement, at: AddPosition = AtEnd): Unit

    adds a knowledge item

    adds a knowledge item

    at

    the position where it should be added (only inside modules, documents)

  5. def addArchive(root: File): List[Archive]

    add an archive plus its optional classpath and notify listeners, handling AddArchive

    add an archive plus its optional classpath and notify listeners, handling AddArchive

    Definition Classes
    MathPathActionHandling
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val backend: Backend

    the interface to physical storgae

  8. def build(f: File)(implicit errorCont: ErrorHandler): Unit

    builds a file/folder in an archive using an appropriate importer

  9. def buildArchive(ids: List[String], key: String, mod: BuildTargetModifier, in: FilePath): Unit

    Builds a given target from an Archive, handling the ArchiveBuild Action

    Builds a given target from an Archive, handling the ArchiveBuild Action

    Definition Classes
    ArchiveActionHandling
  10. def buildManager: BuildManager

    runs build tasks

  11. def checkPath(p: Path, id: String)(implicit task: MMTTask): Unit

    Checks a path using the Checker of the given ID, handling CheckAction

    Checks a path using the Checker of the given ID, handling CheckAction

    Definition Classes
    CheckActionHandling
  12. def checkTerm(s: String): Unit

    Checks a term relative to the current base path, handling CheckTerm

    Checks a term relative to the current base path, handling CheckTerm

    Definition Classes
    CheckActionHandling
  13. def cleanup: Unit

    releases all resources that are not handled by the garbage collection

  14. def clear: Unit

    clears the state

  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  16. def complifier(rules: RuleSet): TermTransformer

    applies only complification rules, used to unsimplify a fully-processed object, e.g., to undo definition expansion

  17. def configBuild(modS: String, targets: List[String], profile: String): Unit

    Runs a given profile from a config file, handling the ConfBuild target

    Runs a given profile from a config file, handling the ConfBuild target

    Definition Classes
    ArchiveActionHandling
  18. def currentActionDefinition: Option[String]

    the name of the current action definition (if any)

    the name of the current action definition (if any)

    Definition Classes
    ActionHandling
  19. def delete(p: Path): Unit

    deletes a document or module from memory no change management, deletions are non-recursive, listeners are notified

  20. val depstore: RelStore

    shortcut for the relational manager

  21. def detectChanges(elems: List[ContentElement]): StrictDiff
  22. def detectRefinements(diff: StrictDiff): List[String]
  23. def endAdd(c: ContainerElement[_]): Unit

    called after adding all elements in the body of a container element

  24. def endDefine(): Unit

    ends a definition

    ends a definition

    Definition Classes
    DefineActionHandling
  25. def enterDefine(name: String): Unit

    enters a definition of the given name

    enters a definition of the given name

    Definition Classes
    DefineActionHandling
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. val evaluator: QueryEvaluator

    the query engine

  29. val extman: ExtensionManager

    maintains all extensions

  30. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. def get(path: Path): StructuralElement

    convenience for global lookup

    convenience for global lookup

    Definition Classes
    ControllerROController
  32. def getActionDefinitions: List[Defined]

    returns

    the defined actions

  33. def getAs[E <: StructuralElement](cls: Class[E], path: Path): E
  34. def getBase: Path

    returns

    the current base URI

  35. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  36. def getConfig: MMTConfig

    returns

    the current configuration

  37. def getConfigString(): String

    returns a string expressing the current configuration

    returns a string expressing the current configuration

    Definition Classes
    PrintActionHandling
  38. def getConstant(path: GlobalName): Constant
  39. def getContext(e: StructuralElement): Context

    computes the context of an element, e.g., as needed for checking this methods allows processing individual elements without doing a top-down traversal to carry the context

  40. def getCurrentActionDefinition: Option[String]

    returns

    the current action being defined or None

  41. def getDefinition(name: String): Option[Defined]

    return the definition of a given name

    return the definition of a given name

    Definition Classes
    DefineActionHandling
  42. def getDefinitions: List[Defined]

    returns all known action definitions

    returns all known action definitions

    Definition Classes
    DefineActionHandling
  43. def getDocument(path: DPath, msg: (Path) ⇒ String = p => "no document found at " + p): Document
    Definition Classes
    ROController
  44. def getEnvVar(name: String): Option[String]

    returns

    the value of an environment variable

  45. def getExtraInnerContext(e: ContainerElement[_]): Context

    additional context for checking the body of ContainerElement

  46. def getHome: File

    returns

    the current home directory

  47. def getMathHub: Option[MathHub]

    get the current MathHub, if any

    get the current MathHub, if any

    Definition Classes
    LMHActionHandling
  48. def getNamespaceMap: NamespaceMap

    returns

    the current namespace map

  49. def getO(path: Path): Option[StructuralElement]

    like get

  50. def getTheory(path: MPath): Theory
  51. def getVersion: String

    return the MMT version (from the jar)

  52. val globalLookup: LookupWithNotFoundHandler

    a lookup that loads missing modules dynamically

    a lookup that loads missing modules dynamically

    Definition Classes
    ControllerROController
  53. def handle(message: Message): Response

    processes a message, see web.MessageHandler

    processes a message, see web.MessageHandler

    Definition Classes
    ActionHandling
  54. def handle(act: Action, showLog: Boolean = true): Unit

    executes an Action

    executes an Action

    Definition Classes
    ActionHandling
  55. def handleLine(l: String, showLog: Boolean = true): Unit

    executes a string command

    executes a string command

    Definition Classes
    ActionHandling
  56. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  57. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  58. def iterate[A](a: ⇒ A): A

    wrapping an expression in this method, evaluates the expression dynamically loading missing content

    wrapping an expression in this method, evaluates the expression dynamically loading missing content

    dependency cycles are detected be aware that the argument may be evaluated repeatedly

    a

    this is evaluated until evaluation does not throw NotFound

    returns

    the evaluation

  59. val library: Library

    shortcut for the library

  60. def loadConfig(conf: MMTConfig, loadEverything: Boolean): Unit

    integrate a configuration into the current state

  61. def loadConfigFile(f: File, loadEverything: Boolean): Unit
  62. val localLookup: LookupWithNotFoundHandler with FailingNotFoundHandler

    a lookup that uses only the current memory data structures

    a lookup that uses only the current memory data structures

    Definition Classes
    ControllerROController
  63. def log(e: Error): Unit

    logs an error - always logged

    logs an error - always logged

    Attributes
    protected
    Definition Classes
    Logger
  64. 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
  65. def logError(s: ⇒ String): Unit

    log as an error message

    log as an error message

    Attributes
    protected
    Definition Classes
    Logger
  66. 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
  67. val logPrefix: String
    Definition Classes
    ControllerLogger
  68. def logTemp(s: ⇒ String): Unit

    temporary logging - always logged

    temporary logging - always logged

    Attributes
    protected
    Definition Classes
    Logger
  69. val memory: Memory

    maintains all knowledge: structural elements, relational data, etc.

    maintains all knowledge: structural elements, relational data, etc.

    Definition Classes
    ControllerROController
  70. def navigate(p: Path): Unit

    navigates to a given path, handling Navigate

    navigates to a given path, handling Navigate

    Definition Classes
    CheckActionHandling
  71. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  72. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  73. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  74. def objectParser: ObjectParser

    convenience for getting the default object parser

  75. def pragmatic: Pragmatics

    converts between strict and pragmatic syntax using notations.NotationExtensions

  76. def presenter: Presenter

    convenience for getting the default text-based presenter (for error messages, logging, etc.)

  77. val previousLocalLookup: LookupWithNotFoundHandler with FailingNotFoundHandler

    a lookup that uses the previous in-memory version (ignoring the current one)

  78. val propagator: OccursInImpactPropagator

    moc.propagator - handling change propagation

  79. def read(ps: ParsingStream, interpret: Boolean, mayImport: Boolean = false)(implicit errorCont: ErrorHandler): Document

    parses a ParsingStream with an appropriate parser or interpreter and optionally checks it

    parses a ParsingStream with an appropriate parser or interpreter and optionally checks it

    ps

    the input

    interpret

    if true, try to use an interpreter, not a parser

    mayImport

    if true, use an importer as a fallback

    errorCont

    continuation to be called on all encountered errors

    returns

    the read Document

  80. def recognizeLiteral(rules: RuleSet, ul: UnknownOMLIT): Option[OMLIT]

    convert an UnknownOMLIT to an OMLIT by choosing an applicable rule

  81. val refiner: PragmaticRefiner

    moc.refiner - handling pragmatic changes in scope

  82. val relman: RelationalManager

    relational manager, handles extracting and parsing relational elements

  83. val report: Report

    handles all output and log messages

    handles all output and log messages

    Definition Classes
    ControllerLogger
  84. def retrieve(nf: NotFound): Unit

    loads a path via the backend and reports it

    loads a path via the backend and reports it

    Attributes
    protected
  85. def runDefinition(file: Option[File], name: String): Unit

    runs a given definition

    runs a given definition

    Definition Classes
    DefineActionHandling
  86. def runMSLFile(f: File, nameOpt: Option[String]): Unit

    runs a given file, handling ExecFile

    runs a given file, handling ExecFile

    Definition Classes
    ExecActionHandling
  87. var server: Option[Server]

    the http server

  88. def setBase(base: Path): Unit

    set the base path of this Controller

    set the base path of this Controller

    Definition Classes
    ControlActionHandling
  89. def setHome(h: File): Unit

    sets the current home directory (relative to which path names in commands are executed)

  90. def simplifier: Simplifier

    convenience for getting the default simplifier

  91. val state: ControllerState

    all control state

    all control state

    Attributes
    protected
  92. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  93. def toString(): String
    Definition Classes
    AnyRef → Any
  94. def tryHandle(act: Action, showLog: Boolean = true): ActionResult

    executes an Action without throwing exceptions

    executes an Action without throwing exceptions

    Definition Classes
    ActionHandling
  95. def tryHandleLine(l: String, showLog: Boolean = true): ActionResult

    executes an Action without throwing exceptions

    executes an Action without throwing exceptions

    Definition Classes
    ActionHandling
  96. def update(diff: StrictDiff, withChanges: List[String] = Nil): Set[CPath]
  97. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  98. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  99. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  100. lazy val winman: WindowManager

    the window manager

Deprecated Value Members

  1. def make(key: String, allArgs: List[String]): Unit

    Makes a given target, handling the MakeAction

    Makes a given target, handling the MakeAction

    Definition Classes
    ArchiveActionHandling
    Annotations
    @MMT_TODO( message = ... )
    Deprecated

    handled by the :make shell extension, use it instead

Inherited from Logger

Inherited from ActionHandling

Inherited from LMHActionHandling

Inherited from PrintActionHandling

Inherited from MathPathActionHandling

Inherited from ExecActionHandling

Inherited from DefineActionHandling

Inherited from ControlActionHandling

Inherited from CheckActionHandling

Inherited from ArchiveActionHandling

Inherited from ROController

Inherited from AnyRef

Inherited from Any

Ungrouped