c

at.logic.gapt.formats.babel

BabelExporter

class BabelExporter extends PrettyPrinter

Exports lambda expressions in the Babel format. You probably do not want to use this class, use one of expression.toString, .toSigRelativeString, or .toAsciiString instead. These are all implemented using this class.

This exporter is implemented using the pretty-printing library included in Kiama.

Source
export.scala
Linear Supertypes
PrettyPrinter, PrettyPrinterBase, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BabelExporter
  2. PrettyPrinter
  3. PrettyPrinterBase
  4. AnyRef
  5. 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

Instance Constructors

  1. new BabelExporter(unicode: Boolean, sig: BabelSignature, omitTypes: Boolean = false)

    unicode

    Whether to output logical connectives using Unicode symbols.

    sig

    The Babel signature, to decide whether we need to escape constants because they do not fit the naming convention.

Type Members

  1. type Buffer = Seq[Entry]
    Definition Classes
    PrettyPrinter
  2. class Doc extends DocCont with org.bitbucket.inkytonik.kiama.output.PrettyPrinter.DocOps
    Definition Classes
    PrettyPrinter
  3. type DocCont = (IW) ⇒ (TreeCont) ⇒ Trampoline[TreeCont]
    Definition Classes
    PrettyPrinter
  4. trait DocOps extends AnyRef
    Definition Classes
    PrettyPrinterBase
  5. type Dq = Queue[(PPosition, OutGroup)]
    Definition Classes
    PrettyPrinter
  6. type Effect = (Buffer) ⇒ Buffer
    Definition Classes
    PrettyPrinter
  7. sealed abstract class Entry extends AnyRef
    Definition Classes
    PrettyPrinter
  8. case class Finish extends Entry with Product with Serializable
    Definition Classes
    PrettyPrinter
  9. type Horizontal = Boolean
    Definition Classes
    PrettyPrinter
  10. type IW = (Indent, Width)
    Definition Classes
    PrettyPrinter
  11. type Out = (Remaining) ⇒ Trampoline[Buffer]
    Definition Classes
    PrettyPrinter
  12. type OutGroup = (Horizontal) ⇒ (Out) ⇒ Trampoline[Out]
    Definition Classes
    PrettyPrinter
  13. type PPosition = Int
    Definition Classes
    PrettyPrinter
  14. type Remaining = Int
    Definition Classes
    PrettyPrinter
  15. case class Start extends Entry with Product with Serializable
    Definition Classes
    PrettyPrinter
  16. case class Text extends Entry with Product with Serializable
    Definition Classes
    PrettyPrinter
  17. type TreeCont = (PPosition, Dq) ⇒ Trampoline[Out]
    Definition Classes
    PrettyPrinter

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from BabelExporter to any2stringadd[BabelExporter] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (BabelExporter, B)
    Implicit
    This member is added by an implicit conversion from BabelExporter to ArrowAssoc[BabelExporter] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def align(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  7. def ampersand: Doc
    Definition Classes
    PrettyPrinterBase
  8. def angles(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  9. def any(a: Any): Doc
    Definition Classes
    PrettyPrinterBase
  10. def arguments[T](l: Seq[T], elemToDoc: (T) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinterBase
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. val asciiUnquotName: Regex
  13. def asterisk: Doc
    Definition Classes
    PrettyPrinterBase
  14. def atsign: Doc
    Definition Classes
    PrettyPrinterBase
  15. def backquote: Doc
    Definition Classes
    PrettyPrinterBase
  16. def backslash: Doc
    Definition Classes
    PrettyPrinterBase
  17. def braces(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  18. def brackets(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  19. def caret: Doc
    Definition Classes
    PrettyPrinterBase
  20. def cat(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  21. implicit def char(c: Char): Doc
    Definition Classes
    PrettyPrinterBase
  22. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. def colon: Doc
    Definition Classes
    PrettyPrinterBase
  24. def column(f: (Int) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  25. def comma: Doc
    Definition Classes
    PrettyPrinterBase
  26. val defaultIndent: Int
    Definition Classes
    BabelExporter → PrettyPrinterBase
  27. val defaultWidth: Int
    Definition Classes
    PrettyPrinterBase
  28. def dollar: Doc
    Definition Classes
    PrettyPrinterBase
  29. def dot: Doc
    Definition Classes
    PrettyPrinterBase
  30. def dquote: Doc
    Definition Classes
    PrettyPrinterBase
  31. def dquotes(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  32. def emptyDoc: Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  33. def enclose(l: Doc, d: Doc, r: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  34. def ensuring(cond: (BabelExporter) ⇒ Boolean, msg: ⇒ Any): BabelExporter
    Implicit
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  35. def ensuring(cond: (BabelExporter) ⇒ Boolean): BabelExporter
    Implicit
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  36. def ensuring(cond: Boolean, msg: ⇒ Any): BabelExporter
    Implicit
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  37. def ensuring(cond: Boolean): BabelExporter
    Implicit
    This member is added by an implicit conversion from BabelExporter to Ensuring[BabelExporter] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  38. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. def equal: Doc
    Definition Classes
    PrettyPrinterBase
  40. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  41. def exclamation: Doc
    Definition Classes
    PrettyPrinterBase
  42. def export(ty: Ty): String
  43. def export(sequent: HOLSequent): String
  44. def export(expr: LambdaExpression): String
  45. def fillcat(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  46. def fillsep(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  47. def fillsep(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  48. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  49. def folddoc(ds: Seq[Doc], f: (Doc, Doc) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinterBase
  50. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from BabelExporter to StringFormat[BabelExporter] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  51. def forwslash: Doc
    Definition Classes
    PrettyPrinterBase
  52. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  53. def group(d: Doc): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  54. def hang(d: Doc, i: Indent): Doc
    Definition Classes
    PrettyPrinterBase
  55. def hash: Doc
    Definition Classes
    PrettyPrinterBase
  56. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  57. def hcat(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  58. def hsep(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  59. def hsep(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  60. def indent(d: Doc, i: Indent): Doc
    Definition Classes
    PrettyPrinterBase
  61. val infixRel: Set[String]
  62. def insert(len: Int, entry: Entry): Doc
    Definition Classes
    PrettyPrinter
  63. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  64. def knownConstantTypesFromSig(consts: Iterable[Const]): Iterable[(String, Const)]
  65. def langle: Doc
    Definition Classes
    PrettyPrinterBase
  66. def layout(d: Doc, w: Width): Layout
    Definition Classes
    PrettyPrinterBase
  67. def lbrace: Doc
    Definition Classes
    PrettyPrinterBase
  68. def lbracket: Doc
    Definition Classes
    PrettyPrinterBase
  69. def leave(c: TreeCont): TreeCont
    Definition Classes
    PrettyPrinter
  70. def line: Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  71. def line(repl: Layout): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  72. def linebreak: Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  73. def link(n: AnyRef, d: Doc): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  74. def links(d: Doc, w: Width): Links
    Definition Classes
    PrettyPrinterBase
  75. def list[T](l: List[T], prefix: String, elemToDoc: (T) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinterBase
  76. def lparen: Doc
    Definition Classes
    PrettyPrinterBase
  77. def lsep(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  78. def lsep2(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  79. def lterm(ds: Seq[Doc], term: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  80. def minus: Doc
    Definition Classes
    PrettyPrinterBase
  81. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  82. def nest(doc: Doc, j: Indent = defaultIndent): Doc
    Definition Classes
    BabelExporter → PrettyPrinter → PrettyPrinterBase
  83. def nesting(f: (Int) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  84. final def notify(): Unit
    Definition Classes
    AnyRef
  85. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  86. def output(o: Out, r: Int, entry: Entry): More[Buffer]
    Definition Classes
    PrettyPrinter
  87. def padto(p: Int, d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  88. def padtobreak(p: Int, d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  89. def parenIf(enclosingPrio: Int, currentPrio: Int, doc: Doc): Doc
  90. def parens(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  91. def percent: Doc
    Definition Classes
    PrettyPrinterBase
  92. def plus: Doc
    Definition Classes
    PrettyPrinterBase
  93. def pretty(d: Doc, w: Width): Document
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  94. def prune(c1: TreeCont): TreeCont
    Definition Classes
    PrettyPrinter
  95. def question: Doc
    Definition Classes
    PrettyPrinterBase
  96. def rangle: Doc
    Definition Classes
    PrettyPrinterBase
  97. def rbrace: Doc
    Definition Classes
    PrettyPrinterBase
  98. def rbracket: Doc
    Definition Classes
    PrettyPrinterBase
  99. def rparen: Doc
    Definition Classes
    PrettyPrinterBase
  100. val safeChars: Regex
  101. def scan(l: Width, out: OutGroup)(c: TreeCont): Trampoline[TreeCont]
    Definition Classes
    PrettyPrinter
  102. def semi: Doc
    Definition Classes
    PrettyPrinterBase
  103. def sep(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  104. def seq[T](l: Seq[T], prefix: String, elemToDoc: (T) ⇒ Doc, sep: Doc, sepfn: (Seq[Doc], Doc) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinterBase
  105. def show(ty: Ty, needParens: Boolean): Doc
  106. def show(expr: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, VarOrConst], p: Int): (Doc, Map[String, VarOrConst])

    Converts a lambda expression into a document.

    Converts a lambda expression into a document.

    At every point in the conversion, we keep track of:

    1. Whether the parser will already know the type of this expression (by inference)
    2. What type the free identifiers have.
    3. What priority the enclosing operator has.
    expr

    The lambda expression to convert.

    knownType

    Whether we already know the type of this expression.

    bound

    Names bound by enclosing binders.

    t0

    Already used free identifiers, together with the variable or constant they represent.

    p

    The priority of the enclosing operator.

    returns

    Pretty-printed document and the free identifiers.

  107. def show(sequent: HOLSequent, bound: Set[String], t0: Map[String, VarOrConst]): (Doc, Map[String, VarOrConst])
  108. def showApps(expr: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, VarOrConst], p: Int): (Doc, Map[String, VarOrConst])
  109. def showBin(sym: String, prio: Int, leftPrioBias: Int, rightPrioBias: Int, a: LambdaExpression, b: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, VarOrConst], p: Int): (Doc, Map[String, VarOrConst])
  110. def showBinOp(c: Const, prio: Int, leftPrioBias: Int, rightPrioBias: Int, a: LambdaExpression, b: LambdaExpression, knownType: Boolean, bound: Set[String], t0: Map[String, VarOrConst], p: Int): (Doc, Map[String, VarOrConst])
  111. def showName(name: String): Doc
  112. def showQuant(sym: String, v: Var, e: LambdaExpression, bound: Set[String], t0: Map[String, VarOrConst], p: Int): (Doc, Map[String, VarOrConst])
  113. def softbreak: Doc
    Definition Classes
    PrettyPrinterBase
  114. def softline: Doc
    Definition Classes
    PrettyPrinterBase
  115. def space: Doc
    Definition Classes
    PrettyPrinterBase
  116. def spaces(n: Int): Doc
    Definition Classes
    PrettyPrinterBase
  117. def squote: Doc
    Definition Classes
    PrettyPrinterBase
  118. def squotes(d: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  119. def ssep(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  120. def sterm(ds: Seq[Doc], term: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  121. def string(s: String): Doc
    Definition Classes
    PrettyPrinterBase
  122. def surround(d: Doc, b: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  123. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  124. implicit def text(t: String): Doc
    Definition Classes
    PrettyPrinter → PrettyPrinterBase
  125. def tilde: Doc
    Definition Classes
    PrettyPrinterBase
  126. def toString(): String
    Definition Classes
    AnyRef → Any
  127. def underscore: Doc
    Definition Classes
    PrettyPrinterBase
  128. def value(v: Any): Doc
    Definition Classes
    PrettyPrinterBase
  129. def vcat(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  130. def verticalbar: Doc
    Definition Classes
    PrettyPrinterBase
  131. def vsep(ds: Seq[Doc], sep: Doc): Doc
    Definition Classes
    PrettyPrinterBase
  132. def vsep(ds: Seq[Doc]): Doc
    Definition Classes
    PrettyPrinterBase
  133. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  134. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  135. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  136. def width(d: Doc, f: (Int) ⇒ Doc): Doc
    Definition Classes
    PrettyPrinterBase
  137. def [B](y: B): (BabelExporter, B)
    Implicit
    This member is added by an implicit conversion from BabelExporter to ArrowAssoc[BabelExporter] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
  138. object prio

Inherited from PrettyPrinter

Inherited from PrettyPrinterBase

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped