• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
        • Instructions
        • Proof-builder-commands
        • Proof-builder-commands-short-list
          • ACL2-pc::=
          • ACL2-pc::s
          • ACL2-pc::exit
          • ACL2-pc::in-theory
          • ACL2-pc::comm
          • ACL2-pc::dv
          • ACL2-pc::x
            • ACL2-pc::show-rewrites
            • ACL2-pc::claim
            • ACL2-pc::split
            • ACL2-pc::prove
            • ACL2-pc::save
            • ACL2-pc::demote
            • ACL2-pc::retrieve
            • ACL2-pc::bash
            • ACL2-pc::p-top
            • ACL2-pc::expand
            • ACL2-pc::bk
            • ACL2-pc::induct
            • ACL2-pc::undo
            • ACL2-pc::top
            • ACL2-pc::restore
            • ACL2-pc::replay
            • ACL2-pc::p
            • ACL2-pc::nx
            • ACL2-pc::contrapose
            • ACL2-pc::up
            • ACL2-pc::th
            • ACL2-pc::use
            • ACL2-pc::s-prop
            • ACL2-pc::runes
            • ACL2-pc::goals
            • ACL2-pc::drop
            • ACL2-pc::x-dumb
            • ACL2-pc::cg
            • ACL2-pc::sr
            • ACL2-pc::r
          • Dive-into-macros-table
          • Verify
          • Define-pc-macro
          • Macro-command
          • Define-pc-help
          • Toggle-pc-macro
          • Define-pc-meta
          • Retrieve
          • Unsave
          • Proof-checker
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proof-builder-commands
    • Proof-builder-commands-short-list

    ACL2-pc::x

    (atomic macro) expand and (maybe) simplify function call at the current subterm

    Examples:
    x --  expand and simplify.

    Also see ACL2-pc::expand and see ACL2-pc::x-dumb, which do not perform simplification.

    For example, if the current subterm is (append a b), then after x the current subterm will probably be (cons (car a) (append (cdr a) b)) if (consp a) is among the top-level hypotheses and governors. If there are no top-level hypotheses and governors, then after x the current subterm will probably be:

    (if (consp a)
        (cons (car a) (append (cdr a) b))
        b).
    General Form:
    (X &key
       rewrite normalize backchain-limit in-theory hands-off expand)

    Expand the function call at the current subterm, and simplify using the same conventions as with the s command (see ACL2-pc::s).

    Unlike s, it is permitted to set both :rewrite and :normalize to nil, which will result in no simplification; see ACL2-pc::x-dumb.

    Remark (obscure): On rare occasions the current address may be affected by the use of x. For example, suppose we have the definition

    (defun g (x) (if (consp x) x 3))

    and then we enter the interactive proof-builder with

    (verify (if (integerp x) (equal (g x) 3) t)) .

    Then after invoking the instruction (dive 2 1), so that the current subterm is (g x), followed by the instruction x, we would expect the conclusion to be (if (integerp x) (equal 3 3) t). However, the system actually replaces (equal 3 3) with t (because we use the ACL2 term-forming primitives), and hence the conclusion is actually (if (integerp x) t t). Therefore, the current address is put at (2) rather than (2 1). In such cases, a warning ``NOTE'' will be printed to the terminal.

    The other primitive commands to which the above ``truncation'' note applies are equiv, rewrite, and s.