<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>On the Kleene Algebra of Partial Predicates with Predicate Complement</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ievgen Ivanov</string-name>
          <email>ivanov.eugen@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mykola Nikitchenko[</string-name>
          <email>nikitchenko@unicyb.kiev.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Taras Shevchenko National University of Kyiv</institution>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In the paper we investigate the question of expressibility of partial predicates in the Kleene algebra extended with the composition of predicate complement and give a necessary and suficient condition of this expressibility in terms of the existence of an optimal solution of an optimization problem. The obtained results may be useful for development of (semi-)automatic deduction tools for an extension of the Floyd-Hoare logic for the case of partial pre- and postconditions.</p>
      </abstract>
      <kwd-group>
        <kwd>Formal methods</kwd>
        <kwd>software verification</kwd>
        <kwd>partial predicate</kwd>
        <kwd>Floyd-Hoare logic</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Floyd-Hoare logic [1, 2] is a logic which is useful for proving partial correctness
of sequential programs. It is based on properties of triples (assertions) of the
p f {q}, where f is a program and p, q are predicates which specify
preform { }
and post-conditions. An assertion of this kind means that if the program’s input
d satisfies the pre-condition p, and the program terminates on d, the program’s
output satisfies the post-condition q. In the classical Floyd-Hoare logic the
program is allowed to be non-terminating (or have an undefined result of execution),
but the pre- and postconditions are assumed to be always defined (have a well
defined truth value). In the presence of pre- and postconditions defined by
partial predicates (which can be undefined on some data) the inference rules (in
particular, the sequence rule) of the classical Floyd-Hoare logic become unsound
p f {q} is understood in the following way: if a
precondi[13, 14], when a triple { }
tion p is defined and true on the program’s input, and the program f terminates
with a result y, and the postcondition q is defined on y, then q is true on y.</p>
      <p>In the previous works [15, 3, 4, 10, 12, 11, 8] we investigated an inference
system for an extension of Floyd-Hoare logic which remains sound in the case of
partial pre- and postconditions, assuming the above mentioned interpretation of
Floyd-Hoare triples. The formulations of the rules of this inference system,
however, require introduction of a new composition into the logical language used
to express pre- and postconditions. Whereas the formulation of the rules of the
classical Floyd-Hoare logic depends on the usual boolean compositions (¬, ∧)
of pre- and postcondition predicates (which are assumed to be total), the
mentioned extension depends on the compositions of negation (¬) and conjunction
(∧) of partial predicates defined in accordance with the tables of Kleene’s strong
3-valued logic, and on one additional unary composition of partial predicates
which we call the composition of predicate complement and denote as ∼. This
composition extends the signature of the Kleene algebra of partial predicates [9].
In this paper we investigate the question of expressibility of partial predicates
in the Kleene algebra extended with the composition of predicate complement
and give a necessary and suficient condition of this expressibility in terms of the
existence of an optimal solution of a special constrained optimization problem.
The obtained results may be useful for development of (semi-)automatic
deduction tools for the mentioned extension of the Floyd-Hoare logic for the case of
partial pre- and postconditions.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Notation</title>
      <p>We will use the following notation. The notation f : A→˜ B means that f is a
partial function on a set A with values in a set B, and f : A → B means that f
is a total function from A to B. For a function f : A→˜ B:
– f (x) ↓ means that f is defined on x;
– f (x) ↓= y means that f is defined on x and f (x) = y;
– f (x) ↑ means that f is undefined on x;
– dom(f ) = {x ∈ A | f (x) ↓} is the domain of a function.</p>
      <p>We will denote as f1(x1) ∼= f2(x2) the strong equality, i.e. f1(x1) ↓ if and
only if f2(x2) ↓, and if f1(x1) ↓, then f1(x1) = f2(x2).</p>
      <p>The symbols T, F will denote the “true” and ”false” values of predicates.</p>
      <p>We will denote Bool = {T, F }. The symbol ⊥ will denote a nowhere defined
partial predicate.</p>
      <p>Let D 6= ∅ be a set, and P0, P1, ... Pn be partial predicates on D.</p>
      <p>Let AP rP1,...,Pn (D) = (D→˜ {T, F }; ∨, ∧, ¬, ∼, P1, P2, ..., Pn) be an algebra
of partial predicates with constants P1, ..., Pn, where
1. ∨, ∧, ¬ are the operations of disjunction, conjunction and negation on partial
predicates defined in accordance with Kleene’s strong three-valued logic as
follows:</p>
      <p>T, if P (d) ↓= T or Q(d) ↓= T ;
(P ∨ Q)(d) = F, if P (d) ↓= F and Q(d) ↓= F ;
undefined in other cases .</p>
      <p>T, if P (d) ↓= T and Q(d) ↓= T ;
(P ∧ Q)(d) = F, if P (d) ↓= F or Q(d) ↓= F ;
undefined in other cases .</p>
      <p>T, if P (d) ↓= F ;
(¬P )(d) = F, if P (d) ↓= T ;</p>
      <p>undefined in other case .
2. ∼ is the unary operation of predicate complement:
(∼ P )(d) =
(T,</p>
      <p>if P (d) ↑;
undefined , if P (d) ↓ .</p>
      <p>We will call AP rP1,...,Pn (D) the Kleene algebra of partial predicates on D
with predicate complement and constants P1, ..., Pn.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Main Result</title>
      <p>Let F (n) be the set of all n-ary functions (operations) f : {−1, 0, 1}n → {−1, 0, 1}.
The elements of F (n) will represent functions of 3-valued logic P3 (where 1
corresponds to the “true” value and −1 corresponds to the “false” value, and 0 is
an intermediate truth value).</p>
      <p>Let F = Sn≥0 F (n).</p>
      <p>We will denote as xˉ = (x1, x2, ..., xn) a tuple of values xi ∈ {−1, 0, 1}.
Let us consider {−1, 0, 1}n as a metric space with Chebyshev distance:
n
ρn((x1, ..., xn), (y1, ..., yn)) = mi=a1x |xi − yi|.</p>
      <p>We will say that a function f ∈ F (n) is short, if it is a short map, i.e. if for
all xˉ, yˉ we have</p>
      <p>|f (xˉ) − f (yˉ)| ≤ ρn(xˉ, yˉ).</p>
      <p>For any predicate P : D →˜{T, F } denote by Φ(P ) a function D → {−1, 0, 1}
such that for all d ∈ D:</p>
      <p>1, if P (d) ↓= T,
Φ(P )(d) = 0, if P (d) ↑,

−1, if P (d) ↓= F.</p>
      <p>Let D 6= ∅ be a set, P1, P2, ..., Pn : D→˜ {T, F } be partial predicates, and</p>
      <p>AP rP1,...,Pn (D) = (D→˜ {T, F }; ∨, ∧, ¬, ∼, P1, P2, ..., Pn).</p>
      <p>Let pi = Φ(Pi) for i = 0, 1, 2, ..., n.</p>
      <p>Denote ||f || = Pxˉ∈{−1,0,1}n |f (xˉ)| for f ∈ F (n) and consider the following
(constrained) optimization problem1:</p>
      <p>
        ||f || → min
f (p1(d), p2(d), ..., pn(d)) = p0(d), d ∈ D
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
Theorem 1. If n ≥ 1, a predicate P0 is expressible in the algebra AP rP1,...,Pn (D)
if and only if on the set F (n) the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution which
is a short function.
1 If one interprets partiality in terms as possibility, minimization of ||f || may be related
to the principle of minimum specificity of D. Dubois et al. from possibility theory,
or other similar principles.
Denote for all x,y ∈ {−1,0,1}:
      </p>
      <p>¬x = −x
∼ x = 1 − |x|
x[y] = 
x,</p>
      <p>if y = 1
∼ x, if y = 0
¬x, if y = −1
Lemma 1. ρn(xˉ, yˉ) = 1 − minin=1 xi[yi] for every n ≥ 1 and xˉ, yˉ ∈ {−1,0,1}n.
Proof. It is easy to see that for all x,y ∈ {−1,0,1}:
Then ρn(xˉ, yˉ) = maxin=1 |xi − yi| = maxin=1(1 − x[iyi]) = 1 − minin=1 x[iyi].
tu
Consider {−1,0,1} as a lattice with operations:
x[y] = 1 − |x − y|
x ∨ y = max(x,y);
x ∧ y = min(x,y).</p>
      <p>Below we will assume that in expressions involving operations on {−1,0,1}
the operation x[y] has the highest priority, and is followed (by priority) by the
usual, among ∧,∨, the operation ∧ has higher priority.
unary operations ¬, ∼</p>
      <p>, which are followed by the binary operations ∧ and ∨. As
Lemma 2. For each short function f ∈ F(n) and xˉ ∈ {−1,0,1}n:
f(xˉ) = fˆ(xˉ) ∧ f6=0(xˉ) ∨ ¬f6=0(xˉ)
(Wyˉ:f(yˉ)=1 Vin=1 x[iyi], if ∃yˉ f(yˉ) = 1
otherwise
f6=0(xˉ) =</p>
      <p>0,
Proof. It is easy to see that for each x,y ∈ {−1,0,1}:
(Wyˉ:f(yˉ)6=0 Vin=1 ∼ (x[iyi]∧ ∼ x[iyi])∧ ∼∼ x[iyi], if ∃yˉ f(yˉ) 6= 0 .
otherwise.
where
Then
∼ (x[y]∧ ∼ x[y])∧ ∼∼ x[y] = (1, if x = y</p>
      <p>0, if x 6= y.
f6=0(xˉ) =
(1, if f(xˉ) 6= 0</p>
      <p>0, if f(xˉ) = 0.</p>
      <p>By Lemma 1,
fˆ(xˉ) ∧ f6=0(xˉ) ∨ ¬f6=0(xˉ) = (fˆ(xˉ) ∧ 0) ∨ 0 = 0.</p>
      <p>If f (xˉ) = 1, then fˆ(xˉ) = 1 and f6=0(xˉ) = 1, so fˆ(xˉ) ∧ f6=0(xˉ) ∨ ¬f6=0(xˉ) = 1.</p>
      <p>Thus
so fˆ(xˉ) ∧ f6=0(xˉ) ∨ ¬f6=0(xˉ) = −1.</p>
      <p>If f (xˉ) = −1, then for each yˉ such that f (yˉ) = 1 we have ρn(xˉ, yˉ) ≥ |f (xˉ) −
f (yˉ)| = 2 which implies that 1−ρn(xˉ, yˉ) = −1. Then fˆ(xˉ) = −1 and f6=0(xˉ) = 1,
f4(x, y) = min(x, y).</p>
      <p>
        Lemma 3. The set of all short functions from F is a precomplete class in F and
is the functional closure of the set {f0, f1, f2, f3, f4}, where f0 ∈ F (0), f1, f2 ∈
F (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ), f3, f4 ∈ F (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) and f0 = 0, f1(x) = −x, f2(x) = 1−|x|, f3(x, y) = max(x, y),
Proof. Denote by S the set of all short functions from F . In accordance with
its definition, a short function from
      </p>
      <p>F can be alternatively characterized as a
of the sets Qn
function {−1, 0, 1}n
i=1{0, ai}, where a1, ..., an ∈ {−1, 1}n. In the terminology of [18],
→ {−1, 0, 1} (n ≥ 0) which does not change sign on each</p>
      <p>f (xˉ) = fˆ(xˉ) ∧ f6=0(xˉ) ∨ ¬f6=0(xˉ).</p>
      <p>Lemma 4. For each P, Q : D→˜ {T, F } and d ∈ D we have:
{f0, f1, f2, f3, f4} ⊆</p>
      <p>S. On the other hand, since the constant function with
Thus S is the functional closure of {f0, f1, f2, f3, f4}.
value −1 is expressible as f1 ◦ f2 ◦ f0, from Lemma 2 and the definition of
it follows that each f ∈ S can be expressed as a composition of elements of
such functions correspond to the precomplete class T 3
the image of the product of sets, 1-equivalent to E1 is a subset of a set,
1equivalent to E1, where two sets are 1-equivalent, if their symmetric diference
has no more than 1 element. Thus S is a precomplete class in F . Obviously,
E1,1 of functions for which
Φ(⊥)(d) = 0
Φ(¬P )(d) = −(Φ(P )(d))
Φ(∼ P )(d) = 1 − |Φ(P )(d)|
Φ(P ∨ Q)(d) = max(Φ(P )(d), Φ(Q)(d))
Φ(P ∧ Q)(d) = min(Φ(P )(d), Φ(Q)(d))
partial predicates.</p>
      <p>
        Proof. Follows immediately from the definition Φ and operations ¬, ∼, ∨, ∧ on
Let M (n) be the set of all short functions from F (n).
tu
tu
Lemma 5. The problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution on F (n) if and only
if p0 is continuous in the initial topology on D induced by p1, ..., pn (where the
codomain of pi, {−1, 0, 1}, is considered as a discrete space).
solution on F (n).
      </p>
      <p>
        Proof. “If”: assume that p0 is continuous in the initial topology on D induced
by p1, ..., pn. Then there exists f ∈ F (n) such that p0(d) = f (p1(d), ..., pn(d)) for
all d ∈ D. Then since the set F (n) is finite, the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal
topology on D induced by p1, ..., pn.
      </p>
      <p>
        “Only if”: assume that the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution f ∈ F (n).
Then p0(d) = f (p1(d), ..., pn(d)) for all d ∈ D, so p0 is continuous in the initial
Lemma 6. If the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution on F (n), then this
this solution is unique.
      </p>
      <p>Then g ∈ M (n).</p>
      <p>Lemma 7. Let f ∈ M (n), g ∈ F (n) and g(xˉ) ∈ {f (xˉ), 0} for each xˉ ∈ {−1, 0, 1}n.
|g(xˉ) − g(yˉ)| = 0 ≤ ρ(xˉ, yˉ), if xˉ = yˉ.
|g(xˉ) − g(yˉ)| = 0 ≤ ρ(xˉ, yˉ), if xˉ = yˉ.</p>
      <p>Thus g ∈ M (n).</p>
      <p>4) g(xˉ) = 0, g(yˉ) = 0. Then |g(xˉ) − g(yˉ)| ≤ ρ(xˉ, yˉ).
that f (xˉ∗) 6= g(xˉ∗).</p>
      <p>
        Proof. Assume that the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has optimal solutions f, g ∈ F (n). Then
||f || = ||g|| and f (p1(d), ..., pn(d)) = p0(d) = g(p1(d), ..., pn(d)) for all d ∈ D.
      </p>
      <p>
        Suppose that f 6= g. Then there exists xˉ∗ = (x1∗, ..., x∗n) ∈ {−1, 0, 1}n such
solution of (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ).
      </p>
      <p>
        Consider the case when f (xˉ∗) 6= 0. Let us define a function
follows: h(xˉ) = f (xˉ), if xˉ 6= xˉ∗, and h(xˉ) = 0, if xˉ = xˉ∗. Then for all d ∈ D,
(p1(d), ..., pn(d)) 6= xˉ∗, so h(p1(d), ..., pn(d)) = p0(d). Moreover, ||h|| = ||f || −
|f (xˉ∗)| = ||f || − 1 &lt; ||f || which contradicts the assumption that f is an optimal
h ∈ F (n) as
tu
tu
tu
is an optimal solution of (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ).
      </p>
      <p>Consider the case when f (xˉ∗) = 0. Then |g(xˉ∗)| = 1. Let us define a function
h ∈ F (n) as follows: h(xˉ) = g(xˉ), if xˉ 6= xˉ∗, and h(xˉ) = 0, if xˉ = xˉ∗. Then
for all d ∈ D, (p1(d), ..., pn(d)) 6= xˉ∗, so h(p1(d), ..., pn(d)) = p0(d). Moreover,
||h|| = ||g|| − |g(xˉ∗)| = ||g|| − 1 &lt; ||g|| which contradicts the assumption that g</p>
      <p>
        Thus f = g. So if the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution on F (n), then
Lemma 8. The problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution on M (n) if and only if
it has an optimal solution on F (n) which belongs to M (n).
      </p>
      <p>Proof. Let xˉ, yˉ ∈ {−1, 0, 1}n. Consider the following cases.</p>
      <p>1) g(xˉ) = f (xˉ), g(yˉ) = f (yˉ). Then |g(xˉ) − g(yˉ)| = |f (xˉ) − f (yˉ)| ≤ ρ(xˉ, yˉ).
2) g(xˉ) = f (xˉ), g(yˉ) = 0. Then |g(xˉ) − g(yˉ)| = |f (xˉ)| ≤ ρ(xˉ, yˉ), if xˉ 6= yˉ, and
3) g(xˉ) = 0, g(yˉ) = f (yˉ). Then |g(xˉ) − g(yˉ)| = |f (yˉ)| ≤ ρ(xˉ, yˉ), if xˉ 6= yˉ, and
f belongs to M (n).</p>
      <p>M (n).</p>
      <p>
        Proof. “If”: assume that the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution f ∈ F (n)
which belongs to M (n). Then f (p1(d), p2(d), ..., pn(d)) = p0(d) for all d ∈ D.
Moreover, for each g ∈ M (n) such that g(p1(d), p2(d), ..., pn(d)) = p0(d) for all
d ∈ D, we have g ∈ F (n), so ||f || ≤ ||g||. So f is an optimal solution of (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )on
“Only if”: assume that the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution f on
M (n). Then f (p1(d), p2(d), ..., pn(d)) = p0(d) for all d ∈ D. Then since F (n) is
ifnite, the problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has an optimal solution on
problem (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )-(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) has a unique optimal solution of F (n). Denote it as g. Then
      </p>
      <sec id="sec-3-1">
        <title>F (n). By Lemma 6, the</title>
        <p>
          g(p1(d), p2(d), ..., pn(d)) = p0(d) for all d ∈ D and ||g|| ≤ ||f ||. Let us define a
function h ∈ F (n) as follows: for each xˉ ∈ {−1, 0, 1}n, h(xˉ) = f (xˉ), if g(xˉ) 6= 0,
and h(xˉ) = g(xˉ), if g(xˉ) = 0. Then for all d ∈ D, h(p1(d), ..., pn(d)) = p0(d).
Moreover, h ∈ M (n) by Lemma 7. Then ||h|| = ||f ||, so for each xˉ such that
g(xˉ) = 0 we have f (xˉ) = 0. Then ||f || ≤ ||g||. Since ||g|| ≤ ||f || as mentioned
above, we have ||f || = ||g||. The f is an optimal solution of (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) on F (n) and
        </p>
        <p>
          Now we can give a proof of the main Theorem 1 from the previous section.
Proof (of Theorem 1). “If”: assume that the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has an optimal
solution on the set F (n) which is a short function. Denote by f such a solution.
Then we have p0(d) = f (p1(d), p2(d), ..., pn(d)) for all d ∈ D. By Lemma 3, f
belongs to the functional closure of {f0, f1, f2, f3, f4}, where fi are defined as
in Lemma 3. From Lemma 4 it follows that p0(d) = Φ(P )(d) for all d ∈ D for
some predicate P : D →˜{T, F } expressible in the algebra (D→˜ {T, F }; ∨, ∧, ¬, ∼
, ⊥, P1, P2, ..., Pn). Since n
        </p>
        <p>≥ 1 and the predicate ⊥ can be expressed as ∼
P0 = P , so P0 is expressible in AP rP1,...,Pn (D).</p>
        <p>
          P1∧ ∼∼ P1, we conclude that P is expressible in the algebra AP rP1,...,Pn (D).
Then Φ(P0)(d) = Φ(P )(d) for all d ∈ D. Then the definition of Φ implies that
“Only if”: assume that a predicate P0 is expressible in algebra AP rP1,...,Pn (D).
M (n)
Then Lemma 4 implies that Φ(P0)(d) = f (Φ(P1)(d), Φ(P2)(d), ..., Φ(Pn)(d)) for
all d ∈ D for some function f ∈ F (n) which belongs to the functional closure
of {f0, f1, f2, f3, f4}, where fi are defined as in Lemma 3. Then by Lemma 3,
f is a short function and p0(d) = f (p1(d), ..., pn(d)) for all d ∈ D. Then since
⊆ F (n) is a finite set, the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has an optimal solution on the
set M (n). Then Lemma 8 implies that the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has an optimal
solution on F (n) which is a short function.
        </p>
        <p>
          Note that the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has the following addition property.
Lemma 9. If the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has an optimal solution on M (n), then this
solution is unique.
        </p>
        <p>
          Proof. Assume that f, g are optimal solutions of (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) on M (n). Then by
Lemma 8, (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) has an optimal solution on F (n) which belongs to M (n). By
f , g are optimal solutions of (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) on F (n). Then by Lemma 6, f = g.
Lemma 6 this solution is unique. Denote it as h. Then ||h|| ≤ ||f || and ||h|| ≤ ||g||.
Then h is an optimal solution of (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) on M (n) and ||h|| = ||f || = ||g||. Then
tu
tu
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Example</title>
      <p>In this example of application of the main result of the paper we will use the
notation and terminology of the composition-nominative approach to program
formalization [16, 17] and [7, 6, 5].</p>
      <p>Let v be a fixed name, V = {v}, A = {T, F }.</p>
      <p>Let D = V A be the set of named sets on V which take values in A. Then
Let P1 be a partial predicate on D such that</p>
      <p>D = {[], [v 7→ T ], [v 7→ F ]}.</p>
      <p>P1(d) ∼= (v ⇒ (d))
P0(d) =
(T, if v ⇒ (d) ↑;</p>
      <p>F, if v ⇒ (d) ↓ .
where v ⇒ is the denaming operation [16, 17] (which has undefined value, if
v ∈/ dom(d)).</p>
      <p>Let P0 be a partial predicate on D such that</p>
      <sec id="sec-4-1">
        <title>Let us check if P0 is expressible in the algebra</title>
        <p>AP rP1 (D) = (D→˜ {T, F }; ∨, ∧, ¬, ∼, P1).</p>
        <p>if Pi(d) ↑,
−1, if Pi(d) ↓= F.</p>
        <p>Let pi : D → {−1, 0, 1}, i = 0, 1 be functions such that</p>
        <p>1, if Pi(d) ↓= T,
pi(d) = 0,
Then</p>
        <p>1,
p1(d) = 0,
if v ⇒ (d) ↓= T,
if v ⇒ (d) ↑,
−1, if v ⇒ (d) ↓= F.

−1, if v ⇒ (d) ↓= T,
p0(d) = 1, if v ⇒ (d) ↑,</p>
        <p>−1, if v ⇒ (d) ↓= F.</p>
        <p>The initial topology on D induced by p1 is the power set of D, so p0 is
continuous. We have
p0({d ∈ D | p1(d) = −1}) = {−1}
p0({d ∈ D | p1(d) = 0}) = {1}
p0({d ∈ D | p1(d) = 1}) = {−1}
Then a function with the graph</p>
        <p>
          {(−1, −1), (
          <xref ref-type="bibr" rid="ref1">0, 1</xref>
          ), (
          <xref ref-type="bibr" rid="ref1">1, −1</xref>
          )}
is the unique optimal solution of the problem (
          <xref ref-type="bibr" rid="ref1">1</xref>
          )-(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ), but it is, obviously, not a
short function. Then Theorem 1 implies that P0 is not expressible in the algebra
        </p>
        <p>AP rP1 (D) = (D→˜ {T, F }; ∨, ∧, ¬, ∼, P1).</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>We have investigated the question of expressibility of partial predicates in the
Kleene algebra extended with the composition of predicate complement and have
given a necessary and suficient condition of this expressibility in terms of the
existence of an optimal solution of a special optimization problem. The obtained
results may be useful for development of (semi-)automatic deduction tools for an
extension of the Floyd-Hoare logic for the case of partial pre- and postconditions.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Floyd</surname>
          </string-name>
          , R.:
          <article-title>Assigning meanings to programs</article-title>
          .
          <source>Mathematical aspects of computer science</source>
          <volume>19</volume>
          (
          <fpage>19</fpage>
          -
          <lpage>32</lpage>
          ) (
          <year>1967</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Hoare</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>An axiomatic basis for computer programming</article-title>
          .
          <source>Commun. ACM</source>
          <volume>12</volume>
          (
          <issue>10</issue>
          ),
          <fpage>576</fpage>
          -
          <lpage>580</lpage>
          (
          <year>1969</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Implementation of the compositionnominative approach to program formalization in mizar</article-title>
          .
          <source>Computer Science Journal of Moldova</source>
          <volume>26</volume>
          ,
          <fpage>59</fpage>
          -
          <lpage>76</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Formalization of nominative data in mizar</article-title>
          . pp.
          <fpage>82</fpage>
          -
          <lpage>85</lpage>
          .
          <source>Proceedings of TAAPSD</source>
          <year>2015</year>
          ,
          <volume>23</volume>
          -
          <fpage>26</fpage>
          December 2015, Taras Shevchenko National University of Kyiv, Ukraine (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>An abstract block formalism for engineering systems</article-title>
          . In: Ermolayev,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Mayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.C.</given-names>
            ,
            <surname>Nikitchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Spivakovsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Zholtkevych</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Zavileysky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Kravtsov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Kobets</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Peschanenko</surname>
          </string-name>
          , V.S. (eds.)
          <source>Proceedings of the 9th International Conference on ICT in Education, Research</source>
          and Industrial Applications: Integration, Harmonization and
          <string-name>
            <given-names>Knowledge</given-names>
            <surname>Transfer</surname>
          </string-name>
          , Kherson, Ukraine, June 19- 22,
          <year>2013</year>
          .
          <source>CEUR Workshop Proceedings</source>
          , vol.
          <volume>1000</volume>
          , pp.
          <fpage>448</fpage>
          -
          <lpage>463</lpage>
          . CEUR-WS.org (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Ivanov</surname>
          </string-name>
          , I.:
          <article-title>On existence of total input-output pairs of abstract time systems</article-title>
          . In: Ermolayev,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Mayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.C.</given-names>
            ,
            <surname>Nikitchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Spivakovsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Zholtkevych</surname>
          </string-name>
          ,
          <string-name>
            <surname>G</surname>
          </string-name>
          . (eds.) Information and Communication Technologies in Education, Research, and
          <string-name>
            <given-names>Industrial</given-names>
            <surname>Applications</surname>
          </string-name>
          .
          <source>Communications in Computer and Information Science</source>
          , vol.
          <volume>412</volume>
          , pp.
          <fpage>308</fpage>
          -
          <lpage>331</lpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ivanov</surname>
          </string-name>
          , I.:
          <article-title>On representations of abstract systems with partial inputs and outputs</article-title>
          . In: Gopal,
          <string-name>
            <given-names>T.V.</given-names>
            ,
            <surname>Agrawal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Cooper</surname>
          </string-name>
          , S.B. (eds.)
          <source>Theory and Applications of Models of Computation. Lecture Notes in Computer Science</source>
          , vol.
          <volume>8402</volume>
          , pp.
          <fpage>104</fpage>
          -
          <lpage>123</lpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Inference rules for the partial floyd-hoare logic based on composition of predicate complement</article-title>
          . In: Ermolayev,
          <string-name>
            <surname>V.</surname>
          </string-name>
          ,
          <article-title>Su´arez-</article-title>
          <string-name>
            <surname>Figueroa</surname>
            ,
            <given-names>M.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yakovyna</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mayr</surname>
            ,
            <given-names>H.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Spivakovsky</surname>
            ,
            <given-names>A</given-names>
          </string-name>
          . (eds.) Information and Communication Technologies in Education, Research, and Industrial Applications. pp.
          <fpage>71</fpage>
          -
          <lpage>88</lpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Kleene algebra of partial predicates</article-title>
          .
          <source>Formalized Mathematics</source>
          <volume>26</volume>
          ,
          <fpage>11</fpage>
          -
          <lpage>20</lpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>An approach to formalization of an extension of Floyd-Hoare logic</article-title>
          .
          <source>In: Proceedings of the 13th International Conference on ICT in Education, Research and Industrial Applications</source>
          . Integration, Harmonization and
          <string-name>
            <given-names>Knowledge</given-names>
            <surname>Transfer</surname>
          </string-name>
          , Kyiv, Ukraine, May
          <volume>15</volume>
          -18,
          <year>2017</year>
          . pp.
          <fpage>504</fpage>
          -
          <lpage>523</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Kornilowicz</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Formalization of the algebra of nominative data in mizar</article-title>
          . In: Ganzha,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Maciaszek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.A.</given-names>
            ,
            <surname>Paprzycki</surname>
          </string-name>
          , M. (eds.)
          <source>Proceedings of the 2017 Federated Conference on Computer Science and Information Systems. ACSIS</source>
          , vol.
          <volume>11</volume>
          , pp.
          <fpage>237</fpage>
          -
          <lpage>244</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Formalization of the Nominative Algorithmic Algebra in Mizar</article-title>
          ,
          <source>Advances in Intelligent Systems and Computing</source>
          , vol.
          <volume>656</volume>
          , pp.
          <fpage>176</fpage>
          -
          <lpage>186</lpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schreiner</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Extending Floyd-Hoare logic for partial pre- and postconditions</article-title>
          . In: Ermolayev,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Mayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Nikitchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Spivakovsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Zholtkevych</surname>
          </string-name>
          ,
          <string-name>
            <surname>G</surname>
          </string-name>
          . (eds.) Information and Communication Technologies in Education, Research, and Industrial Applications,
          <source>Communications in Computer and Information Science</source>
          , vol.
          <volume>412</volume>
          , pp.
          <fpage>355</fpage>
          -
          <lpage>378</lpage>
          . Springer International Publishing (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Properties of inference systems for Floyd-Hoare logic with partial predicates</article-title>
          .
          <source>Acta Electrotechnica et Informatica</source>
          <volume>13</volume>
          (
          <issue>4</issue>
          ),
          <fpage>70</fpage>
          -
          <lpage>78</lpage>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Korni</surname>
            <given-names>lowicz</given-names>
          </string-name>
          , A.,
          <string-name>
            <surname>Kryvolap</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Extended Floyd-Hoare logic over relational nominative data</article-title>
          . In: Bassiliades,
          <string-name>
            <given-names>N.</given-names>
            ,
            <surname>Ermolayev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Fill</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.G.</given-names>
            ,
            <surname>Yakovyna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Mayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.C.</given-names>
            ,
            <surname>Nikitchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Zholtkevych</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            ,
            <surname>Spivakovsky</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.) Information and Communication Technologies in Education, Research, and Industrial Applications. pp.
          <fpage>41</fpage>
          -
          <lpage>64</lpage>
          . Springer International Publishing,
          <string-name>
            <surname>Cham</surname>
          </string-name>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>N.S.:</given-names>
          </string-name>
          <article-title>A composition nominative approach to program semantics</article-title>
          .
          <source>Tech. rep., IT-TR 1998-020</source>
          , Technical University of Denmark (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Skobelev</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikitchenko</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ivanov</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>On algebraic properties of nominative data and functions</article-title>
          . In: Ermolayev,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Mayr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Nikitchenko</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Spivakovsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Zholtkevych</surname>
          </string-name>
          ,
          <string-name>
            <surname>G</surname>
          </string-name>
          . (eds.) Information and Communication Technologies in Education, Research, and Industrial Applications,
          <source>Communications in Computer and Information Science</source>
          , vol.
          <volume>469</volume>
          , pp.
          <fpage>117</fpage>
          -
          <lpage>138</lpage>
          . Springer International Publishing (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Yablonskii</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>Functional constructions in a k-valued logic</article-title>
          .
          <source>Trudy Mat. Inst. Steklov</source>
          .
          <volume>51</volume>
          ,
          <fpage>5</fpage>
          -
          <lpage>142</lpage>
          (
          <year>1958</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>