Module aya.base

Interface Contextful

All Known Subinterfaces:
TeleTycker, TeleTycker.Impl
All Known Implementing Classes:
AbstractTycker, DoubleChecker, ExprTycker, Synthesizer, TeleTycker.Con, TeleTycker.Default, TermComparator, Unifier

public interface Contextful
Indicating something is LocalCtxful.
Whenever you want to introduce some bind, make sure you are modifying the LocalCtx that you own it, i.e. obtained from subscoped(java.util.function.Supplier<R>). In fact, this is the rule of ownership 🦀🦀🦀.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull org.aya.syntax.core.term.call.MetaCall
    freshMeta(String name, @NotNull org.aya.util.error.SourcePos pos, org.aya.syntax.ref.MetaVar.Requirement req)
    Construct a fresh MetaCall
    default @NotNull org.aya.syntax.core.term.Term
    generatePi(@NotNull org.aya.syntax.concrete.Expr.Lambda expr, org.aya.util.error.SourcePos sourcePos)
     
    @NotNull org.aya.syntax.ref.LocalCtx
     
    default @NotNull org.aya.syntax.core.term.Term
    mockTerm(@NotNull org.aya.syntax.core.term.Param param, @NotNull org.aya.util.error.SourcePos pos)
    Generate a fresh MetaCall with type Param.type()
    @NotNull org.aya.syntax.ref.LocalCtx
    setLocalCtx(@NotNull org.aya.syntax.ref.LocalCtx ctx)
    Update localCtx with the given one
    default <R> R
    subscoped(@NotNull Supplier<R> action)
     
    default <R> R
    with(@NotNull org.aya.syntax.ref.LocalVar var, @NotNull org.aya.syntax.core.term.Term type, @NotNull Supplier<R> action)
     
  • Method Details

    • localCtx

      @NotNull @NotNull org.aya.syntax.ref.LocalCtx localCtx()
    • setLocalCtx

      @Internal @Contract(mutates="this") @NotNull @NotNull org.aya.syntax.ref.LocalCtx setLocalCtx(@NotNull @NotNull org.aya.syntax.ref.LocalCtx ctx)
      Update localCtx with the given one
      Parameters:
      ctx - new LocalCtx
      Returns:
      old context
    • subscoped

      @Contract(mutates="this") default <R> R subscoped(@NotNull @NotNull Supplier<R> action)
    • with

      @Contract(mutates="this") default <R> R with(@NotNull @NotNull org.aya.syntax.ref.LocalVar var, @NotNull @NotNull org.aya.syntax.core.term.Term type, @NotNull @NotNull Supplier<R> action)
    • mockTerm

      @NotNull default @NotNull org.aya.syntax.core.term.Term mockTerm(@NotNull @NotNull org.aya.syntax.core.term.Param param, @NotNull @NotNull org.aya.util.error.SourcePos pos)
      Generate a fresh MetaCall with type Param.type()
    • freshMeta

      @NotNull default @NotNull org.aya.syntax.core.term.call.MetaCall freshMeta(String name, @NotNull @NotNull org.aya.util.error.SourcePos pos, org.aya.syntax.ref.MetaVar.Requirement req)
      Construct a fresh MetaCall
      See Also:
      • LocalCtx.extract()
    • generatePi

      @NotNull default @NotNull org.aya.syntax.core.term.Term generatePi(@NotNull org.aya.syntax.concrete.Expr.Lambda expr, org.aya.util.error.SourcePos sourcePos)