• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
      • Gl
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Removable-runes
      • Efficiency
      • Rewrite-bounds
      • Bash
      • Def-dag-measure
      • Fgl
        • Fgl-rewrite-rules
          • Fgl-syntactic-checker-binders
          • Binder
          • Fancy-ev
          • Def-fgl-program
            • Bind-var
            • Add-fgl-brewrites
            • Def-fgl-rewrite
            • Narrow-equiv
            • Def-fgl-branch-merge
            • Add-fgl-rewrites
            • Fgl-interp-obj
            • Fgl-prog2
            • Collect-cmr-rewrites-for-formula-name
            • Syntax-bind
            • Fgl-time
            • Assume
            • Add-fgl-binder-meta
            • Add-fgl-primitive
            • Add-fgl-meta
            • Add-fgl-branch-merges
            • Cmr::rewritelist->lhses
            • Remove-fgl-brewrites
            • Remove-fgl-branch-merges
            • Lhses->branch-function-syms
            • Enable-execution
            • Abort-rewrite
            • Syntax-interp
            • Remove-fgl-rewrites
            • Lhses->leading-function-syms
            • Remove-fgl-primitive
            • Remove-fgl-binder-meta
            • If!
            • Disable-execution
            • Remove-fgl-meta
            • Fgl-time-fn
            • Disable-definition
            • Def-fgl-brewrite
          • Fgl-function-mode
          • Fgl-object
          • Fgl-solving
          • Fgl-handling-if-then-elses
          • Fgl-getting-bits-from-objects
          • Fgl-primitive-and-meta-rules
          • Fgl-interpreter-overview
          • Fgl-counterexamples
          • Fgl-correctness-of-binding-free-variables
          • Fgl-debugging
          • Fgl-testbenches
          • Def-fgl-boolean-constraint
          • Fgl-stack
          • Fgl-rewrite-tracing
          • Def-fgl-param-thm
          • Def-fgl-thm
          • Fgl-fast-alist-support
          • Advanced-equivalence-checking-with-fgl
          • Fgl-array-support
          • Fgl-internals
        • Bdd
        • Remove-hyps
        • Contextual-rewriting
        • Simp
        • Rewrite$-hyps
        • Bash-term-to-dnf
        • Use-trivial-ancestors-check
        • Minimal-runes
        • Clause-processor-tools
        • Fn-is-body
        • Without-subsumption
        • Rewrite-equiv-hint
        • Def-bounds
        • Rewrite$-context
        • Try-gl-concls
        • Hint-utils
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Fgl-rewrite-rules

    Def-fgl-program

    Define a function that is logically just NIL but has special extralogical behavior in FGL.

    Because of FGL's bind-var feature, it isn't always possible to define a function the way you want it to run in FGL: if you want to use bind-var, then you must have a free variable in the RHS of the equation defining the function, which isn't allowed for ACL2 definitions. Instead, you may provide a function definition without bind-var calls, disable that definition for FGL (using disable-definition), and add an FGL rewrite rule with def-fgl-rewrite that rewrites calls of the function to the body containing the bind-var calls.

    Def-fgl-program provides a convenient macro for this. It wraps define such that all the usual arguments for define may be used. It may also contain the additional keyword args :equiv, giving the equivalence relation for the generated rewrite rule (defaulting to unequiv), and :fgl-hints, which allows hints to be passed to the proof for the rewrite rule. Instead of providing the given function body as the body for the define, it modifies it as follows: if :equiv is provided, it searches the given body for calls of bind-var and syntax-bind and replaces them with their second arguments; otherwise, it just provides a body of nil.