• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
      • Start-here
      • Real
      • Debugging
      • Miscellaneous
        • Term
        • Ld
        • Hints
        • Type-set
        • Ordinals
          • O-p
          • O<
          • Proof-of-well-foundedness
          • Two-nats-measure
          • Nat-list-measure
          • Make-ord
          • O-first-coeff
            • E0-ord-<
            • O-first-expt
            • E0-ordinalp
            • O-rst
            • O-finp
            • O>=
            • O<=
            • O-infp
            • O>
          • ACL2-customization
          • With-prover-step-limit
          • With-prover-time-limit
          • Set-prover-step-limit
          • Local-incompatibility
          • Set-case-split-limitations
          • Subversive-recursions
          • Specious-simplification
          • Defsum
          • Oracle-timelimit
          • Thm
          • Defopener
          • Gcl
          • Case-split-limitations
          • Set-gc-strategy
          • Default-defun-mode
          • Top-level
          • Reader
          • Ttags-seen
          • Adviser
          • Ttree
          • Abort-soft
          • Defsums
          • Gc$
          • With-timeout
          • Coi-debug::fail
          • Expander
          • Gc-strategy
          • Coi-debug::assert
          • Sin-cos
          • Def::doc
          • Syntax
          • Subversive-inductions
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Ordinals
    • ACL2-built-ins

    O-first-coeff

    Returns the first coefficient of an ordinal

    An ACL2 ordinal is either a natural number or, for an infinite ordinal, a list whose elements are exponent-coefficient pairs (see o-p). In the latter case, this function returns the cdr of the first pair in the list. In the case of a natural number, this function returns the ordinal itself (since a natural number, n, can be thought of as (w^0)n).

    For the corresponding exponent, see o-first-expt.

    Function: o-first-coeff

    (defun o-first-coeff (x)
           (declare (xargs :guard (or (o-finp x) (consp (car x)))))
           (if (o-finp x) x (cdar x)))