Packages

trait Context extends BabelSignature

Captures constants, types, definitions, and background theory used in a proof.

Each of these different kinds of information is stored in a separate facet.Facet of the context. Each modification or addition to the context is recorded as an update.Update. Adding information is only possible by adding it as an update.Update. (Basically a Context is an extensible LCF-style kernel.)

There are several inferences in our LK proofs for which it is not enough that are syntactically valid: An induction inference might follow the syntactical scheme of an induction inference and satisfy the eigenvariable criterion, however if it excludes a constructor of the inductive type, then it still allows us to prove non-theorems. The same is also true for definition rules and theory axioms.

Hence we store all information necessary to validate these inferences inside a Context object. For completeness, it also includes the collection of constant symbols.

Having this information available is also important for a second reason: it allows us make decisions based on the current context:

  • The induction tactic uses the information about inductive types to create the necessary subgoals.
  • The Babel parser uses the information about constants to decide whether a free identifier is a variable or a constant, and if it is a constant, what type it should have.
  • The unfold tactic uses the information about definitions to unfold them.
  • The inductive prover can automatically generate random instances for base types.
  • gapt.proofs.expansion.ExpansionProofToLK uses the information about the background theory to produce LK proofs modulo the background theory.
Source
Context.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Context
  2. BabelSignature
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def state: State

    Retrieves the context's current state.

    Retrieves the context's current state.

    returns

    The context's current state.

  2. abstract def toImmutable: ImmutableContext

    Converts this context into an immutable context.

    Converts this context into an immutable context.

    returns

    A new immutable context that equals this context at the time of calling this method.

  3. abstract def updates: List[Update]

    Retrieves the updates that have been applied to this context.

    Retrieves the updates that have been applied to this context.

    returns

    A list of updates with newer updates occurring before older ones.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(update: Update): ImmutableContext

    Applies an update to this context.

    Applies an update to this context.

    update

    The update to be applied to this context.

    returns

    An immutable context obtained by converting this context to an immutable context and by applying the update to that context.

  4. def ++(updates: Traversable[Update]): ImmutableContext

    Applies several updates to the context.

    Applies several updates to the context.

    updates

    The updates to be applied to the context.

    returns

    An immutable context obtained by applying iteratively applying the updates from left to right.

  5. def ->[B](y: B): (Context, B)
    Implicit
    This member is added by an implicit conversion from Context to ArrowAssoc[Context] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def check[T](t: T)(implicit arg0: Checkable[T]): Unit

    Checks an object with respect to this context.

    Checks an object with respect to this context.

    This method checks whether a given object is correctly constructed according to this context. For example for a type to check against a context the base types occurring in that type must all be declared in the context.

    T

    The type of object to be checked.

    t

    The object to be checked.

  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  10. def constant(name: String, params: List[Ty]): Option[Const]

    Retrieves constants by name and type parameters.

    Retrieves constants by name and type parameters.

    name

    The name for which a constant is to be looked up.

    params

    The type parameters for which a constant is to be looked up.

    returns

    Returns Some ( c ) if the context currently contains a constant c with name name and type parameters params. Otherwise None is returned.

  11. def constant(name: String): Option[Const]

    Retrieves constants by name.

    Retrieves constants by name.

    name

    The name for which a constant is to be looked up.

    returns

    Returns Some( c ) where c.name equals name if the context currently contains such a constant c, otherwise None is retured.

  12. def constants: Iterable[Const]

    Retrieves all the constants defined in this context.

    Retrieves all the constants defined in this context.

    returns

    A list of all the constants that are currently defined in this context.

  13. def contains(defn: Definition): Boolean

    Checks whether the context contains a given definition.

    Checks whether the context contains a given definition.

    defn

    The definition that is to be checked.

    returns

    Returns true if the given definition is an instance of a definition stored in this context.

  14. def defaultTypeToI: Boolean
    Definition Classes
    ContextBabelSignature
  15. def definition(c: Const): Option[Expr]

    Looks up the definition of a constant.

    Looks up the definition of a constant.

    c

    The constant with type arguments args whose definition is to be looked up.

    returns

    If the constant c has a definition, then Some( definition ) is returned where definition is obtained from the definition of c by instantiating the type variables according to args.

  16. def definitions: Map[Const, Expr]

    Retrieves all the definitions of this context.

    Retrieves all the definitions of this context.

    returns

    The current definitions saved by this context i.e. a map associating constants with expressions.

  17. def ensuring(cond: (Context) ⇒ Boolean, msg: ⇒ Any): Context
    Implicit
    This member is added by an implicit conversion from Context to Ensuring[Context] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  18. def ensuring(cond: (Context) ⇒ Boolean): Context
    Implicit
    This member is added by an implicit conversion from Context to Ensuring[Context] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  19. def ensuring(cond: Boolean, msg: ⇒ Any): Context
    Implicit
    This member is added by an implicit conversion from Context to Ensuring[Context] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  20. def ensuring(cond: Boolean): Context
    Implicit
    This member is added by an implicit conversion from Context to Ensuring[Context] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  23. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from Context to StringFormat[Context] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  24. def get[T](implicit arg0: Facet[T]): T

    Retrieves a facet of this context.

    Retrieves a facet of this context.

    T

    The facet's type.

    returns

    Returns the facet associated with the given type. If this facet is not present yet, it is initialized and its initial value is returned.

  25. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. def getConstructors(ty: TBase): Option[Vector[Const]]

    Looks up inductive type constructors for a given base type.

    Looks up inductive type constructors for a given base type.

    ty

    The base type whose type constructors are to be looked up.

    returns

    Returns Some( ctrs ) if ty is an inductive type having constructors ctrs, otherwise None is returned.

  27. def getConstructors(ty: Ty): Option[Vector[Const]]

    Retrieves inductive type constructors for a given type.

    Retrieves inductive type constructors for a given type.

    ty

    The type whose inductive type constructors are to be looked up.

    returns

    Returns Some( ctrs ) if ty is an inductive type having constructors ctrs, otherwise None is returned.

  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. def isDefEq(a: Expr, b: Expr): Boolean

    Checks if two expressions normalize to the same expression.

    Checks if two expressions normalize to the same expression.

    a

    An expression to be checked.

    b

    An expression to be checked.

    returns

    Returns true if and only if a and b normalize to the same expression in this context.

  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def isType(ty: TBase): Boolean

    Checks whether the given base type is defined in this context.

    Checks whether the given base type is defined in this context.

    ty

    The base type that is to be checked.

    returns

    true if ty is defined in this context, false otherwise.

  32. def names: Iterable[String]

    Retrieves all the names declared in this context.

    Retrieves all the names declared in this context.

    returns

    All the names currently declared in this context.

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. def newMutable: MutableContext

    Converts this context into a mutable context.

    Converts this context into a mutable context.

    returns

    A new mutable context that equals this context at the time of calling this method.

  35. def newNameGenerator: NameGenerator

    Creates a new name generator for this context.

    Creates a new name generator for this context.

    returns

    A new name generator that avoids all the names currently defined in the context.

  36. def normalize(expression: Expr): Expr

    Normalizes an expression.

    Normalizes an expression.

    expression

    The expression to be normalized.

    returns

    An expression obtained by normalizing expression according to the reduction rules currently stored in this context.

  37. def normalizer: Normalizer

    The context's normalizer.

    The context's normalizer.

    returns

    The context's normalizer.

  38. def notationsForConst(const: ConstName): List[Notation]
    Definition Classes
    ContextBabelSignature
  39. def notationsForToken(token: Token): Option[Notation]
    Definition Classes
    ContextBabelSignature
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. def reductionRules: Iterable[ReductionRule]

    Retrieves all expression-level reduction rules.

    Retrieves all expression-level reduction rules.

    returns

    Returns all the expression-level reduction rules currently stored in this context.

  43. def signatureLookup(s: String): VarConst

    Decides whether the symbol with the given identifier should be a variable or constant, and what its type should be.

    Decides whether the symbol with the given identifier should be a variable or constant, and what its type should be.

    s

    The name of the symbol.

    returns

    Either IsVar(type) or IsConst(type).

    Definition Classes
    ContextBabelSignature
  44. def skolemDef(skSym: Const): Option[Expr]

    Retrieves the skolem definition of a constant.

    Retrieves the skolem definition of a constant.

    skSym

    The constant whose definition is to be looked up.

    returns

    Returns Some(definition) if the constant skSym is a skolem function with definition definition.

  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def toReadonly: ReadOnlyMutableContext

    Converts this context to a read-only context.

    Converts this context to a read-only context.

    returns

    A new read-only context that is equal to this context at the time of invoking this method.

  47. def toString(): String
    Definition Classes
    Context → AnyRef → Any
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  50. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. def whnf(expression: Expr): Expr

    Reduces an expression to WHNF.

    Reduces an expression to WHNF.

    expression

    The expression to be reduced to WHNF.

    returns

    An expression reduced to WHNF according to the reduction rules currently stored in this context.

  52. def [B](y: B): (Context, B)
    Implicit
    This member is added by an implicit conversion from Context to ArrowAssoc[Context] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from Context to any2stringadd[Context] performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is shadowed by one or more members in this class.
    To access this member you can use a type ascription:
    (context: any2stringadd[Context]).+(other)
    Definition Classes
    any2stringadd

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from BabelSignature

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Context to any2stringadd[Context]

Inherited by implicit conversion StringFormat from Context to StringFormat[Context]

Inherited by implicit conversion Ensuring from Context to Ensuring[Context]

Inherited by implicit conversion ArrowAssoc from Context to ArrowAssoc[Context]

Ungrouped