Patent ID: 7240331

Claim:
A computer-implemented method of operating a computer system for evaluating a programming language statement to achieve a data transformation of a document data structure, the programming language statement including first and second sub-statements that provide a common framework to define both imperative and declarative statements providing an intermediate level of abstraction that enables concise declarative notation while preserving low level imperative specifications through bi-valuation, the method comprising: inputting a computer-readable arbitrary complex data structure representing an expression of a document data structure; inputting the programming language statement, including the first and second sub-statements, that acts on the document data structure to transform the document data structure into a transformed representation of the document, one of the first and second sub-statements being a declarative statement and the other being an imperative statement; evaluating the first sub-statement as a first evaluation to determine a first evaluation success result if the first evaluation succeeds or else designating a distinguished value if the first evaluation fails, said distinguished value being a value not included in a first range of possible evaluation success results of the first sub-statement; determining whether to evaluate the second sub-statement as a second evaluation, and if so, evaluating the second sub-statement to determine a second evaluation success result if the second evaluation succeeds or else designating said distinguished value if the second evaluation fails, a second range of possible evaluation success results of the second sub-statement not including said distinguished value; determining an evaluation result of the statement depending on at least whether the first evaluation of the first sub-statement succeeds or fails; wherein the first evaluation success result of the first sub-statement and the second evaluation success result of the second sub-statement belong to a first type in a set of types and the distinguished value belongs to a second type not in the set of types, wherein each type in the set of types is not a supertype of the second type; and wherein the first type in the set of types comprises one from the set of integer, float, Boolean, sequence, tuple, structure, multi-set, dictionary, string and enumeration; and outputting the evaluation results of the programming language statement as a structured transformation of the document data structure that is stored on a computer-readable medium to solve the expression expressed in the arbitrary complex data structure.