OpenMath Content Dictionary: nums1
Canonical URL:
http://www.openmath.org/cd/nums1.ocd
CD Base:
http://www.openmath.org/cd
CD File:
nums1.ocd
CD as XML Encoded OpenMath:
nums1.omcd
Defines:
NaN , based_float , based_integer , e , gamma , i , infinity , pi , rational
Date:
2009-04-01
Version:
4
Review Date:
2014-04-01
Status:
official
This document is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The copyright holder grants you permission to redistribute this
document freely as a verbatim copy. Furthermore, the copyright
holder permits you to develop any derived work from this document
provided that the following conditions are met.
a) The derived work acknowledges the fact that it is derived from
this document, and maintains a prominent reference in the
work to the original source.
b) The fact that the derived work is not the original OpenMath
document is stated prominently in the derived work. Moreover if
both this document and the derived work are Content Dictionaries
then the derived work must include a different CDName element,
chosen so that it cannot be confused with any works adopted by
the OpenMath Society. In particular, if there is a Content
Dictionary Group whose name is, for example, `math' containing
Content Dictionaries named `math1', `math2' etc., then you should
not name a derived Content Dictionary `mathN' where N is an integer.
However you are free to name it `private_mathN' or some such. This
is because the names `mathN' may be used by the OpenMath Society
for future extensions.
c) The derived work is distributed under terms that allow the
compilation of derived works, but keep paragraphs a) and b)
intact. The simplest way to do this is to distribute the derived
work under the OpenMath license, but this is not a requirement.
If you have questions about this license please contact the OpenMath
society at http://www.openmath.org .
Author: OpenMath Consortium
SourceURL: https://github.com/OpenMath/CDs
This CD is intended to be `compatible' with the MathML view of
constructors for numbers (integers to an arbitrary base,
rationals) and symbols for some common numerical constants.
This CD holds a set of symbols for creating numbers, including
some defined constants (i.e. nullary constructors).
Role:
application
Description:
This symbol represents the constructor function for integers,
specifying the base. It takes two arguments, the first is a positive
integer to denote the base to which the number is represented, the
second argument is a string which contains an optional sign and the
digits of the integer, using 0-9a-z (as a consequence of this no radix
greater than 36 is supported). Base 16 and base 10 are already
covered in the encodings of integers.
Example:
A representation of 8 (radix 10) base 8
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd"><OMA>
<OMS cd="relation1" name="eq"/>
<OMI>8</OMI>
<OMA>
<OMS cd="nums1" name="based_integer"/>
<OMI>8</OMI>
<OMSTR>10</OMSTR>
</OMA>
</OMA></OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<cn type="integer">8</cn>
<apply><csymbol cd="nums1">based_integer</csymbol><cn type="integer">8</cn><cs>10</cs></apply>
</apply>
</math>
Prefix
Popcorn
8 = nums1.based_integer(8, "10")
Rendered Presentation MathML
Signatures:
sts
Role:
application
Description:
This symbol represents the constructor function for floating point numbers,
specifying the base. It takes two arguments, the first is a positive
integer to denote the base to which the number is represented, the
second argument is a string which contains an optional sign and the
digits of the number, using 0-9a-z and optionally a "."
(as a consequence of this no radix greater than 36 is supported).
Example:
A representation of 8.5 (radix 10) base 8
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd"><OMA>
<OMS cd="relation1" name="eq"/>
<OMF dec="8.5"/>
<OMA>
<OMS cd="nums1" name="based_float"/>
<OMI>8</OMI>
<OMSTR>10.4</OMSTR>
</OMA>
</OMA></OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<cn type="real">8.5</cn>
<apply><csymbol cd="nums1">based_float</csymbol><cn type="integer">8</cn><cs>10.4</cs></apply>
</apply>
</math>
Prefix
Popcorn
8.5 = nums1.based_float(8, "10.4")
Rendered Presentation MathML
Signatures:
sts
Role:
application
Description:
This symbol represents the constructor function for rational numbers.
It takes two arguments, the first is an integer p to denote the
numerator and the second a nonzero integer q to denote the denominator
of the rational p/q.
Example:
A representation of the rational number 1/2
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd"><OMA>
<OMS cd="nums1" name="rational"/>
<OMI>1</OMI>
<OMI>2</OMI>
</OMA></OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="nums1">rational</csymbol>
<cn type="integer">1</cn>
<cn type="integer">2</cn>
</apply>
</math>
Prefix
Rendered Presentation MathML
Signatures:
sts
Role:
constant
Description:
A symbol to represent the notion of infinity.
Commented Mathematical property (CMP):
if x is a real number then x < infinity
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="logic1" name="implies"/>
<OMA>
<OMS cd="set1" name="in"/>
<OMV name="x"/>
<OMS cd="setname1" name="R"/>
</OMA>
<OMA>
<OMS cd="relation1" name="lt"/>
<OMV name="x"/>
<OMS cd="nums1" name="infinity"/>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="logic1">implies</csymbol>
<apply><csymbol cd="set1">in</csymbol><ci>x</ci><csymbol cd="setname1">R</csymbol></apply>
<apply><csymbol cd="relation1">lt</csymbol><ci>x</ci><csymbol cd="nums1">infinity</csymbol></apply>
</apply>
</math>
Prefix
Popcorn
set1.in($x, setname1.R) ==> $x < nums1.infinity
Rendered Presentation MathML
Signatures:
sts
Role:
constant
Description:
This symbol represents the base of the natural logarithm, approximately 2.718.
See Abramowitz and Stegun, Handbook of Mathematical Functions,
section 4.1.
Commented Mathematical property (CMP):
e = the sum as j ranges from 0 to infinity of 1/(j!)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMS cd="nums1" name="e"/>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="zero"/>
<OMS cd="nums1" name="infinity"/>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="j"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMS cd="alg1" name="one"/>
<OMA>
<OMS cd="integer1" name="factorial"/>
<OMV name="j"/>
</OMA>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<csymbol cd="nums1">e</csymbol>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<csymbol cd="alg1">zero</csymbol>
<csymbol cd="nums1">infinity</csymbol>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>j</ci></bvar>
<apply><csymbol cd="arith1">divide</csymbol>
<csymbol cd="alg1">one</csymbol>
<apply><csymbol cd="integer1">factorial</csymbol><ci>j</ci></apply>
</apply>
</bind>
</apply>
</apply>
</math>
Prefix
Popcorn
nums1.e = arith1.sum(interval1.integer_interval(alg1.zero, nums1.infinity), fns1.lambda[$j -> alg1.one / integer1.factorial($j)])
Rendered Presentation MathML
Example:
2.718 = The decimal approximation to 3 significant places of e
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="approx"/>
<OMF dec="2.718"/>
<OMS cd="nums1" name="e"/>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">approx</csymbol>
<cn type="real">2.718</cn>
<csymbol cd="nums1">e</csymbol>
</apply>
</math>
Prefix
Popcorn
relation1.approx(2.718, nums1.e)
Rendered Presentation MathML
Signatures:
sts
Role:
constant
Description:
This symbol represents the square root of -1.
Commented Mathematical property (CMP):
i^2 = -1
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMA>
<OMS cd="arith1" name="power"/>
<OMS cd="nums1" name="i"/>
<OMI>2</OMI>
</OMA>
<OMA>
<OMS cd="arith1" name="unary_minus"/>
<OMS cd="alg1" name="one"/>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="arith1">power</csymbol>
<csymbol cd="nums1">i</csymbol>
<cn type="integer">2</cn>
</apply>
<apply><csymbol cd="arith1">unary_minus</csymbol><csymbol cd="alg1">one</csymbol></apply>
</apply>
</math>
Prefix
Popcorn
nums1.i ^ 2 = -(alg1.one)
Rendered Presentation MathML
Signatures:
sts
[Next: pi ]
[Previous: e ]
[Top ]
Role:
constant
Description:
A symbol to convey the notion of pi, approximately 3.142.
The ratio of the circumference of a circle to its diameter.
Commented Mathematical property (CMP):
pi = 4 * the sum as j ranges from 0 to infinity of ((1/(4j+1))-(1/(4j+3)))
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMS cd="nums1" name="pi"/>
<OMA>
<OMS cd="arith1" name="times"/>
<OMI>4</OMI>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="zero"/>
<OMS cd="nums1" name="infinity"/>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="j"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMS cd="alg1" name="one"/>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA>
<OMS cd="arith1" name="times"/>
<OMI>4</OMI>
<OMV name="j"/>
</OMA>
<OMS cd="alg1" name="one"/>
</OMA>
</OMA>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMS cd="alg1" name="one"/>
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA>
<OMS cd="arith1" name="times"/>
<OMI>4</OMI>
<OMV name="j"/>
</OMA>
<OMI>3</OMI>
</OMA>
</OMA>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<csymbol cd="nums1">pi</csymbol>
<apply><csymbol cd="arith1">times</csymbol>
<cn type="integer">4</cn>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<csymbol cd="alg1">zero</csymbol>
<csymbol cd="nums1">infinity</csymbol>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>j</ci></bvar>
<apply><csymbol cd="arith1">minus</csymbol>
<apply><csymbol cd="arith1">divide</csymbol>
<csymbol cd="alg1">one</csymbol>
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="arith1">times</csymbol><cn type="integer">4</cn><ci>j</ci></apply>
<csymbol cd="alg1">one</csymbol>
</apply>
</apply>
<apply><csymbol cd="arith1">divide</csymbol>
<csymbol cd="alg1">one</csymbol>
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="arith1">times</csymbol><cn type="integer">4</cn><ci>j</ci></apply>
<cn type="integer">3</cn>
</apply>
</apply>
</apply>
</bind>
</apply>
</apply>
</apply>
</math>
Prefix
eq
(
pi ,
times
(4,
sum
(
integer_interval
(
zero ,
infinity )
,
lambda
[
j
] .
(
minus
(
divide
(
one ,
plus
(
times
(4,
j )
,
one )
)
,
divide
(
one ,
plus
(
times
(4,
j )
, 3)
)
)
)
)
)
)
Popcorn
nums1.pi = 4 * arith1.sum(interval1.integer_interval(alg1.zero, nums1.infinity), fns1.lambda[$j -> alg1.one / (4 * $j + alg1.one) - alg1.one / (4 * $j + 3)])
Rendered Presentation MathML
π
=
4
∑
j
=
0
∞
1
4
j
+
1
-
1
4
j
+
3
Example:
3.142 = The decimal approximation to 3 significant places of pi
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="approx"/>
<OMF dec="3.142"/>
<OMS cd="nums1" name="pi"/>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">approx</csymbol>
<cn type="real">3.142</cn>
<csymbol cd="nums1">pi</csymbol>
</apply>
</math>
Prefix
Popcorn
relation1.approx(3.142, nums1.pi)
Rendered Presentation MathML
Signatures:
sts
Role:
constant
Description:
A symbol to convey the notion of the gamma constant
as defined in Abramowitz and Stegun, Handbook of Mathematical
Functions, section 6.1.3. It is the limit of
1 + 1/2 + 1/3 + ... + 1/m - ln m
as m tends to infinity, this is approximately 0.5772 15664.
Commented Mathematical property (CMP):
gamma = limit_(m -> infinity)(sum_(j ranges from 1 to m)(1/j) - ln m)
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="eq"/>
<OMS cd="nums1" name="gamma"/>
<OMA>
<OMS cd="limit1" name="limit"/>
<OMS cd="nums1" name="infinity"/>
<OMS cd="limit1" name="below"/>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="m"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="minus"/>
<OMA>
<OMS cd="arith1" name="sum"/>
<OMA>
<OMS cd="interval1" name="integer_interval"/>
<OMS cd="alg1" name="one"/>
<OMV name="m"/>
</OMA>
<OMBIND>
<OMS cd="fns1" name="lambda"/>
<OMBVAR>
<OMV name="j"/>
</OMBVAR>
<OMA>
<OMS cd="arith1" name="divide"/>
<OMI>1</OMI>
<OMV name="j"/>
</OMA>
</OMBIND>
</OMA>
<OMA>
<OMS cd="transc1" name="ln"/>
<OMV name="m"/>
</OMA>
</OMA>
</OMBIND>
</OMA>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">eq</csymbol>
<csymbol cd="nums1">gamma</csymbol>
<apply><csymbol cd="limit1">limit</csymbol>
<csymbol cd="nums1">infinity</csymbol>
<csymbol cd="limit1">below</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>m</ci></bvar>
<apply><csymbol cd="arith1">minus</csymbol>
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol><csymbol cd="alg1">one</csymbol><ci>m</ci></apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>j</ci></bvar>
<apply><csymbol cd="arith1">divide</csymbol><cn type="integer">1</cn><ci>j</ci></apply>
</bind>
</apply>
<apply><csymbol cd="transc1">ln</csymbol><ci>m</ci></apply>
</apply>
</bind>
</apply>
</apply>
</math>
Prefix
Popcorn
nums1.gamma = limit1.limit(nums1.infinity, limit1.below, fns1.lambda[$m -> arith1.sum(interval1.integer_interval(alg1.one, $m), fns1.lambda[$j -> 1 / $j]) - ln($m)])
Rendered Presentation MathML
γ
=
limit
m
→
∞
-
∑
j
=
1
m
1
j
-
ln
(
m
)
Example:
0.577 = The decimal approximation to 3 significant places of gamma
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="approx"/>
<OMF dec="0.577"/>
<OMS cd="nums1" name="gamma"/>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">approx</csymbol>
<cn type="real">0.577</cn>
<csymbol cd="nums1">gamma</csymbol>
</apply>
</math>
Prefix
Popcorn
relation1.approx(0.577, nums1.gamma)
Rendered Presentation MathML
Signatures:
sts
Role:
constant
Description:
A symbol to convey the notion of not-a-number.
The result of an ill-posed floating computation.
See IEEE standard for floating point representations.
Commented Mathematical property (CMP):
NaN is not equal to NaN
Formal Mathematical property (FMP):
OpenMath XML (source)
<OMOBJ xmlns="http://www.openmath.org/OpenMath" version="2.0" cdbase="http://www.openmath.org/cd">
<OMA>
<OMS cd="relation1" name="neq"/>
<OMS cd="nums1" name="NaN"/>
<OMS cd="nums1" name="NaN"/>
</OMA>
</OMOBJ>
Strict Content MathML
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply><csymbol cd="relation1">neq</csymbol>
<csymbol cd="nums1">NaN</csymbol>
<csymbol cd="nums1">NaN</csymbol>
</apply>
</math>
Prefix
Popcorn
nums1.NaN != nums1.NaN
Rendered Presentation MathML
Signatures:
sts