Module aya.base

Class BaseDistiller<Term extends AyaDocile>

java.lang.Object
org.aya.distill.BaseDistiller<Term>
Direct Known Subclasses:
ConcreteDistiller, CoreDistiller

public abstract class BaseDistiller<Term extends AyaDocile> extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static interface 
     
    static enum 
    Expression: where am I? Top-level expression may not need parentheses, stone free! An argument of an application! Stay in parentheses! An operand of a binary application! Applications within are safe, but other binary applications are in danger! Codomain of a telescope
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
    final @NotNull org.aya.util.distill.DistillerOptions
     
    static final @NotNull org.aya.pretty.doc.Style
     
    static final @NotNull org.aya.pretty.doc.Style
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    BaseDistiller(@NotNull org.aya.util.distill.DistillerOptions options)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends AyaDocile>
    org.aya.pretty.doc.Doc
    arg(@NotNull BaseDistiller.Fmt<T> fmt, org.aya.util.binop.BinOpParser.Elem<T> arg, @NotNull BaseDistiller.Outer outer)
     
    static @NotNull org.aya.pretty.doc.Doc
    checkParen(@NotNull BaseDistiller.Outer outer, @NotNull org.aya.pretty.doc.Doc binApp, @NotNull BaseDistiller.Outer binOp)
     
    protected static @Nullable org.aya.pretty.doc.Style
    chooseStyle(Object concrete)
     
    static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile>
    @NotNull org.aya.pretty.doc.Doc
    cofib(@NotNull org.aya.util.distill.DistillerOptions options, org.aya.guest0x0.cubical.Restr.Conj<T> conj)
     
    static @NotNull org.aya.pretty.doc.Doc
    cube(@NotNull org.aya.util.distill.DistillerOptions options, PathTerm.Cube cube)
     
    static @NotNull org.aya.pretty.doc.Doc
    defVar(DefVar<?,?> ref)
     
    @NotNull org.aya.pretty.doc.Doc
    formula(@NotNull BaseDistiller.Outer outer, @NotNull org.aya.guest0x0.cubical.Formula<Term> formula)
     
    static @NotNull org.aya.pretty.doc.Doc
    linkDef(@NotNull AnyVar ref)
     
    static @NotNull org.aya.pretty.doc.Doc
    linkDef(@NotNull AnyVar ref, @NotNull org.aya.pretty.doc.Style color)
     
    static @NotNull org.aya.pretty.backend.string.LinkId
    linkIdOf(@NotNull AnyVar ref)
     
    static @NotNull org.aya.pretty.doc.Doc
    linkListLit(org.aya.pretty.doc.Doc display, @NotNull AnyVar ref, @NotNull org.aya.pretty.doc.Style color)
     
    static @NotNull org.aya.pretty.doc.Doc
    linkLit(int literal, @NotNull AnyVar ref, @NotNull org.aya.pretty.doc.Style color)
     
    static @NotNull org.aya.pretty.doc.Doc
    linkRef(@NotNull AnyVar ref, @NotNull org.aya.pretty.doc.Style color)
     
    static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile>
    @NotNull org.aya.pretty.doc.Doc
    partial(@NotNull org.aya.util.distill.DistillerOptions options, @NotNull org.aya.guest0x0.cubical.Partial<T> partial, boolean showEmpty, String lbr, String rbr)
     
    static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile>
    @NotNull org.aya.pretty.doc.Doc
    restr(@NotNull org.aya.util.distill.DistillerOptions options, @NotNull org.aya.guest0x0.cubical.Restr<T> restr)
     
    static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile>
    @NotNull org.aya.pretty.doc.Doc
    side(@NotNull org.aya.util.distill.DistillerOptions options, org.aya.guest0x0.cubical.Restr.Side<T> side)
     
    protected abstract @NotNull org.aya.pretty.doc.Doc
    term(@NotNull BaseDistiller.Outer outer, Term term)
     
    static <T extends AyaDocile>
    @NotNull org.aya.pretty.doc.Doc
    toDoc(@NotNull org.aya.util.distill.DistillerOptions options, @NotNull org.aya.util.Arg<T> self)
     
    @NotNull org.aya.pretty.doc.Doc
    unnamedParam(@NotNull ParamLike<Term> param)
     
    static @NotNull org.aya.pretty.doc.Doc
    varDoc(@NotNull AnyVar ref)
     
    @NotNull org.aya.pretty.doc.Doc
    visitArgsCalls(@NotNull DefVar<?,?> var, @NotNull org.aya.pretty.doc.Style style, @NotNull kala.collection.SeqLike<@NotNull org.aya.util.Arg<Term>> args, @NotNull BaseDistiller.Outer outer)
     
    @NotNull org.aya.pretty.doc.Doc
    visitCalls(@NotNull DefVar<?,?> var, @NotNull org.aya.pretty.doc.Style style, @NotNull kala.collection.SeqLike<@NotNull org.aya.util.Arg<Term>> args, @NotNull BaseDistiller.Outer outer, boolean showImplicits)
     
    @NotNull org.aya.pretty.doc.Doc
    visitCalls(@Nullable org.aya.util.binop.Assoc assoc, @NotNull org.aya.pretty.doc.Doc fn, @NotNull kala.collection.SeqView<? extends @NotNull org.aya.util.binop.BinOpParser.Elem<Term>> args, @NotNull BaseDistiller.Outer outer, boolean showImplicits)
     
    @NotNull org.aya.pretty.doc.Doc
    visitTele(@NotNull kala.collection.Seq<? extends ParamLike<Term>> telescope)
    Pretty-print a telescope in a dumb (but conservative) way.
    @NotNull org.aya.pretty.doc.Doc
    visitTele(@NotNull kala.collection.Seq<? extends ParamLike<Term>> telescope, Term body, @NotNull ToIntBiFunction<Term,AnyVar> altF7)
    Pretty-print a telescope in a smart way.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • KEYWORD

      @NotNull public static final @NotNull org.aya.pretty.doc.Style KEYWORD
    • PRIM_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style PRIM_CALL
    • FN_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style FN_CALL
    • DATA_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style DATA_CALL
    • STRUCT_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style STRUCT_CALL
    • CON_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style CON_CALL
    • FIELD_CALL

      @NotNull public static final @NotNull org.aya.pretty.doc.Style FIELD_CALL
    • GENERALIZED

      @NotNull public static final @NotNull org.aya.pretty.doc.Style GENERALIZED
    • options

      @NotNull public final @NotNull org.aya.util.distill.DistillerOptions options
  • Constructor Details

    • BaseDistiller

      protected BaseDistiller(@NotNull @NotNull org.aya.util.distill.DistillerOptions options)
  • Method Details

    • toDoc

      @NotNull public static <T extends AyaDocile> @NotNull org.aya.pretty.doc.Doc toDoc(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull @NotNull org.aya.util.Arg<T> self)
    • term

      @NotNull protected abstract @NotNull org.aya.pretty.doc.Doc term(@NotNull @NotNull BaseDistiller.Outer outer, @NotNull Term term)
    • visitCalls

      @NotNull public @NotNull org.aya.pretty.doc.Doc visitCalls(@Nullable @Nullable org.aya.util.binop.Assoc assoc, @NotNull @NotNull org.aya.pretty.doc.Doc fn, @NotNull @NotNull kala.collection.SeqView<? extends @NotNull org.aya.util.binop.BinOpParser.Elem<Term>> args, @NotNull @NotNull BaseDistiller.Outer outer, boolean showImplicits)
    • visitCalls

      @NotNull public @NotNull org.aya.pretty.doc.Doc visitCalls(@NotNull @NotNull DefVar<?,?> var, @NotNull @NotNull org.aya.pretty.doc.Style style, @NotNull @NotNull kala.collection.SeqLike<@NotNull org.aya.util.Arg<Term>> args, @NotNull @NotNull BaseDistiller.Outer outer, boolean showImplicits)
    • visitArgsCalls

      @NotNull public @NotNull org.aya.pretty.doc.Doc visitArgsCalls(@NotNull @NotNull DefVar<?,?> var, @NotNull @NotNull org.aya.pretty.doc.Style style, @NotNull @NotNull kala.collection.SeqLike<@NotNull org.aya.util.Arg<Term>> args, @NotNull @NotNull BaseDistiller.Outer outer)
    • arg

      public static <T extends AyaDocile> org.aya.pretty.doc.Doc arg(@NotNull @NotNull BaseDistiller.Fmt<T> fmt, @NotNull org.aya.util.binop.BinOpParser.Elem<T> arg, @NotNull @NotNull BaseDistiller.Outer outer)
    • checkParen

      @NotNull public static @NotNull org.aya.pretty.doc.Doc checkParen(@NotNull @NotNull BaseDistiller.Outer outer, @NotNull @NotNull org.aya.pretty.doc.Doc binApp, @NotNull @NotNull BaseDistiller.Outer binOp)
    • visitTele

      @NotNull public @NotNull org.aya.pretty.doc.Doc visitTele(@NotNull @NotNull kala.collection.Seq<? extends ParamLike<Term>> telescope)
      Pretty-print a telescope in a dumb (but conservative) way.
      See Also:
    • visitTele

      @NotNull public @NotNull org.aya.pretty.doc.Doc visitTele(@NotNull @NotNull kala.collection.Seq<? extends ParamLike<Term>> telescope, @Nullable Term body, @NotNull @NotNull ToIntBiFunction<Term,AnyVar> altF7)
      Pretty-print a telescope in a smart way. The bindings that are not used in the telescope/body are omitted. Bindings of the same type (by 'same' I mean Objects.equals returns true) are merged together.
      Parameters:
      body - the body of the telescope (like the return type in a pi type), only used for finding usages (of the variables in the telescope).
      altF7 - a function for finding usages.
      See Also:
    • varDoc

      @NotNull public static @NotNull org.aya.pretty.doc.Doc varDoc(@NotNull @NotNull AnyVar ref)
    • linkDef

      @NotNull public static @NotNull org.aya.pretty.doc.Doc linkDef(@NotNull @NotNull AnyVar ref, @NotNull @NotNull org.aya.pretty.doc.Style color)
    • linkRef

      @NotNull public static @NotNull org.aya.pretty.doc.Doc linkRef(@NotNull @NotNull AnyVar ref, @NotNull @NotNull org.aya.pretty.doc.Style color)
    • linkIdOf

      @NotNull public static @NotNull org.aya.pretty.backend.string.LinkId linkIdOf(@NotNull @NotNull AnyVar ref)
    • linkLit

      @NotNull public static @NotNull org.aya.pretty.doc.Doc linkLit(int literal, @NotNull @NotNull AnyVar ref, @NotNull @NotNull org.aya.pretty.doc.Style color)
    • linkListLit

      @NotNull public static @NotNull org.aya.pretty.doc.Doc linkListLit(org.aya.pretty.doc.Doc display, @NotNull @NotNull AnyVar ref, @NotNull @NotNull org.aya.pretty.doc.Style color)
    • linkDef

      @NotNull public static @NotNull org.aya.pretty.doc.Doc linkDef(@NotNull @NotNull AnyVar ref)
    • defVar

      @NotNull public static @NotNull org.aya.pretty.doc.Doc defVar(DefVar<?,?> ref)
    • cube

      @NotNull public static @NotNull org.aya.pretty.doc.Doc cube(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull PathTerm.Cube cube)
    • formula

      @NotNull public @NotNull org.aya.pretty.doc.Doc formula(@NotNull @NotNull BaseDistiller.Outer outer, @NotNull @NotNull org.aya.guest0x0.cubical.Formula<Term> formula)
    • partial

      @NotNull public static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile> @NotNull org.aya.pretty.doc.Doc partial(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull @NotNull org.aya.guest0x0.cubical.Partial<T> partial, boolean showEmpty, String lbr, String rbr)
    • restr

      @NotNull public static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile> @NotNull org.aya.pretty.doc.Doc restr(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull @NotNull org.aya.guest0x0.cubical.Restr<T> restr)
    • side

      @NotNull public static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile> @NotNull org.aya.pretty.doc.Doc side(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull org.aya.guest0x0.cubical.Restr.Side<T> side)
    • cofib

      @NotNull public static <T extends org.aya.guest0x0.cubical.Restr.TermLike<T> & AyaDocile> @NotNull org.aya.pretty.doc.Doc cofib(@NotNull @NotNull org.aya.util.distill.DistillerOptions options, @NotNull org.aya.guest0x0.cubical.Restr.Conj<T> conj)
    • unnamedParam

      @NotNull public @NotNull org.aya.pretty.doc.Doc unnamedParam(@NotNull @NotNull ParamLike<Term> param)
    • chooseStyle

      @Nullable protected static @Nullable org.aya.pretty.doc.Style chooseStyle(Object concrete)