APPARATUS FOR PERFORMING MODAL INTERVAL CALCULATIONS BASED ON DECORATION CONFIGURATION
20180217961 ยท 2018-08-02
Assignee
Inventors
Cpc classification
G06F7/483
PHYSICS
International classification
G06F7/483
PHYSICS
Abstract
Apparatus performs various modal interval computations, while accounting for various modal interval operand configurations that are not amenable to ordinary computational operations. Upon detecting an exponent field of all 1's, the apparatus adapts various conventions involving leading bits in the fraction field of the modal interval endpoints to return a result having a useful meaning.
Claims
1. Apparatus for calculating a first result modal interval dependent on a first modal interval, each said modal interval defined by first and second endpoints each comprising sign, fraction and exponent bit fields, said apparatus comprising: a) a first operand register for holding the first and second endpoints of the first modal interval, and for providing a first operand signal specifying the contents of the first modal interval endpoints' fields; b) a first analysis element for receiving the first operand signal, for creating a first truth table for the first endpoint and a second truth table for the second endpoint, each truth table including a sign bit (S) indicating the sign of the respective endpoint, a not-a-number bit (N) indicating whether the respective endpoint is Not-a-Number, an infinity bit (I) indicating whether the respective endpoint is infinity and a zero bit (Z) indicating whether the respective endpoint is zero; c) a first logic array for determining a classification from the first and second truth tables, the classification including an empty bit (E) and, optionally, a tracking decoration (T), wherein: when the first and second truth tables indicate that the first and second endpoints have the same sign and a value of infinity, the empty bit is 1 and the tracking decoration indicates an empty or non-empty restriction; when the first and second truth tables indicate that one of the first and second endpoints are not-a-number, the empty bit is 1 and the tracking decoration is the NaN decoration field from the not-a-number endpoint; when the first and second truth tables indicate that both of the first and second endpoints are not-a-number, the empty bit is 1 and the tracking decoration indicates an empty input restriction; otherwise the empty bit is 0 and the tracking decoration is not used; and, d) providing a result signal encoding the first result modal interval wherein: when the empty bit is 1, the first result modal interval is the first modal interval; and when the empty bit is 0, the first result modal interval is a result of a computation by a first computational element receiving the first operand signal and the first and second truth tables.
2. The apparatus of claim 1, wherein the first analysis element creates the first and second truth tables dependent on a preselected exponent field bit configuration in each of the first and second endpoints, and on a preselected fraction field configuration in each of the first and second endpoints.
3. The apparatus of claim 1 adapted for calculating a second result modal interval dependent on the first modal interval and on a second modal interval having the same structure as the first modal interval and having a third endpoint and a fourth endpoint, comprising: a) a second operand register for holding the third endpoint and the fourth endpoint of the second modal interval, and for providing a second operand signal specifying the contents of the second modal interval's endpoints' fields; b) a second analysis element for receiving the second operand signal, creating a third truth table for the third endpoint and a fourth truth table for the fourth endpoint; c) a second logic array for determining a classification from the third and fourth truth tables, the classification including an empty bit (E) and, optionally, a tracking decoration (T), wherein: when the third and fourth truth tables indicate that the third and fourth endpoints have the same sign and a value of infinity, the empty bit is 1 and the tracking decoration indicates an empty or non-empty restriction; when the third and fourth truth tables indicate that one of the third and fourth endpoints are not-a-number, the empty bit is 1 and the tracking decoration is the NaN decoration field from the not-a-number endpoint; when the third and fourth truth tables indicate that both of the third and fourth endpoints are not-a-number, the empty bit is 1 and the tracking decoration indicates an empty input restriction; otherwise the empty bit is and the tracking decoration is not used; d)-h) providing a result signal encoding the second result modal interval wherein: when the empty bit from the classification of the first and second truth tables is 1 and the empty bit from the classification of the third and fourth truth tables is 1, the second result modal interval is either the first modal interval or the second modal interval, whichever is associated with the tracking decoration of minimum value (see reference numeral 50); when the empty bit from the classification of the first and second truth tables is 1 and the empty bit from the classification of the third and fourth truth tables is 0, the second result modal interval is the first modal interval; when the empty bit from the classification of the first and second truth tables is 0 and the empty bit from the classification of the third and fourth truth tables is 1, the second result modal interval is the second modal interval; and when the empty bit from the classification of the first and second truth tables is 0 and the empty bit from the classification of the third and fourth truth tables is 0, the second result modal interval is a result of a computation by a second computational element receiving the first and second operands signals and the first, second, third, and fourth truth tables.
Description
DESCRIPTION OF THE FIGURES
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
DESCRIPTION OF THE INVENTION
[0064] In furtherance of disclosing important features of the present invention and distinguishing it from the references of prior art, a preliminary overview of related concepts and prior art work is in order.
Natural Domains and Continuity
[0065] In the realm of pure mathematics, operations on real numbers are functions that have a natural domain. For example, the square root of a negative real number is not defined, so the natural domain of the square root operation is the set of all non-negative real numbers. Division by zero is also not defined, so the natural domain of the reciprocal operation is the set of all non-zero real numbers. And so on for each contemplated operation. In other words, whenever the input to an operation is not an element of the natural domain of the operation, the operation is not defined.
[0066] Continuity is another important property of functions of real numbers. Formal definitions of a continuous function are well-known in the prior art and can be given in terms of sequences or limits of the function. Informally, if a function is continuous then any time a sequence converges in the domain, the image of the sequence in the range also converges. In other words, one could either take the limit first, and then apply the function, or apply the function first, and then take the limits.
[0067] Even more particularly, if : R.sup.n.fwdarw.R is a function that maps n-dimensional real vectors R.sup.n to real numbers R and D.sub..Math.R.sup.n is the natural domain of , then for any X.Math.D.sub., the property of continuity may be further defined in terms of the restriction of on X. In this case, the only relevant aspect of the continuity property is with respect to the portions of the function that are restricted to the domain X, wherein X is a subset of the natural domain D.sub. of the function. For example, consider the function floor(x): R.fwdarw.R depicted in
[0068] The restriction of a function to X can be continuous if and only if X is also a subset of the natural domain of the function. For example, the natural domain of the square root operation is the set of all non-negative real numbers. So the restriction of the square root operation to X=[16, 4] cannot be continuous because there are elements of X=[16, 4] which do not belong to the natural domain of the operation and for which the operation is not defined. In other words, X in this case is not a subset of the natural domain of the operation.
[0069] Because the empty set () is a subset of every set, it is also a subset of all natural domains of all functions. The restriction of a function to the empty set must therefore be contemplated. As it turns out, the restriction of any function to the empty set X= is always defined and continuous. This is perhaps a little counterintuitive, but nonetheless mathematically correct. Formal mathematical reasoning to prove this is well known in the prior art.
Modal Intervals
[0070] The present invention is concerned with modal interval arithmetic and modal interval analysis. In particular, the present invention is concerned with an improved system and method of detecting exceptional conditions in modal interval operations. The prior notions of a real function, the natural domain of a real function, and the restriction of a real function to a subset of the natural domain of the function are therefore lifted into the topic of modal intervals.
[0071] For the purposes of the present invention, a modal interval is defined as an ordered pair [a, b] such that a and b are real numbers or signed infinities. However, the two pairs [, ] and [+, +] are excluded. Note that no restriction ab is required.
[0072] The set-theoretic interpretation of a modal interval is defined as
Set([a, b])={xR:min(a, b)xmax(a, b)}.
and the notation x [a, b] may be used as an abbreviation for x Set([a, b]). The empty set () is not a modal interval, however Set()=.
[0073] A closed interval includes all of its limit points. Every modal interval [a, b] is a closed interval. If both a and b are real numbers, the modal interval is bounded. If a modal interval is not bounded, then at least one of the endpoints is or + and the modal interval still contains all of its limit points but not all of its endpoints. Modal intervals of the form
[, +], [, b], [a, +], [+, b], [a, ] and [+, ]
are therefore understood to be unbounded. Despite the use of square brackets, infinity is never an element of any modal interval, and
[, ] and [+, +]
are by definition not modal intervals.
[0074] A modal interval [a, b] is called proper if ab. The modal interval is called improper if ab. It is called a point or a point-wise modal interval if a=b. Note that a point-wise modal interval is also a proper and an improper modal interval at the same time.
[0075] The set of all bounded modal intervals can be visualized as points in the R.sup.2 plane, where canonical abscissa and ordinate are defined respectively as the left and right bound of a modal interval [a, b], i. e.,
([a, b])=a and ([a, b])=b.
[0076]
[0077] As of this date, the subset of bounded and unbounded proper modal intervals is the set of intervals supported in the working draft of the IEEE Standard for Interval Arithmetic. That standard is currently under development by the P1788 Working Group committee at the time of this writing and does not provide any provision for bounded or unbounded improper intervals. The present invention therefore contemplates the broadest set of intervals as it is the only one that consists of a set wherein each element of the set may be bounded or unbounded, proper or improper,
[0078] A predicate is a Boolean function, and a proposition is a predicate wherein each variable is universally () or existentially () quantified.
[0079] The modal quantifier Q of a modal interval [a, b] quantifies a real variable x by the definition
[0080] Q(x, [a, b])=if a<b then x Set([a, b]) else x Set([a, b]).
[0081] The modal operators are
Dual([a, b])=[b, a],
Prop([a, b])=[min(a, b), max(a, b)],
Impr([a, b])=[max(a, b), min(a, b)],
and the corresponding modal quantifiers D, E and U are defined as
D(x, [a, b])=Q(x, Dual([a, b])),
E(x, [a, b])=Q(x, Prop([a, b])),
U(x, [a, b])=Q(x, Impr([a, b])).
With the modal quantifiers Q, D, E and U it is possible to form propositions with modal intervals. For example, if A and B are modal intervals then the inclusion (.Math.) relation is
A.Math.BD(a, A)Q(b, B): a=b,
and the less-or-equal () relation is
ABU(a, A)E(b, B): ab and U(b, B)E(a, A): ab.
[0082]
[0083] If x is a real number, the rounding operators (x) and (x) are digital approximations of x such that the relations
(x)x and (x)x
are always true. For any modal interval [a, b],
Inn([a, b])=[(a), (b)] and Out([a, b])=[(a), (b)]
are the inner and outer digital roundings, respectively of [a, b].
[0084] The inner and outer digital roundings are universally possible for any digital scale and satisfy the property
Inn([a, b]).Math.[a, b].Math.Out([a, b])
such that the equivalence
Inn([a, b])=Dual(Out(Dual([a, b])))
makes unnecessary the implementation of the inner rounding.
Decorations and Property Tracking
[0085] A decoration is a mathematical property of a real function restricted to the domain of its modal interval inputs. Decorations provide a framework for detecting exceptional conditions such as out-of-domain arguments or non-continuous functions.
[0086] Looking at the syntactic tree for a real function, where the nodes are operators, the leaves are variables, and branches define the domain of each operator, the real function can be operationally extended to a modal interval expression by using the computational program implicitly defined by the syntactic tree of the real function. This is accomplished by transforming all of the real operators into their modal interval extension and all of the real variables into modal interval variables.
[0087]
(x, y)=y/sqrt((1x)*(1+x))
implicitly defines a modal interval expression. Real operators and variables 12 are respectively transformed into their modal interval counterparts 15. Evaluation of the expression begins at the leafs of the tree, where variables are propagated up the branches to the operations. The operations accept the variables as operands, perform an operation and generate a result. The result of each operation is then propagated up the branches into other operations until all nodes in the tree have been evaluated and a final result is propagated to the root of the tree.
[0088] The present invention makes a distinction between two types of decorations. A static decoration is the absolute mathematical truth about the restriction of an individual operation to the domain of its modal interval inputs. A tracking decoration, on the other hand, is a mathematical implication that is obtained for a modal interval expression by propagating static decorations in the expression tree up the branches and to the root. The method used to propagate static decorations through an expression tree in order to obtain a tracking decoration is called property tracking.
[0089] TABLE 1 in
[0090]
EIN.Math.DAC.Math.DEF.Math.GAPNDFEIN
Note that EIN is a subset of all tracking decorations and GAP is a superset of all tracking decorations.
[0091] For example, if is the square root operator and X=[1, 4] then for this particular (, X) pair the restriction of on X is defined and continuous. Since X is not empty, the (, X) pair cannot be an element of EIN. Additionally, the (, X) pair cannot be an element of NDF because in this case (X) is not empty, either. However, if X is the empty set then the (, X) pair is an element of EIN, and since EIN is a subset of all tracking decorations the (, X) pair is also an element of DAC, DEF, GAP and NDF.
[0092] An important note should be made regarding the prior art as it pertains to decorations. A draft of the IEEE Standard for Interval Arithmetic, which is under development at the time of this writing, contains a decoration system that was at least partially conceived by the applicant of the present invention. That decoration system has some common characteristics to the decoration system of the present invention, such as DEF and DAC decorations. However, there are some important differences, namely the absence of an EIN decoration as well as the inclusion of several other decorations not defined in the present invention such as ILL (ill-formed), COM (a common interval) and BND (a bounded interval). Applicant's white paper entitled Decorations as State Machine provides rationale why these competing decoration systems are unnecessary or insufficient for reliable interval computations and how the unique decoration system of the present invention overcomes those issues.
[0093] TABLE 2 in
[0094] For any (, X) pair, the notation S(, X) indicates which static decoration the (, X) pair is an element of as a function of TABLE 2. If has n operands, the notation S(, X) is shorthand for S(, X.sub.1, X.sub.2, . . . , X.sub.n).
[0095] If : R.sup.n.fwdarw.R is a real function and D.sub..Math.R.sup.n is the natural domain of , and if X is an n-dimensional modal interval box, then TABLE 3 in
[0096]
[0097] For example, if is the square root operation and X.sub.1=[2, 4], X.sub.2=[1, 1] and X.sub.3=[4, 2] then S(, X.sub.1)=dac because Set(X.sub.1) is a nonempty subset of D.sub. and the restriction of on X.sub.1 is continuous; S(, X.sub.2)=gap because Set(X.sub.2) is not a subset of D.sub. but the intersection of Set(X.sub.2) and D.sub. is nonempty; and S(, X.sub.3)=ndf because X.sub.3 is not empty but the intersection of Set(X.sub.3) and D.sub. is empty.
[0098] Property tracking is the method used to propagate static decorations through an expression tree in order to obtain a tracking decoration. To facilitate this method, the notion of a decorated interval is contemplated. A decorated interval is a pair (X, D) that consists of a modal interval X and a tracking decoration D. The empty set is not an interval, however the notion of a decorated empty set (, D) is also contemplated.
[0099] The method of property tracking begins with initialization. Each modal interval variable X.sub.1, X.sub.2, . . . , X.sub.n in the leafs of the expression tree is promoted to a decorated interval (X.sub.1, DAC), (X.sub.2, DAC), . . . , (X.sub.n, DAC). If any variable in a leaf of the expression tree is an empty set, then the empty variable is promoted to a decorated empty set (, EIN). Similarly, if any variable in a leaf of the expression tree is [+, +]or [, ], then the variable is promoted, respectively, to ([+, +], GAP) or ([, ], GAP).
[0100] The decorated variables are then propagated up the branches of the expression tree to the operations. The operations accept the decorated variables as operands, perform an operation and generate a decorated result. For each operation, if :R.sup.n.fwdarw.R is the real function and
(X.sub.i, D.sub.i)=((X.sub.1, D.sub.1), (X.sub.2, D.sub.2), . . . , (X.sub.n, D.sub.n)
are the decorated internal operands of , then the decorated result of the operation has the tracking decoration
T(, (X.sub.i, D.sub.i))=min{S(, X.sub.1, X.sub.2, . . . , X.sub.n), D.sub.1, D.sub.2, . . . , D.sub.n}.
[0101] In other words, the decorated result of the operation has a tracking decoration which is the minimum element of a set formed by the union of the static decoration S(, X.sub.1, X.sub.2, . . . , X.sub.n) of the operation and the decorations D.sub.1, D.sub.2, . . . , D.sub.n of the operands.
[0102] For the sake of determining the minimum element of a set of decorations, the decorations are linearly ordered
ndf/NDF<gap/GAP<def/DEF<dac/DAC<ein/EIN
[0103] The decorated result of each operation is then propagated up the branches into other operations. The procedure is repeated until all nodes in the tree have been evaluated and a final decorated result is propagated to the root of the tree.
Digital Encodings of Modal, Intervals and Decorations
[0104] Inside a computer, the endpoints of a modal interval may be represented by elements of a digital scale. In a preferred embodiment of the present invention, the digital scale conforms to the binary64 interchange format encoding of IEEE 754-2008. For the sake of discourse, only the binary64 encoding will be explained or considered in the rest of this document. However, the use of other digital scales or interchange format encodings as it pertains to the present invention should be obvious.
[0105] A binary64 floating-point datum is 64 bits of information partitioned into sign, exponent and fraction fields as shown in register 20 of
[0110] A binary64 datum may be associated with a truth table 23 consisting of a set of classification bits as depicted in
[0111] If x is a floating-point datum, then S(x), N(x), I(x) and Z(x) arc notations used in this document to represent the respective values of the Sign, NaN, Infinity and Zero classification bits of truth table 23.
[0112] If bit 51 of a NaN is set to 1, then the NaN is quiet (QNaN); otherwise the NaN is signaling (SNaN). If the NaN is signaling, at least one other fraction bit of the NaN must be set to 1 to distinguish the NaN from an infinity. The difference between a quiet and signaling NaN is for the sake of compatibility with IEEE 754-2008 standard interchange format encoding. However, the present invention does not require signaling NaN operations.
[0113] Bits 0 to 50 are the NaN payload. All bits of the payload may be set to any value so long as the entire fraction field of a NaN does not become zero. The preferred embodiment of the present invention may use bits 49 to 50 of a NaN payload as a NaN decoration field to encode a representation of a tracking decoration.
[0114] If x is a NaN, then T(x) is the representation of a tracking decoration encoded within the NaN decoration field of x as depicted in TABLE 4 of
[0115] If n is the representation of a tracking decoration, then NaN(n), QNaN(n) and SNaN(n) are notations used in this document to represent the respective encodings of a NaN, quiet NaN or signaling NaN when the bits of the decoration field are set to the corresponding value of n as depicted in TABLE 4 of
[0116] A modal interval datum [a.sub.1, a.sub.2] may be encoded into 128 bits as two binary64 datums a.sub.1 and a.sub.2 as illustrated in register 27 of
[0117] All non-interval data is an encoding of a decorated empty set.
[0118] If a.sub.1 and a.sub.2 are binary64 datums that do not represent a NaN, and if n is a representation of one of the tracking decorations DAC, DEF, GAP or NDF (see TABLE 1 in
[.sub.1, NaN(n)] or [NaN(n), .sub.2].
[0119] Any such encoding of a decorated empty set (, n) may be provided as input to an operation of the present invention, and a canonical encoding
[+0, QNaN(n)] or [QNaN(n), +0]
may be provided as a result of an operation which produces a decorated empty set as output.
[0120] Non-interval data of the form
[NaN, NaN]
is an encoding of the decorated empty set (, EIN), and non-interval data of the form
[, ] or [+, +]
is an encoding of the decorated empty set (, GAP)
[0121]
[0122] The Empty bit in
[0123] If [a.sub.1, a.sub.2] is a modal interval datum, then E(a.sub.1, a.sub.2) and T(a.sub.1, a.sub.2) are notations used in this document to represent the respective values of the Empty bit and the Tracking Decoration.
Modal Interval Operations with Decorations
[0124] The present invention provides an improved system and method for reliable and efficient modal interval operations using decorations. The preferred embodiment of the present invention is an arithmetic functional unit (AFU) as depicted in applicant's U.S. Pat. No. 7,949,700 entitled Modal Interval Processor. Modal interval operand and result signals for the AFU are digitally encoded using the methods described in the previous section of this document entitled Digital Encodings of Modal Intervals and Decorations.
[0125] As will be shown subsequently for select modal interval operations, the result of a modal interval operation is typically obtained by performing a floating-point calculation on select endpoints of the modal interval operands. Because floating-point calculations are often inexact, the present invention requires the rounding operators (x) and (x) to ensure modal interval results obey the outer digital rounding of modal intervals.
[0126]
[0127]
[0128]
[0129]
[0130]
[0131]
[0132]
[0133]
[0134]
[0135]
[0136]
[0137]
[0138]
[0139]
[0140]
[0141]
[0142]
[0143]
[0144]
[0145]
()(0)=(0)()=+0
()(+0)=(+0)()=0
(+)(0)=(0)(+)=0
(+)(0)=(+0)(+)=+0
according to applicant's U.S. Pat. No. 8,204,926 entitled Reliable and Efficient Modal Interval Arithmetic Operations. The modal interval multiplication operation is therefore always defined so long as the operands [a.sub.1, a.sub.2] and [b.sub.1, b.sub.2] are bounded or unbounded modal intervals.
[0146]
[0147]