File: .lake/packages/lean4/src/lean/Lean/Meta/LitValues.lean

full_name: Lean.Meta.getRawNatValue?
code: /-- Returns `some n` if `e` is a raw natural number, i.e., it is of the form `.lit (.natVal n)`. -/
def getRawNatValue? (e : Expr) : Option Nat 
goal: Option Nat

full_name: Lean.Meta.getOfNatValue?
code: /-- Return `some (n, type)` if `e` is an `OfNat.ofNat`-application encoding `n` for a type with name `typeDeclName`. -/
def getOfNatValue? (e : Expr) (typeDeclName : Name) : MetaM (Option (Nat × Expr)) 
goal: Lean.MetaM (Option (Nat × Lean.Expr))

full_name: Lean.Meta.getNatValue?
code: /-- Return `some n` if `e` is a raw natural number or an `OfNat.ofNat`-application encoding `n`. -/
def getNatValue? (e : Expr) : MetaM (Option Nat) 
goal: Lean.MetaM (Option Nat)

full_name: Lean.Meta.getIntValue?
code: /-- Return `some i` if `e` `OfNat.ofNat`-application encoding an integer, or `Neg.neg`-application of one. -/
def getIntValue? (e : Expr) : MetaM (Option Int) 
goal: Lean.MetaM (Option Int)

full_name: Lean.Meta.getCharValue?
code: /-- Return `some c` if `e` is a `Char.ofNat`-application encoding character `c`. -/
def getCharValue? (e : Expr) : MetaM (Option Char) 
goal: Lean.MetaM (Option Char)

full_name: Lean.Meta.getStringValue?
code: /-- Return `some s` if `e` is of the form `.lit (.strVal s)`. -/
def getStringValue? (e : Expr) : (Option String) 
goal: Option String

full_name: Lean.Meta.getFinValue?
code: /-- Return `some ⟨n, v⟩` if `e` is af `OfNat.ofNat` application encoding a `Fin n` with value `v` -/
def getFinValue? (e : Expr) : MetaM (Option ((n : Nat) × Fin n)) 
goal: Lean.MetaM (Option ((n : Nat) × Fin n))

full_name: Lean.Meta.getBitVecValue?
code: /--
Return `some ⟨n, v⟩` if `e` is:
- an `OfNat.ofNat` application
- a `BitVec.ofNat` application
- a `BitVec.ofNatLt` application
that encode a `BitVec n` with value `v`.
-/
def getBitVecValue? (e : Expr) : MetaM (Option ((n : Nat) × BitVec n)) 
goal: Lean.MetaM (Option ((n : Nat) × BitVec n))

full_name: Lean.Meta.getUInt8Value?
code: /-- Return `some n` if `e` is an `OfNat.ofNat`-application encoding the `UInt8` with value `n`. -/
def getUInt8Value? (e : Expr) : MetaM (Option UInt8) 
goal: Lean.MetaM (Option UInt8)

full_name: Lean.Meta.getUInt16Value?
code: /-- Return `some n` if `e` is an `OfNat.ofNat`-application encoding the `UInt16` with value `n`. -/
def getUInt16Value? (e : Expr) : MetaM (Option UInt16) 
goal: Lean.MetaM (Option UInt16)

full_name: Lean.Meta.getUInt32Value?
code: /-- Return `some n` if `e` is an `OfNat.ofNat`-application encoding the `UInt32` with value `n`. -/
def getUInt32Value? (e : Expr) : MetaM (Option UInt32) 
goal: Lean.MetaM (Option UInt32)

full_name: Lean.Meta.getUInt64Value?
code: /-- Return `some n` if `e` is an `OfNat.ofNat`-application encoding the `UInt64` with value `n`. -/
def getUInt64Value? (e : Expr) : MetaM (Option UInt64) 
goal: Lean.MetaM (Option UInt64)

full_name: Lean.Meta.normLitValue
code: /--
If `e` is a literal value, ensure it is encoded using the standard representation.
Otherwise, just return `e`.
-/
def normLitValue (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: Lean.Meta.isLitValue
code: /--
Returns `true` if `e` is a literal value.
-/
def isLitValue (e : Expr) : MetaM Bool 
goal: Lean.MetaM Bool

full_name: Lean.Meta.litToCtor
code: /--
If `e` is a `Nat`, `Int`, or `Fin` literal value, converts it into a constructor application.
Otherwise, just return `e`.
-/
-- TODO: support other builtin literals if needed
def litToCtor (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr