import BidirTT.Syntax

namespace BidirTT

mutual
  partial def prettyTm : Tm → String
    | .var i      => s!"#{i}"
    | .lam t      => s!"(fun => {prettyTm t})"
    | .app t u    => s!"({prettyTm t} {prettyTm u})"
    | .pi a b     => s!"(Pi {prettyTm a} -> {prettyTm b})"
    | .sig a b    => s!"(Sigma {prettyTm a} * {prettyTm b})"
    | .pair t u   => s!"({prettyTm t}, {prettyTm u})"
    | .fst t      => s!"({prettyTm t}.1)"
    | .snd t      => s!"({prettyTm t}.2)"
    | .nat        => "Nat"
    | .zero       => "zero"
    | .succ t     => s!"(succ {prettyTm t})"
    | .natElim m z s n =>
        s!"(natElim {prettyTm m} {prettyTm z} {prettyTm s} {prettyTm n})"
    | .unit       => "Unit"
    | .triv       => "tt"
    | .unitElim m t u =>
        s!"(unitElim {prettyTm m} {prettyTm t} {prettyTm u})"
    | .empty      => "Empty"
    | .emptyElim m e =>
        s!"(emptyElim {prettyTm m} {prettyTm e})"
    | .id a t u   => s!"(Id {prettyTm a} {prettyTm t} {prettyTm u})"
    | .refl       => "refl"
    | .idElim m r y p =>
        s!"(idElim {prettyTm m} {prettyTm r} {prettyTm y} {prettyTm p})"
    | .univ i     => s!"U{i}"
    | .letE a t u => s!"(let : {prettyTm a} := {prettyTm t}; {prettyTm u})"
end

end BidirTT
