package coq-core

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t
val equal : t -> t -> bool
val is_nat : t -> bool
val to_nat : t -> string option
val sprint : t -> string
val print : t -> Pp.t

sprint and print returns the number as it was parsed, for printing

val parse : char Gramlib.Stream.t -> t

Parse a positive Coq number. Precondition: the first char on the stream is already known to be a digit ([0-9]). Precondition: at least two extra chars after the number to parse.

The recognized syntax is:

  • integer part: [0-9][0-9_]*
  • fractional part: empty or .[0-9_]+
  • exponent part: empty or [eE][+-]?[0-9][0-9_]* or
  • integer part: 0[xX][0-9a-fA-F][0-9a-fA-F_]*
  • fractional part: empty or .[0-9a-fA-F_]+
  • exponent part: empty or [pP][+-]?[0-9][0-9_]*
val parse_string : string -> t option

Parse the string as a non negative Coq number, if possible

val classify : t -> num_class
OCaml

Innovation. Community. Security.