• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
        • Rp-ruleset
          • Add-meta-rule
            • Enable-meta-rules
            • Disable-meta-rules
            • Def-rp-rule
            • Rp-pr
            • Enable-exc-counterpart
            • Disable-exc-counterpart
            • Bump-rules
            • Bump-rule
            • Bump-down-rule
            • Bump-all-meta-rules
            • Enable-rules
            • Enable-preprocessor
            • Enable-postprocessor
            • Disable-rules
            • Disable-preprocessor
            • Disable-postprocessor
            • Disable-all-rules
          • Defthmrp
          • Rp-rewriter/meta-rules
          • Rp-utilities
          • Rp-rewriter-demo
          • Rp-rewriter/debugging
          • Rp-rewriter/applications
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Rp-rewriter/meta-rules
    • Rp-ruleset

    Add-meta-rule

    A macro to add created meta rules to RP-Rewriter

    
    (add-meta-rule :meta-fnc <meta-fnc-name> ;; mandatory
                   :trig-fnc <trig-fnc-name> ;; mandatory
                   :formula-checks <formula-check-fnc-name> ;; nil by default, necessary in most cases.
                   :returns <return-signature>   ;; optional
                   :rw-directuon <:inside-out, :outside-in, or :both>  ;; optional, :inside-out by default
                   :valid-syntaxp <t-or-nil>     ;; optional, t by default
                   :disabled <t-or-nil>          ;; optional, t by default
                   :hints    <regular-ACL2-hints> ;; optional
                   :cl-name-prefix <nil-or-a-unqiue-prefix> ;; optional, nil by default
                   )
     
     
    registers a verified meta-rule for RP-Rewriter.

    Mandatory arguments:

    • :meta-fnc must be the name of the meta function.
    • :trig-fnc the function to trigger this meta function

    Optional Arguments:

    • :formula-checks the name of the formula-checks function created with def-formula-checks if the meta rule needed one. This will likely be necessary for most cases.
    • :returns return signature of the meta function. By default, it is 'term', which means that it only returns the rewritten term. Other acceptable forms are (mv term dont-rw), (mv term dont-rw rp-state), (mv term rp-state) etc. in any order.
    • :rw-direction whether the meta rule be applied from outside-in or inside-out. You can pass :inside-out, nil (same as :inside-out), :outside-in or :both. If you choose to make it an outside-in rule, then it is recommended that you input the current dont-rw structure to the meta function and update it accordingly.
    • :valid-syntaxp if you proved that your meta function returns rp-termp, then set this to t. Otherwise, RP-Rewriter will have to call rp-termp everytime the meta runction changes the term.
    • :disabled will cause the registered meta rule to be disabled by default, but it can be later enabled by the user.
    • :hints regular ACL2 hints passed to the internal defthm event that checks the correctness of necessary lemmas mentioned in Rp-rewriter/meta-rules.
    • :cl-name-prefix Meta functions are attached to RP-Rewriter using a defattach mechanism. By default, add-meta-rule will not trigger this mechanism, and the user needs to call attach-meta-fncs once all the necessary meta rules are created and included in the same book. If you wish to call attach-meta-fncs automatically with rp::add-meta-rule, then pass a unique name for :cl-name-prefix. It is nil by default, which will prevent attach-meta-fncs from being executed.