Module aya.base

Class UnifiedTycker

Direct Known Subclasses:
PropTycker

public abstract sealed class UnifiedTycker extends LetListTycker permits PropTycker
This is the fourth base-base class of a tycker. It has no new members, and supports some unification and cubical boundary functions.
See Also:
  • Constructor Details

    • UnifiedTycker

      protected UnifiedTycker(@NotNull @NotNull org.aya.util.reporter.Reporter reporter, @Nullable Trace.Builder traceBuilder, @NotNull @NotNull TyckState state)
  • Method Details

    • unifyTyReported

      public boolean unifyTyReported(@NotNull @NotNull Term upper, @NotNull @NotNull Term lower, Expr loc)
      Check if lower is a subtype of upper, and report a type error if it's not the case.
      Returns:
      true if well-typed.
      See Also:
    • unifyTyReported

      public boolean unifyTyReported(@NotNull @NotNull Term upper, @NotNull @NotNull Term lower, Expr loc, Function<UnifyInfo.Comparison,org.aya.util.reporter.Problem> p)
      Parameters:
      upper - Expected type
      lower - Actual type
      loc - The location of the expression
      p - Callback to generate the error message
      Returns:
      true if unified successfully, false otherwise
    • inheritFallbackUnify

      protected final Result inheritFallbackUnify(@NotNull @NotNull Term upper, @NotNull @NotNull Result result, Expr loc)
      Check if lower is a subtype of upper, and try to insert implicit arguments to fulfill this goal (if possible).
      Returns:
      the term and type after insertion
      See Also:
    • error

      @NotNull protected final @NotNull Result error(@NotNull @NotNull AyaDocile expr, @NotNull @NotNull Term term)
    • unifyReported

      public boolean unifyReported(@NotNull @NotNull Term lhs, @NotNull @NotNull Term rhs, @NotNull @NotNull Term ty, @NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull LocalCtx ctx, Function<UnifyInfo.Comparison,org.aya.util.reporter.Problem> p)
      Parameters:
      p - Callback to generate the error message
      Returns:
      true if unified successfully, false otherwise
    • unifyReported

      public boolean unifyReported(@NotNull @NotNull Term lhs, @NotNull @NotNull Term rhs, @NotNull @NotNull Term ty, Expr loc, Function<UnifyInfo.Comparison,org.aya.util.reporter.Problem> p)
    • confluence

      protected final void confluence(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.guest0x0.cubical.Restr.Side<Term>> clauses, @NotNull @NotNull Expr loc, @NotNull @NotNull Term type)
    • checkBoundaries

      protected final Result.Default checkBoundaries(Expr expr, PathTerm path, Subst subst, Term lambda)
    • unifyTy

      protected final TermComparator.FailureData unifyTy(@NotNull @NotNull Term upper, @NotNull @NotNull Term lower, @NotNull @NotNull org.aya.util.error.SourcePos pos)
      Returns:
      null if unified successfully, otherwise a frozen data