• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
                • Pprint-expressions
                • Pprint-expr
                • Expr-grade
                • Pprint-obj-declor
                • Expr-grade-<=
                • Binop-expected-grades
                • Pprint-obj-declon
                • Expr->grade
                • Pprint-tyspecseq
                  • Pprint-tag-declon
                  • Pprint-struct-declon-list
                  • Pprint-fun-declor
                  • Pprint-file
                  • Pprint-stmt
                  • Pprint-struct-declon
                  • Pprint-obj-adeclor
                  • Pprint-initer
                  • Pprint-fun-declon
                  • Pprint-indent
                  • Pprint-hex-const
                  • Pprint-fileset
                  • Pprint-dec-const
                  • Pprinted-lines-to-file
                  • Pprint-tyname
                  • Pprint-param-declon-list
                  • Pprint-oct-const
                  • Pprint-iconst-length
                  • Pprint-iconst
                  • Pprint-const
                  • Expr-grade-index
                  • Pprint-param-declon
                  • Pprint-label
                  • Pprint-ident-list
                  • Pprint-binop
                  • Pprint-fundef
                  • Pprint-file-to-filesystem
                  • Pprint-ext-declon-list
                  • Pprint-unop
                  • Pprint-line
                  • Pprint-ident
                  • Pprint-ext-declon
                  • Pprint-comma-sep
                  • Pprint-transunit
                  • Pprint-one-line
                  • Pprinted-lines-to-channel
                  • Pprint-one-line-blank
                  • Pprint-line-blank
                • Atc-event-and-code-generation
                • Fty-pseudo-term-utilities
                • Atc-term-recognizers
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Atc-pretty-printer

    Pprint-tyspecseq

    Pretty-print a sequence of type specifiers.

    Signature
    (pprint-tyspecseq tss) → part
    Arguments
    tss — Guard (tyspecseqp tss).
    Returns
    part — Type (msgp part).

    As noted in tyspecseq, for now we only capture one sequence for each type, so we need to pick what to print here. We pick the shortest (or only) choice for each type.

    Definitions and Theorems

    Function: pprint-tyspecseq

    (defun pprint-tyspecseq (tss)
      (declare (xargs :guard (tyspecseqp tss)))
      (let ((__function__ 'pprint-tyspecseq))
        (declare (ignorable __function__))
        (tyspecseq-case
             tss
             :void "void"
             :char "char"
             :schar "signed char"
             :uchar "unsigned char"
             :sshort (msg "~s0short~s1"
                          (if tss.signed "signed " "")
                          (if tss.int " int" ""))
             :ushort (msg "unsigned short~s0"
                          (if tss.int " int" ""))
             :sint (cond ((and tss.signed tss.int) "signed int")
                         (tss.signed "signed")
                         (tss.int "int")
                         (t (prog2$ (impossible) "")))
             :uint (msg "unsigned~s0" (if tss.int " int" ""))
             :slong (msg "~s0long~s1"
                         (if tss.signed "signed " "")
                         (if tss.int " int" ""))
             :ulong (msg "unsigned long~s0"
                         (if tss.int " int" ""))
             :sllong (msg "~s0long long~s1"
                          (if tss.signed "signed " "")
                          (if tss.int " int" ""))
             :ullong (msg "unsigned long long~s0"
                          (if tss.int " int" ""))
             :bool "_Bool"
             :float (msg "float~s0"
                         (if tss.complex " _Complex" ""))
             :double (msg "double~s0"
                          (if tss.complex " _Complex" ""))
             :ldouble (msg "long double~s0"
                           (if tss.complex " _Complex" ""))
             :struct (msg "struct ~@0" (pprint-ident tss.tag))
             :union (msg "union ~@0" (pprint-ident tss.tag))
             :enum (msg "union ~@0" (pprint-ident tss.tag))
             :typedef (pprint-ident tss.name))))

    Theorem: msgp-of-pprint-tyspecseq

    (defthm msgp-of-pprint-tyspecseq
      (b* ((part (pprint-tyspecseq tss)))
        (msgp part))
      :rule-classes :rewrite)

    Theorem: pprint-tyspecseq-of-tyspecseq-fix-tss

    (defthm pprint-tyspecseq-of-tyspecseq-fix-tss
      (equal (pprint-tyspecseq (tyspecseq-fix tss))
             (pprint-tyspecseq tss)))

    Theorem: pprint-tyspecseq-tyspecseq-equiv-congruence-on-tss

    (defthm pprint-tyspecseq-tyspecseq-equiv-congruence-on-tss
      (implies (tyspecseq-equiv tss tss-equiv)
               (equal (pprint-tyspecseq tss)
                      (pprint-tyspecseq tss-equiv)))
      :rule-classes :congruence)