• Top
    • Documentation
    • Books
      • Cert.pl
      • Community-books
      • Project-dir-alist
      • Bookdata
      • Book-hash
      • Uncertified-books
      • Sysfile
      • Show-books
      • Best-practices
        • Working-with-packages
        • Theory-management
          • Naming-rewrite-rules
          • Conventional-normal-forms
          • Where-do-i-place-my-book
          • File-names
          • File-extensions
          • Remove-whitespace
          • Finite-reasoning
        • Books-reference
        • Where-do-i-place-my-book
        • Books-tour
      • Recursion-and-induction
      • Boolean-reasoning
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Best-practices

    Theory-management

    Recommendations related to enabling and disabling functions and theorems.

    The best practices depend somewhat on the kind of book you are writing. We distinguish between Widget Libraries and Core Libraries.

    Widget Libraries

    Scenario: your library describes a particular kind of "Widget:" it defines what Widgets are, provides some useful algorithms for operating on Widgets, and proves some theorems about the properties of Widgets and these algorithms.

    Recommendations

    1. Avoid any non-local inclusion of arithmetic libraries
    2. Avoid any non-local (in-theory ...) events that involve built-in ACL2 functions. For instance, do not do: (in-theory (enable append)).
    3. Try to respect the ACL2 namespace, e.g., do not define new functions in the ACL2 package, especially with short or generic names, etc.

    Rationale

    • You would expect that loading a Widget library should generally just give you definitions and lemmas that are about Widgets.
    • You would not expect a Widget library to change how you reason about other concepts that are unrelated to Widgets.
    • Non-local arithmetic includes may make your Widget library incompatible with other arithmetic libraries.

    Core Libraries

    Scenario: your library is meant to assist with reasoning about built-in ACL2 functions, for instance:

    • arithmetic functions like +, -, *, /, floor, mod, logand;
    • list functions like append, len, nth, member, subsetp;
    • string functions like coerce, concatenate, subseq;
    • system functions like io routines and state updates;
    • meta functions like pseudo-termp, disjoin, conjoin-clauses;

    Since your library is inherently about existing ACL2 functions rather than new definitions, the Widget-library recommendations do not necessarily apply.