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.
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
- Source
- Context.scala
- Alphabetic
- By Inheritance
- Context
- Serializable
- Serializable
- Product
- Equals
- DefaultLookup
- ElementContainer
- Obj
- HashEquality
- ShortURIPrinter
- BaseType
- Content
- ClientProperties
- HasMetaData
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++(that: Context): Context
concatenate contexts
-
def
++(v: VarDecl): Context
add variable at the end
-
def
++(p: MPath): Context
add a theory inclusion at the end
-
def
/(args: List[Term]): Option[Substitution]
- returns
substitution that maps variables according to args, None if lengths do not match
- def /!(args: List[Term]): Substitution
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
^(sub: Substitution): ThisType
applies a substitution to an object (computed immediately) implemented in terms of ^^ and PlainSubstitutionApplier
applies a substitution to an object (computed immediately) implemented in terms of ^^ and PlainSubstitutionApplier
- Definition Classes
- Obj
-
def
^?(sub: Substitution): ThisType
optimized version of substitution defined in terms of SmartSubstitutionApplier
optimized version of substitution defined in terms of SmartSubstitutionApplier
- Definition Classes
- Obj
-
def
^^(sub: Substitution)(implicit sa: SubstitutionApplier): ThisType
convenience method that applies substitution by relegating to a SubstitutionApplier
convenience method that applies substitution by relegating to a SubstitutionApplier
This has the effect that o ^^ sub becomes an infix notation for substitution if an implicit SubstitutionApplier is available.
- Definition Classes
- Obj
-
def
after(name: LocalName): Context
- returns
the suffix after and excluding the variable
-
def
alpha(that: Context): Option[Substitution]
if c1 and c2 have the same length, then (c1 alpha c2 : c1 -> c2) is the substitution mapping corresponding variables
if c1 and c2 have the same length, then (c1 alpha c2 : c1 -> c2) is the substitution mapping corresponding variables
This substitution can be used to alpha-rename c1-objects to c2-objects.
-
def
apply(name: LocalName): VarDecl
look up a variable by name, throws LookupError if not declared
- def asDeclarations(home: Term): List[Declaration]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
before(name: LocalName): Context
- returns
the prefix up to and excluding the variable
-
lazy val
clientProperty: ListMap[URI, Any]
- Definition Classes
- ClientProperties
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copyFrom(o: Obj): Unit
replaces metadata of this with pointer to those of o
replaces metadata of this with pointer to those of o
- o
the original object call o2.copyFrom(o1) after transforming o1 into o2 in order to preserve metadata
- Definition Classes
- Obj
-
def
declsInContext: Iterator[(Context, VarDecl)]
- returns
an iterator over all declarations in their respective context
-
def
domain: List[LocalName]
- Definition Classes
- DefaultLookup
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
lazy val
freeVars: List[LocalName]
the free variables of this object in any order
the free variables of this object in any order
- Definition Classes
- Obj
-
def
get(name: LocalName): VarDecl
- Definition Classes
- ElementContainer
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getDeclarations: List[VarDecl]
- Definition Classes
- Context → ElementContainer
-
def
getDeclarationsBefore(n: LocalName): List[VarDecl]
- Definition Classes
- ElementContainer
-
def
getDomain: List[DomainElement]
- returns
domain of this context, flattening nested ComplexTheories and ComplexMorphisms Due to ComplexMorphism's, names may erroneously be defined but not declared.
-
def
getIncludes: List[MPath]
all theories directly included into this context
-
def
getMetaDataNode: NodeSeq
- Definition Classes
- HasMetaData
-
def
getMostSpecific(name: LocalName): Option[(VarDecl, LocalName)]
- Definition Classes
- DefaultLookup
-
def
getO(name: LocalName): Option[VarDecl]
- Definition Classes
- DefaultLookup
-
def
getO(name: String): Option[VarDecl]
same as get(LocalName(name))
same as get(LocalName(name))
- Definition Classes
- ElementContainer
-
def
governingPath: Option[ContentPath]
the governing path required by Content is the head, if any
the governing path required by Content is the head, if any
- Definition Classes
- Obj
-
lazy val
hash: Int
the hash code
the hash code
- Definition Classes
- HashEquality
-
def
hasheq(that: HashEquality[Obj]): Boolean
this hasheq that is the same as this == that, but fails immediately if false
this hasheq that is the same as this == that, but fails immediately if false
- Definition Classes
- HashEquality
-
def
hashneq(that: HashEquality[Obj]): Boolean
this hasheq that is the same as this == that, but fails immediately if false
this hasheq that is the same as this == that, but fails immediately if false
- Definition Classes
- HashEquality
- def head: None.type
-
def
id: Substitution
the identity substitution of this context
-
def
index(name: LocalName): Option[Int]
- returns
the de Bruijn index of the variable, starting from 0
-
def
isDeclared(name: LocalName): Boolean
- Definition Classes
- ElementContainer
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def length: Int
-
def
mapTerms(f: (Context, Term) ⇒ Term): Context
applies a function to the type/definiens of all variables (in the respective context)
applies a function to the type/definiens of all variables (in the respective context)
- returns
the resulting context
-
def
mapVarDecls[A](f: (Context, VarDecl) ⇒ A): List[A]
applies a function to each VarDecl, each time in the respective context
applies a function to each VarDecl, each time in the respective context
- returns
the list of results
-
def
mdNode: Seq[Node] with AbstractSeq[Node] with Serializable
- Attributes
- protected
- Definition Classes
- Obj
-
val
metadata: MetaData
- Definition Classes
- HasMetaData
-
def
minimalSubContext(req: List[LocalName]): Context
the subcontext whose variables occur (transitively closed) in the given variables
the subcontext whose variables occur (transitively closed) in the given variables
if context |- t, then also context.minimalSubContext(t.freeVars) |- t
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
subobject(pos: Position): (Context, Obj)
returns the subobject at a given position and its context
returns the subobject at a given position and its context
- Definition Classes
- Obj
-
def
subobjects: List[(Context, Obj)]
all direct subobjects of this object with their context (excluding any outer context of this object)
-
def
subobjectsNoContext(os: List[Obj]): List[(Context, Obj)]
auxiliary function for subobjects in the absence of binding
auxiliary function for subobjects in the absence of binding
- Attributes
- protected
- Definition Classes
- Obj
-
def
substitute(sub: Substitution)(implicit sa: SubstitutionApplier): Context
substitutes in all variable declarations except for the previously declared variables if |- G ++ H and |- sub : G -> G' then |- G' ++ (H ^ sub)
-
def
subsumes(that: Context): Boolean
true if that is a subcontext (inclusion substitution) of this one
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toCML: Node
- Definition Classes
- Obj
- def toCMLQVars(implicit qvars: Context): Elem
-
def
toNode: Elem
prints to OpenMath
-
def
toNode(rh: RenderingHandler): Unit
by default, this prints out toNode
by default, this prints out toNode
potentially large StructuralElements should override it with a memory-efficient implementation
- Definition Classes
- Content
-
def
toOBJNode: Elem
prints to OpenMath (with OMOBJ wrapper)
prints to OpenMath (with OMOBJ wrapper)
- Definition Classes
- Obj
-
def
toPartialSubstitution: Substitution
returns this as a substitutions using those variables that have a definiens
-
def
toStr(implicit shortURIs: Boolean): String
configurable string representation
configurable string representation
- shortURIs
print OMS without namespace, theory
- Definition Classes
- Context → ShortURIPrinter
-
def
toString(): String
defaults to toStr(false)
defaults to toStr(false)
- Definition Classes
- ShortURIPrinter → AnyRef → Any
-
def
toSubstitution: Option[Substitution]
returns this as a substitution if all variables have a definiens
- val variables: VarDecl*
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()