HandleNumOrIdent #
This module provides elaboration helpers for numeric/identifier operands.
Build the Expr UInt64.ofNat n from a Nat.
Equations
- mkUIntOfNat n = (Lean.Expr.const `UInt64.ofNat []).app (Lean.mkNatLit n)
Instances For
Build the Expr of the numeral denoting the UInt64 n.
Equations
- mkUintOfNat n = (Lean.Expr.const `OfNat.ofNat []).app (Lean.mkNatLit n.toNat)
Instances For
Build the Expr of the UInt64 literal n.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborate a num-or-ident syntax node into the term it denotes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Reinterpret a term as mriscxNumOrIdent syntax.
Equations
- parseTermToMriscxNumOrIdent s = { raw := s.raw }
Instances For
A function that first checks whether the given num or
ident is a numeric literal. If so, it returns the corresponding UInt64 expression.
If not, it checks if the variable name has been declared as a UInt64 in the current
context and, if found, returns it as an expression. If neither condition is met,
the function fails.
To be able to check if the variable has already been declared, the MetaM
Monad is required. For this reason, we return a TermElabM Expr, which has to be
lifted afterwards.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply parseMriscxNumOrIdent on all elements inside an array
Equations
- One or more equations did not get rendered due to their size.
Instances For
Elaborate a label identifier into its string Expr, honouring the leading-dot form.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Turn a label identifier into the term naming its target, honouring the leading-dot form.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Unexpand a term back into mriscxNumOrIdent surface syntax.
Equations
- One or more equations did not get rendered due to their size.