Semantics of MML Query - Ordering

Summary Semantics of order directives of MML Query is presented. The formalization is done according to [1]


Preliminaries
In this paper X denotes a set, R, R 1 , R 2 denote binary relations, x, y, z denote sets, and n, m, k denote natural numbers.
Let us consider binary relation R on X.Now we state the propositions: (1) field R ⊆ X.
(2) If x, y ∈ R, then x, y ∈ X.Now we state the propositions: (3) Let us consider sets X, Y .Then (id X ) • Y = X ∩ Y .(4) x, y ∈ R | 2 X if and only if x, y ∈ X and x, y ∈ R.
(5) dom(X R) ⊆ dom R. (6) Let us consider a total reflexive binary relation R on X and a subset S of X.Then R | 2 S is a total reflexive binary relation on S. The theorem is the consequence of (4).Proof: Let us consider R. Let us note that R is transitive if and only if the condition (Def. 1) is satisfied.grzegorz bancerek One can verify that R is antisymmetric if and only if the condition (Def.2) is satisfied.
(Def. 2) If x, y ∈ R and y, x ∈ R, then x = y.Now we state the proposition: (8) Let us consider a non empty set X, a total connected binary relation R on X, and elements x, y of X.Then if x = y, then x, y ∈ R or y, x ∈ R.

Composition of Orders
Let R 1 , R 2 be binary relations.The functor R 1 , R 2 yielding a binary relation is defined by the term Now we state the propositions: The theorem is the consequence of (9).
The theorem is the consequence of (9).
Let X be a set and R 1 , R 2 be binary relations on X.Note that the functor R 1 , R 2 yields a binary relation on X.Let R 1 , R 2 be reflexive binary relations.One can verify that R 1 , R 2 is reflexive.
Let R 1 , R 2 be antisymmetric binary relations.Note that R 1 , R 2 is antisymmetric.
Let X be a set and R be a binary relation on X.We say that R is β-transitive if and only if (Def.4) Let us consider elements x, y of X.Then if x, y ∈ R, then for every element z of X such that x, z ∈ R holds y, z ∈ R.
Observe that every binary relation on X which is connected total and transitive is also β-transitive.
Let us observe that there exists an order in X which is connected.
Let R 1 be a β-transitive transitive binary relation on X and R 2 be a transitive binary relation on X. Observe that R 1 , R 2 is transitive.
Let R 1 be a binary relation on X and R 2 be a total reflexive binary relation on X.Let us note that R 1 , R 2 is total and reflexive as a binary relation on X.
Let R 2 be a total connected reflexive binary relation on X.One can verify that R 1 , R 2 is connected.Now we state the propositions: The theorem is the consequence of ( 9).
(13) Let us consider a connected reflexive total binary relation R on X and a binary relation R 2 on X.Then R , R 2 = R.The theorem is the consequence of ( 9) and (2).

number of Ordering
Let X be a set and f be a function from X into N.The functor number of f yielding a binary relation on X is defined by (Def.5) x, y ∈ it if and only if x, y ∈ X and f (x) < f (y).
Let us note that number of f is antisymmetric transitive and β-transitive.
Let X be a finite set and O be an operation of X.The functor value of O yielding a function from X into N is defined by

Ordering by Resources
Let A be a finite sequence and x be an element.The functor A ← x yielding a set is defined by the term (Def.8) (A −1 ({x})).Let us consider x.Note that A ← x is natural.Let us consider finite sequence A. Now we state the propositions: Let us consider X.Let A be a finite sequence and f be a function.The functor resource(X, A, f ) yielding a binary relation on X is defined by (Def.9) x, y ∈ it if and only if x, y ∈ X and A ← (f (x)) = 0 and A ← (f (x)) < A ← (f (y)) or A ← (f (y)) = 0. Let us observe that resource(X, A, f ) is antisymmetric transitive and βtransitive.grzegorz bancerek

Ordering by Number of Iteration
Let us consider X.Let R be a binary relation on X and n be a natural number.One can check that the functor R n yields a binary relation on X.Now we state the propositions: If for every n, (R n ) • X = ∅ and X is finite, then there exists x such that x ∈ X and for every n, (R n ) • x = ∅.The theorem is the consequence of (18).Proof: Define P[element, element] ≡ there exists n such that $ 2 = n and (R n ) • $ 1 = ∅.For every element x such that x ∈ X there exists an element y such that y ∈ N and P[x, y].Consider f being a function such that dom f = X and rng f ⊆ N and for every element x such that x ∈ X holds P[x, f (x)].Consider n such that rng f ⊆ Z n .{{x} where x is an element of X : x ∈ X} ⊆ 2 X .Reconsider Y = {{x} where x is an element of X : x ∈ X} as a family of subsets of X. X = Y .{(R n ) • y where y is a subset of X : y ∈ Y } ⊆ {∅}.(20) If R is reversely well founded and irreflexive and X is finite and R is finite, then there exists n such that (R n ) • X = ∅.The theorem is the consequence of (19).Let us note that every binary relation which is empty is also irreflexive and reversely well founded.
Let us consider X.Let us note that there exists an operation of X which is empty.
Let O be a reversely well founded irreflexive finite operation of X.One can check that iteration of O is antisymmetric transitive and β-transitive.

(Def. 6 )
Let us consider an element x of X.Then it(x) = x(O).Now we state the proposition: (14) Let us consider a finite set X, an operation O of X, and elements x, y of X.Then x, y ∈ number of value of O if and only if x(O) < y(O).Let us consider X.Let O be an operation of X.The functor first O yielding a binary relation on X is defined by (Def.7) Let us consider elements x, y of X.Then x, y ∈ it if and only if x(O) = ∅ and y(O) = ∅.Let us observe that first O is antisymmetric transitive and β-transitive.
For every natural number n and for every set x, there exists a set y such that P[n, x, y].Consider f being a function such that dom f = N and f (0) = x0 and for every natural number n,P[n, f (n), f (n + 1)].Define R[natural number] ≡ Q[f ($ 1 )].rng f ⊆ field R.Consider z being an element such that z ∈ rng f and for every element x such that x ∈ rng f and z = x holds z, x ∈ R. Consider y being an element such that y ∈ N and z = f (y).Let us consider X.Let O be an operation of X. Assume O is reversely well founded, irreflexive, and finite.The functor iteration of O yielding a binary relation on X is defined by (Def.10) There exists a function f from X into N such that (i) it = number of f , and (ii) for every element x of X such that x ∈ X there exists n such that f (x) = n and x(O n ) = ∅ or n = 0 and x(O n ) = ∅ and x(O n+1 ) = ∅.