add_bare_numeral_form : (char * string option) -> unit
This map function is computed as follows: if the s option value is NONE, then the function is considered to be the identity and never really appears; the digits denote a natural number. If the value of s is SOME s', then the parser translates the string to an application of s' to the natural number denoted by the digits.
val bthm = |- binary_of n = if n = 0 then 0 else n MOD 10 + 2 * binary_of (n DIV 10) : thm
The following call to add_bare_numeral_form then sets up a numeral form that could be used by users wanting to deal with binary numbers:
- add_bare_numeral_form(#"b", SOME "binary_of"); > val it = () : unit - Term`1011b`; > val it = `1011b` : term - dest_comb it; > val it = (`binary_of`, `1011`) : term * term