• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
          • Syntax-for-tools
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
              • Ienv
                • Ienvp
                • Ienv-fix
                • Make-ienv
                  • Ienv->short-bytes
                  • Ienv->llong-bytes
                  • Ienv-equiv
                  • Ienv->long-bytes
                  • Ienv->int-bytes
                  • Ienv->plain-char-signedp
                  • Change-ienv
                  • Ienv->version
                • Ldm-ienv
                • Ienv-ushort-rangep
                • Ienv-ulong-rangep
                • Ienv-ullong-rangep
                • Ienv-uchar-rangep
                • Ienv-sshort-rangep
                • Ienv-slong-rangep
                • Ienv-sllong-rangep
                • Ienv-sint-rangep
                • Ienv-schar-rangep
                • Ienv-uint-rangep
                • Ienv-char-rangep
                • Ienv->uchar-max
                • Ienv->schar-min
                • Ienv->schar-max
                • Ienv->ushort-max
                • Ienv->ulong-max
                • Ienv->ullong-max
                • Ienv->sshort-max
                • Ienv->slong-max
                • Ienv->sllong-max
                • Ienv->uint-max
                • Ienv->sint-max
                • Ienv->sshort-min
                • Ienv->slong-min
                • Ienv->sllong-min
                • Ienv->sint-min
                • Ienv->char-min
                • Ienv->char-max
                • Ienv->std
                • Ienv->gcc
                • Ienv-default
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • Gcc-builtins
              • Preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Ienv

    Make-ienv

    Basic constructor macro for ienv structures.

    Syntax
    (make-ienv [:version <version>] 
               [:short-bytes <short-bytes>] 
               [:int-bytes <int-bytes>] 
               [:long-bytes <long-bytes>] 
               [:llong-bytes <llong-bytes>] 
               [:plain-char-signedp <plain-char-signedp>]) 
    

    This is the usual way to construct ienv structures. It simply conses together a structure with the specified fields.

    This macro generates a new ienv structure from scratch. See also change-ienv, which can "change" an existing structure, instead.

    Definition

    This is an ordinary make- macro introduced by fty::defprod.

    Macro: make-ienv

    (defmacro make-ienv (&rest args)
      (std::make-aggregate 'ienv
                           args
                           '((:version)
                             (:short-bytes)
                             (:int-bytes)
                             (:long-bytes)
                             (:llong-bytes)
                             (:plain-char-signedp))
                           'make-ienv
                           nil))

    Function: ienv

    (defun ienv (version short-bytes int-bytes long-bytes
                         llong-bytes plain-char-signedp)
      (declare (xargs :guard (and (c::versionp version)
                                  (posp short-bytes)
                                  (posp int-bytes)
                                  (posp long-bytes)
                                  (posp llong-bytes)
                                  (booleanp plain-char-signedp))))
      (declare (xargs :guard (and (<= short-bytes int-bytes)
                                  (<= int-bytes long-bytes)
                                  (<= long-bytes llong-bytes)
                                  (<= 2 short-bytes)
                                  (<= 2 int-bytes)
                                  (<= 4 long-bytes)
                                  (<= 8 llong-bytes))))
      (b* ((version (mbe :logic (c::version-fix version)
                         :exec version))
           (short-bytes (mbe :logic (pos-fix short-bytes)
                             :exec short-bytes))
           (int-bytes (mbe :logic (pos-fix int-bytes)
                           :exec int-bytes))
           (long-bytes (mbe :logic (pos-fix long-bytes)
                            :exec long-bytes))
           (llong-bytes (mbe :logic (pos-fix llong-bytes)
                             :exec llong-bytes))
           (plain-char-signedp (mbe :logic (bool-fix plain-char-signedp)
                                    :exec plain-char-signedp)))
        (let ((short-bytes (mbe :logic
                                (if (and (<= short-bytes int-bytes)
                                         (<= int-bytes long-bytes)
                                         (<= long-bytes llong-bytes)
                                         (<= 2 short-bytes)
                                         (<= 2 int-bytes)
                                         (<= 4 long-bytes)
                                         (<= 8 llong-bytes))
                                    short-bytes
                                  2)
                                :exec short-bytes))
              (int-bytes (mbe :logic
                              (if (and (<= short-bytes int-bytes)
                                       (<= int-bytes long-bytes)
                                       (<= long-bytes llong-bytes)
                                       (<= 2 short-bytes)
                                       (<= 2 int-bytes)
                                       (<= 4 long-bytes)
                                       (<= 8 llong-bytes))
                                  int-bytes
                                2)
                              :exec int-bytes))
              (long-bytes (mbe :logic
                               (if (and (<= short-bytes int-bytes)
                                        (<= int-bytes long-bytes)
                                        (<= long-bytes llong-bytes)
                                        (<= 2 short-bytes)
                                        (<= 2 int-bytes)
                                        (<= 4 long-bytes)
                                        (<= 8 llong-bytes))
                                   long-bytes
                                 4)
                               :exec long-bytes))
              (llong-bytes (mbe :logic
                                (if (and (<= short-bytes int-bytes)
                                         (<= int-bytes long-bytes)
                                         (<= long-bytes llong-bytes)
                                         (<= 2 short-bytes)
                                         (<= 2 int-bytes)
                                         (<= 4 long-bytes)
                                         (<= 8 llong-bytes))
                                    llong-bytes
                                  8)
                                :exec llong-bytes)))
          (list (cons 'version version)
                (cons 'short-bytes short-bytes)
                (cons 'int-bytes int-bytes)
                (cons 'long-bytes long-bytes)
                (cons 'llong-bytes llong-bytes)
                (cons 'plain-char-signedp
                      plain-char-signedp)))))