• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
              • Compilation
              • Static-semantics
              • Concrete-syntax
                • Pretty-printer
                • Grammar
                • Lexing-and-parsing
                  • Lexer
                  • Parser
                  • Token-fringe
                  • Longest-lexp
                  • Parser-interface
                    • Parse-from-file-at-path+
                    • Tokens-to-cst
                    • Parse-fragment-to-cst+
                    • Lexemes-to-cst+
                    • Parse-from-string+
                    • Parse-from-codepoints+
                    • Parse-fragment-to-cst
                    • Parse-from-bytes+
                    • Parse-from-string
                    • Parse-from-file-at-path
                    • Token-parses?
                    • Statement-parses?
                    • Expression-parses?
                    • File-parses?
                    • Token-parses-same-fringe?
                    • Expression-parses-same-fringe?
                    • Statement-parses-same-fringe?
                      • Parse-from-codepoints
                      • File-parses-same-fringe?
                      • Parse-from-bytes
                    • Grammar-lexp
                    • Identifier-lexp
                    • Output-file-parsep
                    • Input-file-parsep
                    • File-lex-parse-p
                    • Filter-tokens
                    • Lexp
                    • File-parsep
                    • Input-parser
                    • Output-file-lex-parse-p
                    • Input-file-lex-parse-p
                    • Parser-abstractor-interface
                    • Identifier-abnf-stringp
                    • Symbol-abnf-stringp
                    • Keyword-abnf-stringp
                    • Output-parser
                    • Tokenizer
                  • Input-pretty-printer
                  • Output-pretty-printer
                  • Unicode-characters
                  • Concrete-syntax-trees
                  • Symbols
                  • Keywords
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Parser-interface

    Statement-parses-same-fringe?

    Checks if the given string can be parsed to a Leo statement CST.

    Signature
    (statement-parses-same-fringe? statement-string) → yes/no
    Arguments
    statement-string — Guard (stringp statement-string).
    Returns
    yes/no — Type (booleanp yes/no).

    Same as statement-parses?, but this does some additional checks, so it is better for testing.

    Definitions and Theorems

    Function: statement-parses-same-fringe?

    (defun statement-parses-same-fringe? (statement-string)
     (declare (xargs :guard (stringp statement-string)))
     (let ((__function__ 'statement-parses-same-fringe?))
      (declare (ignorable __function__))
      (b* (((mv tree? lexemes)
            (parse-fragment-to-cst+ "statement" statement-string)))
       (and
         (abnf::treep tree?)
         (abnf-tree-with-root-p tree? "statement")
         (abnf-tree-list-with-root-p lexemes "lexeme")
         (equal
              (abnf::tree-list->string lexemes)
              (acl2::utf8=>ustring (string=>nats statement-string)))))))

    Theorem: booleanp-of-statement-parses-same-fringe?

    (defthm booleanp-of-statement-parses-same-fringe?
      (b* ((yes/no (statement-parses-same-fringe? statement-string)))
        (booleanp yes/no))
      :rule-classes :rewrite)