• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
          • Preprocessor
          • Vl-loadconfig
          • Lexer
          • Vl-loadstate
          • Parser
          • Vl-load-merge-descriptions
          • Scope-of-defines
          • Vl-load-file
          • Vl-flush-out-descriptions
          • Vl-description
          • Vl-loadresult
          • Vl-read-file
          • Vl-find-basename/extension
          • Vl-find-file
          • Vl-read-files
          • Extended-characters
            • Vl-echar-p
            • Vl-location
              • Vl-location-p
              • Vl-location-fix
              • Vl-string-between-locs
              • Vl-location-between-p
                • Vl-string-findloc
                • Vl-location-equiv
                • Make-vl-location
                • Vl-location-string
                • Vl-location->filename
                • Vl-location->line
                • Change-vl-location
                • Vl-location->col
                • *vl-fakeloc*
              • Vl-echarlist->chars
              • Vl-echarlist-from-chars
              • Vl-echarlist-from-str
              • Vl-echarlist-unsigned-value
              • Vl-change-echarlist-locations
              • Vl-echar-digit-value
              • Vl-echarlist->string
            • Vl-load
            • Vl-load-main
            • Vl-load-description
            • Vl-descriptions-left-to-load
            • Inject-warnings
            • Vl-load-descriptions
            • Vl-load-files
            • Vl-load-summary
            • Vl-collect-modules-from-descriptions
            • Vl-descriptionlist
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-location

    Vl-location-between-p

    (vl-location-between-p x min max) is true exactly when x is in the same file as min and max, and inclusively falls between these bounds.

    Signature
    (vl-location-between-p x min max) → *
    Arguments
    x — Guard (vl-location-p x).
    min — Guard (vl-location-p min).
    max — Guard (vl-location-p max).

    Definitions and Theorems

    Function: vl-location-between-p

    (defun vl-location-between-p (x min max)
      (declare (xargs :guard (and (vl-location-p x)
                                  (vl-location-p min)
                                  (vl-location-p max))))
      (let ((__function__ 'vl-location-between-p))
        (declare (ignorable __function__))
        (b* (((vl-location x) x)
             ((vl-location low) min)
             ((vl-location high) max))
          (and (equal x.filename low.filename)
               (equal x.filename high.filename)
               (or (< low.line x.line)
                   (and (eql low.line x.line)
                        (<= low.col x.col)))
               (or (< x.line high.line)
                   (and (eql x.line high.line)
                        (<= x.col high.col)))))))

    Theorem: vl-location-between-p-of-vl-location-fix-x

    (defthm vl-location-between-p-of-vl-location-fix-x
      (equal (vl-location-between-p (vl-location-fix x)
                                    min max)
             (vl-location-between-p x min max)))

    Theorem: vl-location-between-p-vl-location-equiv-congruence-on-x

    (defthm vl-location-between-p-vl-location-equiv-congruence-on-x
      (implies (vl-location-equiv x x-equiv)
               (equal (vl-location-between-p x min max)
                      (vl-location-between-p x-equiv min max)))
      :rule-classes :congruence)

    Theorem: vl-location-between-p-of-vl-location-fix-min

    (defthm vl-location-between-p-of-vl-location-fix-min
      (equal (vl-location-between-p x (vl-location-fix min)
                                    max)
             (vl-location-between-p x min max)))

    Theorem: vl-location-between-p-vl-location-equiv-congruence-on-min

    (defthm vl-location-between-p-vl-location-equiv-congruence-on-min
      (implies (vl-location-equiv min min-equiv)
               (equal (vl-location-between-p x min max)
                      (vl-location-between-p x min-equiv max)))
      :rule-classes :congruence)

    Theorem: vl-location-between-p-of-vl-location-fix-max

    (defthm vl-location-between-p-of-vl-location-fix-max
      (equal (vl-location-between-p x min (vl-location-fix max))
             (vl-location-between-p x min max)))

    Theorem: vl-location-between-p-vl-location-equiv-congruence-on-max

    (defthm vl-location-between-p-vl-location-equiv-congruence-on-max
      (implies (vl-location-equiv max max-equiv)
               (equal (vl-location-between-p x min max)
                      (vl-location-between-p x min max-equiv)))
      :rule-classes :congruence)