Module aya.base

Interface Term

All Superinterfaces:
AyaDocile, org.aya.guest0x0.cubical.Restr.TermLike<Term>
All Known Subinterfaces:
Callable, Callable.Common, Callable.Tele, ConCallLike, Elimination, FnCallLike, Formation, RuleReducer, StableWHNF
All Known Implementing Classes:
AppTerm, ClassCall, CoeTerm, ConCall, DataCall, ErrorTerm, FieldTerm, FnCall, FormulaTerm, HCompTerm, IntegerTerm, InTerm, IntervalTerm, LamTerm, ListTerm, MatchTerm, MetaLitTerm, MetaPatTerm, MetaTerm, NewTerm, OutTerm, PAppTerm, PartialTerm, PartialTyTerm, PathTerm, PiTerm, PLamTerm, PrimCall, ProjTerm, RefTerm, RefTerm.Field, RuleReducer.Con, RuleReducer.Fn, SigmaTerm, SortTerm, StringTerm, TupTerm

public sealed interface Term extends AyaDocile, org.aya.guest0x0.cubical.Restr.TermLike<Term> permits Callable, CoeTerm, Elimination, Formation, FormulaTerm, HCompTerm, InTerm, MatchTerm, MetaLitTerm, MetaPatTerm, PartialTerm, RefTerm, RefTerm.Field, StableWHNF
A well-typed and terminating term. Once you add a new Term, you should:
  • Method Details

    • descent

      @NotNull @NotNull Term descent(@NotNull @NotNull UnaryOperator<Term> f, @NotNull @NotNull UnaryOperator<Pat> g)
      Descending an operation to the term AST. NOTE: Currently we require the operation `f` to preserve:
      invalid @link
      StructCall
      , DataCall, SortTerm, Shaped.Applicable.
    • subst

      @NotNull default @NotNull Term subst(@NotNull @NotNull AnyVar var, @NotNull @NotNull Term term)
    • subst

      @NotNull default @NotNull Term subst(@NotNull @NotNull Subst subst)
    • subst

      @NotNull default @NotNull Term subst(@NotNull @NotNull kala.collection.Map<? extends AnyVar,? extends Term> subst)
    • subst

      @NotNull default @NotNull Term subst(@NotNull @NotNull Subst subst, int ulift)
    • rename

      @NotNull default @NotNull Term rename()
    • findUsages

      default int findUsages(@NotNull @NotNull AnyVar var)
    • scopeCheck

      default VarConsumer.ScopeChecker scopeCheck(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<LocalVar> allowed)
    • normalize

      @NotNull default @NotNull Term normalize(@NotNull @NotNull TyckState state, @NotNull @NotNull NormalizeMode mode)
      Parameters:
      state - used for inlining the holes. Can be null only if we're absolutely sure that holes are frozen, like in the error messages.
    • freezeHoles

      @NotNull default @NotNull Term freezeHoles(@Nullable @Nullable TyckState state)
    • toDoc

      @NotNull default @NotNull org.aya.pretty.doc.Doc toDoc(@NotNull @NotNull org.aya.util.prettier.PrettierOptions options)
      Specified by:
      toDoc in interface AyaDocile
    • lift

      @NotNull default @NotNull Term lift(int ulift)
    • computeType

      @NotNull default @NotNull Term computeType(@NotNull @NotNull TyckState state, @NotNull @NotNull LocalCtx ctx)
      Returns:
      WHNF
      Throws:
      NullPointerException - if the term is an introduction rule