File: is_ratconst.doc

package info (click to toggle)
hol-light 20131026-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,264 kB
  • ctags: 4,620
  • sloc: ml: 400,325; cpp: 438; java: 279; lisp: 261; makefile: 256; sh: 190; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (29 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
\DOC is_ratconst

\TYPE {is_ratconst : term -> bool}

\SYNOPSIS
Tests if a term is a canonical rational literal of type {:real}.

\DESCRIBE
The call {is_ratconst t} tests whether the term {t} is a canonical rational
literal of type {:real}. This means an integer literal {&n} for numeral {n},
{-- &n} for a nonzero numeral {n}, or a ratio {&p / &q} or {-- &p / &q} where 
{p} is nonzero, {q > 1} and {p} and {q} share no common factor. If so, 
{is_ratconst} returns {true}, and otherwise {false}.

\FAILURE
Never fails.

\EXAMPLE
{
  # is_ratconst `&22 / &7`;;
  val it : bool = true
  # is_ratconst `&4 / &2`;;
  val it : bool = false
}

\SEEALSO
is_realintconst, rat_of_term, REAL_RAT_REDUCE_CONV, term_of_rat.

\ENDDOC