<!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>rst order de nability of LRTp</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>J. Raymundo Marcial-Romero</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>J. A. Hernandez</string-name>
          <email>xosehernandez@fi.uaemex.mx</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universidad Autonoma del Estado de Mexico (UAEM) Facultad de Ingenier a</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>The language LRTp is a non-deterministic language for exact real number computation. It has been shown that all computable rst order relations in the sense of Brattka are de nable in the language. If we restrict the language to single-valued total relations (e.g. functions), all polynomials are de nable in the language. In this paper we show that the non-deterministic version of the limit operator, which allows to de ne all computable rst order relations, when restricted to single-valued total inputs, produces single-valued total outputs. This implies that not only the polynomials are de nable in the language but also all computable rst order functions.</p>
      </abstract>
      <kwd-group>
        <kwd>Exact real-number computation</kwd>
        <kwd>Sequential Computation</kwd>
        <kwd>PCF</kwd>
        <kwd>Semantics of programming languages</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <sec id="sec-1-1">
        <title>Several papers on real number computation follow an idea originally due to</title>
        <p>
          Scott [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ] of interpreting a type for real numbers in the domain of compact
intervals (for simplicity, often restricted to the closed unit interval). In particular,
extensions to P CF following this approach are investigated in [
          <xref ref-type="bibr" rid="ref18 ref3 ref5 ref7 ref9">5, 3, 18, 7, 9</xref>
          ]. One
of the most striking results along this line is Escardo, Hofmann and Streicher's
proof [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] that \parallel if" can be implemented in a language that includes
addition extended canonically to the domain of partial reals. This means that in
order to have a reasonably expressive language with sequential interpretation,
one must give up the canonical extension of addition. One way to do this is to
introduce non-deterministic choice into the language. In [
          <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
          ], the sequential,
non-deterministic language LRT is de ned. In those papers, it is also shown that
the non-determinism must be interpreted via the Hoare power domain. So, the
ground types of the language are interpreted as Hoare power domains. It is the
interaction of partiality and non-determinism that characterizes the basic idea
of LRT.
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>The rst objective in the construction of LRT was to show its expressivity</title>
        <p>when restricted to single-valued total relations, e.g. functions. In that direction</p>
      </sec>
      <sec id="sec-1-3">
        <title>Marcial et al. [9{11] show that all polynomial functions are de nable in the language.</title>
        <p>
          LRT, with its sequential, non-deterministic semantics, seemed naturally suited
to a relational view of computation. In [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] the language LRTp is introduced. This
languague is an extension of LRT with a let construct added. The interpretation
of let is parameterized by a positive real number p. The extended part is used
to de ne some of the recursive relations de ned by Brattka [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. The
corresponding denotational semantics employs several ideas familiar to domain theorists,
including measurement as de ned by Martin in [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] and a monadic treatment of
the distinction between value and computation as in Moggi [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]. Furthermore,
product types were also included in the language to have explicit products of
ground types. As a result, all computable rst order relations in Brattka sense
were shown to be de nable in the language. However, it was an open question
to know if all computable functions of rst order type are de ned using this
extended language. Obviously LRTp allows to de ne computable functions, but
it has to be proved that a computable rst order single-valued function when
de ned in the language, produces correct singled-value total outputs. In this
paper we prove that it is the case.
        </p>
      </sec>
      <sec id="sec-1-4">
        <title>In order to verify that all computable rst order functions are de nable in</title>
        <p>
          the language, we show that the limit operator when restricted to single-valued
total inputs, produces single-valued total outputs. We use the argument stated
by [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] that the polynomials together with the limit operator allow to de ne all
computable rst order functions in the language. As previously mentioned, all
polynomials are de ned in the language LRT and in the extended language LRTp.
        </p>
        <p>
          LRTp is tied to the call-by-partial-value evaluation de ned in [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], because
the parameter p does not allows to have a call-by-name evaluation strategy as
is the case in LRT. In particular, call-by-value simply makes no sense for the
real number type in LRTp because a \value" only corresponds to a converging
sequence of partial results. In this paper we use the call-by-partial-value of LRTp
but as we are interested in single-valued computations, it corresponds to a
callby-name strategy.
        </p>
        <p>The paper is organized as follows: after the foundations, in Section 3 we
present the notions of strongly convergence of programs. In Section 4, we
introduce the language LRTp. In Section 5, we present the program that computes the
limitation (in some places called limit) operator and we prove that it strongly
convergence for single-valued inputs. Finally, Section 6 is devoted to conclusions.
2
2.1</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Foundations</title>
      <p>Continuous relations</p>
      <sec id="sec-2-1">
        <title>In [2], Brattka extends Kleene's system of recursive partial functions on the nat</title>
        <p>ural numbers to other metric spaces, particularly to R. Continuity is a necessary
condition for e ectiveness, and yet the fact that R is connected means there
are no non-constant continuous functions, e.g., from R to the discrete space N.</p>
      </sec>
      <sec id="sec-2-2">
        <title>So Brattka gives up functionality and retains a generalization of continuity to relations.</title>
        <sec id="sec-2-2-1">
          <title>De nition 1. For binary relation R between sets X and Y and element x 2 X,</title>
          <p>de ne R(x) := fy 2 Y j xRyg. For B Y , de ne R 1(B) := fx 2 X : R(x) \
B 6= ;g, and let dom(R) = R 1(Y ) = fx 2 X j R(x) 6= ;g. Thus we think of a
relation as a partial function from X to non-empty subsets of Y . For this reason,
we follow Brattka by usually writing f , g, etc., as names for binary relations.</p>
        </sec>
        <sec id="sec-2-2-2">
          <title>Binary relations from X to Y will be indicated by f : X $ Y .</title>
          <p>If X and Y are topological spaces, then f is said to be continuous if and
only if f 1(V ) is open in X whenever V is open in Y . Also f is said to have
closed images if f (x) is closed in Y for every x 2 X. Additionally, f is said to
be single-valued if f (x) is a singleton in Y for every x 2 X.</p>
          <p>If X and Y are topological (or metric) spaces, then X Y denotes the
standard topological (metric) product.</p>
          <p>Clearly, for a function h between spaces, the graph of h is a continuous
relation if and only if h is continuous in the usual sense. In particular, the
graphs of projection maps for cartesian products are continuous. If the codomain
is T1, graphs of functions also have closed images. Furthermore, any relation f
is continuous if and only if f (A) f (A) for every A dom(f ). Note that A
ranges only over subsets of dom(f ), not over all subsets of X. This jibes with
our interpretation of f (x) = ; as meaning that f is unde ned at x.</p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>Continuous relations are not closed under the usual relational composition.</title>
        <p>On the other hand, for continuous relations f : X $ Y and g : Y $ Z, de ne
g f by
(g
f )(x) :=
(g f )(x); if f (x) dom(g);
;; otherwise.
where g f is the usual relational composition. A simple exercise shows that
continuous relations are closed under .</p>
        <p>By de nition, g f has closed images. The graph of the identity function on
a space Y satis es f = I f if and only if f has closed images, and similarly
for g = g I. So de nes composition for a category of topological (or metric)
spaces in which the morphisms are continuous relations with closed images. This
can be taken to be the ambient category for Brattka's recursive relations. Note
that the graphs of projections on products of T1 spaces are continuous with
closed image. So the category can be given a monoidal structure.</p>
      </sec>
      <sec id="sec-2-4">
        <title>In addition to the composition, he de nes combinators on binary relations for juxtaposition, iteration, minimization and limitation, in this section, we only present the limitation combinator as it will be used in our later discussion.</title>
        <p>bn 2 Bn.</p>
        <p>Limitation In a (complete) metric space, a sequence fBngn of subsets is strongly
Cauchy provided that for each i and each bi 2 Bi, bi is the i-th element of a
strong Cauchy sequence fbngn for which bn 2 Bn for each n. In other words,
all elements of Bi participate in some strong Cauchy sequence obtained from
the sets Bn. For such a sequence of subsets, de ne limi!1 Bi to consist of
all limits (in the usual sense) of all strong Cauchy sequences hbnin such that</p>
      </sec>
      <sec id="sec-2-5">
        <title>For a relation C : X</title>
        <p>N $ Y , the limitation combinator is de ned by
lim[C](a) :=
limn!1 Cn(a); Cn strongly Cauchy, where Cn(a) = C(a; n);
;; otherwise.
2.2</p>
        <p>The interval domain</p>
      </sec>
      <sec id="sec-2-6">
        <title>The ideas discussed in this section are considered in more detail in [5].</title>
        <p>The set R of non-empty connected compact subsets of the Euclidean real
line forms a continuous dcpo when ordered by reverse inclusion: x v y i x y.</p>
        <p>We regard elements of R as \partial real numbers"; the v-maximal intervals
are singletons, corresponding to \total numbers". That is, the continuous map
x 7! fxg embeds R as maximal elements, making R into a domain model for R.
The dcpo R, however, does not have a least element. By adding a least element,
corresponding to the completely under-speci ed partial real number R, we obtain
a bounded complete continuous domain R?.</p>
        <p>For any x 2 R?, we write x = inf x and x = sup x so that x = [x; x], and
de ne x := x x:</p>
        <p>The upper bound of a subset A R? is T A when this is not empty.
Alternatively,</p>
        <p>G A = \ A = sup x; inf x :</p>
        <p>x2A x2A
The way-below relation of R? is given by x y i x &lt; y and y &lt; x.</p>
        <p>This amounts to y being a subset of the interior of x. Of course R = ? a
for any compact interval a. The intervals with distinct rational end-points form
a basis for R?.</p>
        <p>For basis element a, consider the partial function x 7! a t x de ned when a
and x are consistent. This join map has a total continuous extension:
joinax =
8 a t x; a and x are consistent;
&lt;</p>
        <p>fag ; x &lt; a;
: fag ; a &lt; x.</p>
        <p>Lemma 1. For basis elements a and b,
1. joinajoinb = joinatb if a t b exists;
2. joinajoinb = ka if b &lt; a;
3. joinajoinb = ka if a &lt; b;
where kx denotes the constant map x 7! fxg. Thus joina v joinajoinb always
holds.</p>
        <p>Each basis element a is also associated with a positive a ne map rrconsa : R !
R given by x 7! ax + a. Taking images, rrconsa extends to a strict continuous
map on R?. These maps form a left group action on R?. Because of this, we will
think of the basis of R? as itself forming a group, writing ab for concatenation,
a 1 for inverse and I for the identity (that is, the interval [0; 1], corresponding
to the identity a ne map).</p>
      </sec>
      <sec id="sec-2-7">
        <title>Composites of joins and a ne transformations interact as follows:</title>
        <p>Lemma 2. For basis elements a and b,
1. rrconsajoinb = joinabrrconsa;
2. rrconsarrconsb = rrconsab;</p>
        <p>The functions rrconsa and joina are said to be strongly convergent, meaning
that they send maximal elements to maximal elements. In addition, the functions
rrconsa are all homeomorphisms (rrconsarrconsa 1 = rrconsI = id), so they also
send non-maximal elements to non-maximal elements.
2.3</p>
        <p>The Hoare powerdomain</p>
      </sec>
      <sec id="sec-2-8">
        <title>In [9{11], the rst author shows that under certain assumptions, a suitable se</title>
        <p>
          mantics for sequential, non-deterministic real number computation requires the
Hoare powerdomain (PH ). That is, starting from the assumption that some
functorial powerdomain is needed to model non-determinism, general
considerations about continuity show that the Hoare powerdomain is the only one that
can be used. We refer the reader to the cited work for an explanation. In that
work, however, the fact that PH is actually a free construction is not used
explicitly (though certain de nitions in the semantics depend on it implicitly). In
this section, we review the basic facts about PH as the construction of free
inationary semi-lattices. The reader may consult [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] for a general theory of free
domain constructions de ned by inequalities.
        </p>
      </sec>
      <sec id="sec-2-9">
        <title>A semi-lattice in the category of domains is simply a domain equipped with a</title>
        <p>continuous binary operation [ : X X ! X that satis es the usual semi-lattice
laws. Such a semi-lattice is in ationary if x v x [ y. It is not hard to see that
idempotency is equivalent to [ = idX , and in ationarity to idX X v [,
where : X ! X X is the diagonal map. Since these two conditions constitute
a Galois connection between [ and , if [ exists it is unique.</p>
      </sec>
      <sec id="sec-2-10">
        <title>The Hoare powerdomain is the free construction for in ationary semi-lattices [1].</title>
        <p>If f : X ! Y is a continuous map and (Y; [) is an in ationary semi-lattice, then
there is a unique continuous map f : PH (X) ! Y that preserves [ for which
f = f , where is the unit of the powerdomain monad. There is also a unique
continuous map fb: PH (X) ! PH (Y ) de ned by fb := PH (f ).</p>
      </sec>
      <sec id="sec-2-11">
        <title>In domains, the binary formal join of an in ationary semi-lattice extends</title>
        <p>automatically to formal joins of non-empty sets: For A X, take the closure
of A under [. This is automatically a directed set and hence has a supremum,
which we denote by S A. If the generating domain has a least element, then so
does PH (X). So S is de ned for all subsets of PH (X).</p>
        <p>Concretely, elements of PH (X) are non-empty Scott closed subsets of X, the
unit sends x 2 X to the closure of fxg. Also, [ is simply binary union, and S is
closure of union.</p>
      </sec>
      <sec id="sec-2-12">
        <title>To mediate between products and powerdomains, we exploit the fact that the</title>
        <p>Hoare powerdomain is a monoidal monad with natural transformation m : PH (X)
PH (Y ) ! PH (X Y ) satisfying the usual coherence conditions. In concrete
terms, m(A; B) := A B.</p>
      </sec>
      <sec id="sec-2-13">
        <title>Thus the relevant structure of the Hoare powerdomain, for our purposes, is</title>
        <p>given by the functor PH itself, the unit : X ! PH (X), the formal union
[: PH (X) PH (X) ! PH (X) and the transformation m : PH (X) PH (Y ) !
PH (X Y ).</p>
      </sec>
      <sec id="sec-2-14">
        <title>A continuous map f between in ationary semi-lattice domains X and Y</title>
        <p>preserves [ if f (x [ y) = f (x) [ f (y).
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Hoare power domains of domain environments specialized to functions</title>
      <sec id="sec-3-1">
        <title>If D and E are domain environments for spaces X and Y respectively, we can</title>
        <p>ask when a continuous function F : PH (D) ! PH (E) corresponds naturally to
a continuous single-valued relation from X to Y . The next de nition answer this
question.</p>
        <p>De nition 2. Suppose X is a topological space, EX is a domain model for X
with embedding eX and d 2 PH (EX ). Let
uX (d) := fx 2 X j X (x) v dg = ( X ) 1(#d)
X :=
eX :</p>
        <p>We said that u is single-valued if there is a unique x 2 X such that uX (d) =
fxg. The subscripts will be ommited when possible.</p>
        <p>Furthermore, suppose that Y is a second space and EY is a
corresponding domain model. It is said that a relation f from X to Y is captured by
F : PH (EX ) ! PH (EY ) (written f F ) i for each x 2 dom(f ), f (x) =
u(F ( X (x))). Moreover, say that a single-valued relation f from X to Y is
strongly captured by F : PH (EX ) ! PH (EY ) (written f F ) if and only
if for each x 2 dom(f ), f (x) = u(F ( X (x))), i.e. u is single-valued. Say that f
is exactly captured by F (written f ' F ) i
f</p>
        <p>F and dom(f ) = fx 2 X j u(F ( (x))) 6= ;g:</p>
        <sec id="sec-3-1-1">
          <title>Say that f is exactly strongly captured by F (written f ' F ) if and only if</title>
          <p>f</p>
          <p>F and</p>
          <p>dom(f ) = fx 2 X j u(F ( (x))) 6= ;; u is single-valuedg :</p>
          <p>Say that d 2 PH (EX ) is convergent provided that d =S f (x) j x 2 u(d)g:
Say that d 2 PH (EX ) is strongly convergent provided that d = (x) where x is
the unique value of the single-valued function u(d). Also say that d is divergent
provided that (x) 6v d for all x 2 X. Moreover, say that d is strongly divergent
provided that either (x) 6v d for all x 2 X or u(d) is not single-valued. Say that
continuous F : PH (EX ) ! PH (EY ) is disciplined provided that it preserves [
and for each x 2 X, F ( X (x)) is either convergent or divergent. Also, say that
continuous F : PH (EX ) ! PH (EY ) is strongly disciplined provided that for
each x 2 X, F ( X (x)) is either strongly convergent or strongly divergent.</p>
          <p>For the remainder of this section, we assume that X, Y , EX , EY , and
embeddings eX , eY are xed.</p>
          <p>We can veri ed that, for any singleton fxg X, fxg = u( (x)), to see this,
(x) is a directed set with supremum x, hence x 2 u( (x)), as x is the only
element belonging to fxg then fxg = u( (x)).</p>
          <p>
            In [
            <xref ref-type="bibr" rid="ref12">12</xref>
            ] is was proved that for any F : PH (EX ) ! PH (EY ), there is a unique
relation that is exactly captured by F . If F is disciplined, the exactly captured
relation is a continuous relation with closed images.
          </p>
        </sec>
        <sec id="sec-3-1-2">
          <title>Lemma 3. For any continuous F : PH (EX ) ! PH (EY ), if F is strongly dis</title>
          <p>ciplined, there is a unique relation that is exactly strongly captured by F , this
relation is a continuous relation with single-valued image.</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>Proof. The relations strongly captured by F , understood as subsets of X Y ,</title>
        <p>are closed under unions, and trivially the empty relation is captured. So there is
a maximal relation strongly captured by F . Clearly, the condition on domains
means that this maximal relation is exactly strongly captured and any strongly
captured relation is contained in an exactly strongly captured relation.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Suppose F is strongly disciplined. Consider the composition u F . We claim that this is a continuous relation (u itself is not generally continuous) with singlevalued image. For open U , the inverse image is</title>
        <p>fd 2 EX j u(F (d)) \ U 6= ;; u single-valuedg
which is clearly an upper subset of EX . For directed D, if u(F (F D)) \ U 6= ;,
and u is single-valued then for some x 2 X, (eX (x)) v F F (D).</p>
        <p>De ne f : X $ Y by f (x) = u(F ( (eX (x)))) for single valued u. Because u
only yields singletons, f has single-valued images. As, F is strongly disciplined,
dom(f ) agrees precisely with the de nition of \exact strongly capture." It
remains to verify that f F . Suppose fxg = u(d). Then d = (eX (x)) [ d0 where
u(d0) = ;. As F is strongly disciplined, u(F (d)) = u(F ( (eX (x)))) = f (x).</p>
      </sec>
      <sec id="sec-3-4">
        <title>This leads to the following fundamental connection between continuous re</title>
        <p>
          lations with closed images and disciplined functions. Disciplined functions are
closed under composition. Moreover, if F and G are disciplined, f and g are
continuous with closed images, f F and g G and these \type check" in the
obvious way, then (g f ) (G F ) [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
      </sec>
      <sec id="sec-3-5">
        <title>The previous result can be extended to continuous relatons with single-valued image and strongly disciplined functions.</title>
        <p>Theorem 1. Strongly disciplined functions are closed under composition.
Moreover, if F and G are strongly disciplined, f and g are continuous with
singlevalued images, f F and g G and these \type check" in the obvious way,
then (g f ) (G F ).</p>
        <p>Proof. Closure under composition for preservation of [ follows from the
general theory of power domains. By de nition of strongly disciplined, there is a
unique z such that fzg = u(G(F ( (x)))) for all x in the domain of f , hence
z 2 G(F ( (x))).</p>
        <p>Conversely, if there are unique y and z such that fzg = u(G( (y))) and
fyg = u(F ( (x))) then (z) v G( (y)) v G(F ( (x))). So G F is disciplined.</p>
      </sec>
      <sec id="sec-3-6">
        <title>The second statement is now routinely checked.</title>
        <p>
          Strongly discipline is related to the operational concept of strong
convergence discussed at length in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. There a closed term of ground type is strongly
convergent if it denotes (x) for some x in the modeled space (although the
definition is given operationally and adequacy of the operational semantics justi es
the present characterization). A closed rst-order term is strongly convergent if
it preserves strong convergence of inputs. The reason an operational de nition
is given is that proof of strong convergence typically involves the operational
semantics. The reader may consult [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] or [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] for discussion and examples.
        </p>
      </sec>
      <sec id="sec-3-7">
        <title>The ground spaces about which we are concerned have additional structure</title>
        <p>
          that allow a form of call-by-value, which we refer to as call-by-partial-value. In
[
          <xref ref-type="bibr" rid="ref14">14</xref>
          ], Martin introduces the concept of a measurement on a continuous domain,
D, as a Scott continuous function M : D ! ([0; 1]; ). That is, M assigns a
positive extended real to each element of D so that M (F A) = infa2A M (a) for
directed A. A measurement is also required to satisfy M (a) = 0 if and only if
a 2 max D.
        </p>
        <p>The domains R?, T? and N? clearly can be equipped with measurements:
in R?, M (a) = a; in T?, M (true) = M (false) = 0; in N?, M (n) = 0; and
in all of these M (?) = 1. In a nite product of domains with measurements,
a measurement on a tuple is obtained by taking the minimum measurement of
the components. For any positive p, any domain D with least element and with
measurement M , the function pvp : D ! D given by pvp(a) = a if M (a) &lt; p and
pvp(a) = ? otherwise is continuous. Its extension to PH D satis es pdvp(d) v d
and allows us to isolate the maximal part of an element d 2 PH (D) that can
be written S (a) where all elements of A have \small" measurement. As
p decreases, pav2pAdecreases as well. Importantly, each pdvp(d) is the identity map
when restricted to convergent d, and Fp pdvp is the identity on R?.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>The LRTp Language</title>
      <sec id="sec-4-1">
        <title>The language LRT is a modi cation of RealPCF considered by Escardo [4]</title>
        <p>
          for real number computation. In LRT, parallel conditional pif is replaced by a
non-deterministic test rtestl;r. In this section, we describe a variant of LRT.
The language LRTp di ers from LRT in three ways: products of ground types
are made explicit, the type I for the compact interval [0; 1] is eliminated in favor
of a type corresponding to R, and a let construct is introduced that provides
for call-by-partial-value semantics. This language is described at length in [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
4.1
        </p>
        <p>Syntax
Syntactically, the type system for LRTp is given by
:=
:= nat j bool j real
:=
j
j ( ! )</p>
      </sec>
      <sec id="sec-4-2">
        <title>Types in the rst clause are ground types; in the second clause, basic types; and</title>
        <p>in the third clause, general types. As usual, we associate ! right to left, and
omit parentheses when we can.</p>
      </sec>
      <sec id="sec-4-3">
        <title>The raw syntax of the language is given by</title>
        <p>x 2 V ariable;
P ::= x j n j true j false j (+1)(P ) j ( 1)(P ) j (= 0)(P ) j
if P then P else P j rrconsa(P ) j joina(P ) j rtestl;r(P ) j</p>
        <p>x :P j P P j YP j let x = P in P j priP j hP0; : : : ; Pni
where (+1)(P ); ( 1)(P ) and (= 0)(P ) amount for successor, predecessor and
equality for zero respectively; the subscripts of the constructs rrcons and join
are proper rational intervals and those of rtest are rational numbers. In the let
construct, the rst term P must be of basic type.</p>
      </sec>
      <sec id="sec-4-4">
        <title>In addition, we allow ourselves the syntactic sugar of writing</title>
        <p>let hx0; : : : ; xni = P1 in P2 where the notation hx0; : : : ; xni stands for a
variable of the appropriate product type and where free occurrences of xi in P2
abbreviate prihx0; : : : ; xni.</p>
      </sec>
      <sec id="sec-4-5">
        <title>Terms can be associated with types in the familiar style by proof rules and judgements, but in the interest of brevity, we trust the reader to ll in the details.</title>
        <p>4.2</p>
        <p>Denotational Semantics</p>
        <p>We de ne denotational semantics [[ ]]p for LRTp subject to a positive real
number parameter p in such a way that [[M ]]p is semi-continuous in p and
Fp [[M ]]p corresponds to call-by-name interpretation. The idea is to employ pvp
(see page 8) in the interpretation of the let construct to ignore di erences due
to \badly" divergent behavior. As p increases, the semantics ignores less. We use</p>
      </sec>
      <sec id="sec-4-6">
        <title>B [[]] to denote basic types, which includes ground types and product types.</title>
      </sec>
      <sec id="sec-4-7">
        <title>The ground types bool; nat and real are interpreted, rst, as the domains of</title>
        <p>booleans (T?), natural numbers (N?) and compact intervals (R?), respectively.</p>
      </sec>
      <sec id="sec-4-8">
        <title>That is,</title>
        <p>B [[bool]] := T?;</p>
        <p>B [[nat]] := N?;</p>
        <p>B [[real]] := R?:
Finite products are interpreted the usual way: B [[ ]] := B [[ ]] B [[ ]]. Basic
types are interpreted as Hoare powerdomains of nite products:</p>
      </sec>
      <sec id="sec-4-9">
        <title>Function types are interpreted as function spaces in the category of dcpos:</title>
      </sec>
      <sec id="sec-4-10">
        <title>These de nitions re ect a call-by-name semantics in which product types are interpreted as consisting of computations of tuples, rather than tuples of computations. The interpretation of constants is given as follows:</title>
        <p>[[true]]p = (true);
[[false]]p = (false);
with syntactic sugar [[if M then N else P ]]p := [[if]]p( [[M ]]p; [[N ]]p; [[P ]]p)
[[pri]]p = bi;
where i is the usual projection map. Tuples are interpreted by
[[hX1; : : : ; Xni]]p := m( [[X1]]p; : : : ; [[Xn]]p)</p>
      </sec>
      <sec id="sec-4-11">
        <title>Note that so far, none of these de nitions depend on the parameter p. The let</title>
        <p>construct enforces what we refer to as call-by-partial-value.</p>
        <p>
          [[let x = M in N ]]p := [[N ]]p (x=pdvp( [[M ]]p))
Heirseththeeusnyitm, bfbol:s= ;PbH; (fa),ndf mdendoetreisvethfreomtranthspeoHseoaorfefp:oXwer!domPaHi(nY m),omnadis:
the natural transformation PH (X0) : : : PH (Xn) ! PH (X0 : : : Xn). The
functions (+1), ( 1), (= 0) are the standard interpretations in the Scott model of
PCF [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ], the functions joina; rrconsa are de ned in section 2.2, and the function
rtestl;r is de ned by:
rtestl;r(x) =
&gt; (false);
&gt;
&gt;
:?;
8 (true) [ (false); if l &lt; x &lt; x &lt; r;
&gt;
&gt;&gt;&lt; (true); if x r;
if x l;
otherwise:
        </p>
        <p>
          In [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] it was proved that the constants (+1), ( 1), (= 0), rtestl;r, joina,
rrconsa and pri denote disciplined functions.
        </p>
        <p>Lemma 4. The constants (+1), ( 1), (= 0), joina, rrconsa and pri denote
strongly disciplined functions but not the constant rtestl;r.</p>
        <p>Proof. The convergence requirement is straightforward. That rtestl;r is not
strongly disciplined follows by de nition.</p>
        <p>
          Notice that although rtestl;r is not strongly convergent, it can be used to
de ne strongly convergent functions as is shown in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
        </p>
        <p>Lemma 5. The semantics [[ ]]p is semi-continuous in p: for bounded A
R+,
G [[M ]]p = [[M ]]sup A:
p2A
Moreover, de ne [[]]1 exactly as [[]]p for all cases except</p>
        <p>[[let x = M in N ]]1 := [[N ]]1 (x= [[M ]]1))
Then [[M ]]1 = Fp [[M ]]p.</p>
      </sec>
      <sec id="sec-4-12">
        <title>Proof. The proof is an straigthforward induction on the structure of M.</title>
        <p>4.3</p>
        <p>Operational Semantics</p>
      </sec>
      <sec id="sec-4-13">
        <title>We now develop single-step operational semantics, also parametric in p, so that</title>
        <p>the \p-th" operational interpretation is complete for [[ ]]p. We do not need an
operational semantics corresponding to [[ ]]1.</p>
        <p>De nition 3. For each basic type , we de ne a subset of the closed terms to
be output terms, and for each output term M we de ne it's output o(M ) to be
a value in B [[ ]]. For real, a term of the form joinaM is an output term, and
o(joinaM ) := a. For nat, a term of the form n is an output term, and o(n) = n.
For bool, a term of the form true or false is an output term, and o is de ned
obviously. For , a term of the form hM; N i is an output term provided M
and N are output terms, and o(hM; N i) = ho(M ); o(N )i.</p>
        <p>
          Lemma 6. For an output term M and p &gt; 0,
(o(M )) v [[M ]]p v[ f (x) j o(M ) v
(x)g :
Proof. [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>
          We de ne !p to be the least relation that includes single-step reduction rules
for PCF [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ] and is closed under rules for the type real and for let as follows.
(1) rrconsa(rrconsbM ) !p rrconsabM
(2) joinajoinbM !p joinatbM if b &gt; a or a &gt; b
(3) joinajoinbM !p rrconsaY (rrcons( 1;0)joinI ) if b a
(4) joinajoinbM !p rrconsaY (rrcons(0;1)joinI ) if a b
(5) rrconsa(joinbM ) !p joinab(rrconsaM )
(6) rtestl;rjoinaM !p true a &lt; r
(7) rtestl;rjoinaM !p false l &lt; a
(8) if true then M else M 0 !p M
(9) if false then M else M 0 !p M 0
(10) prihM0; : : : ; Mni !p Mi
(11) let x = M in N !p [M=x]N
(12)
        </p>
        <p>N !p N 0
M N !p M N 0</p>
      </sec>
      <sec id="sec-4-14">
        <title>M is an output term and (o(M )) &lt; p</title>
        <p>if M is joina, rrconsa,
rtestl;r, if, pri, let.</p>
        <p>De nition 4. We de ne the operational meaning of a closed term M of basic
type in i steps of computation, written [M ]ip 2 [[ ]].</p>
        <p>For a closed term of basic type , de ne [M ]i as follows:
[M ]ip = [ f (o(M 0)) j 9M 09k
k
i; M 0 is an output term and M !p M 0 g;
k
where an empty formal join is ?, and !p denotes the k-fold composition of the
relation !p.</p>
        <p>Finally, [M ]p = Fi[M ]ip: which is justi ed by the obvious fact that [M ]ip v
[M ]ip+1.</p>
      </sec>
      <sec id="sec-4-15">
        <title>Note that implicit in this de nition is the fact that the operational rules are</title>
        <p>k
such that M !p M 0 can only hold for nitely many output terms M 0. This can
be established easily by induction on the operational rules.</p>
      </sec>
      <sec id="sec-4-16">
        <title>The operational interpretation of closed terms is adequate with respect to the denotational semantics.</title>
        <p>
          Lemma 7. [[M ]]p = S f [[N ]]p j M !p N g (this is a nite union).
Proof. [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>
          Proof. [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>Lemma 8. For all closed terms M of ground type, [M ]p v [[M ]]p.
De nition 5. A closed term is said to be p-computable as follows:
1. A closed term M of basic type is p-computable whenever [[M ]]p v [M ]p,</p>
        <sec id="sec-4-16-1">
          <title>2. A closed term M : ! is p-computable whenever M Q : is p-computable</title>
          <p>for every closed p-computable term Q of type ,
An open term M : with free variables x1; : : : ; xn of type 1; : : : ; n is
pcomputable whenever [N1=x1] [Nn=xn]M is p-computable for every family Ni :
i of closed p-computable terms.
Lemma 9. Every term of LRTp is p-computable.</p>
          <p>Theorem 2. [M ]p = [[M ]]p, for all closed LRTp terms M and all positive reals
p.</p>
        </sec>
      </sec>
      <sec id="sec-4-17">
        <title>Proof. Lemma 8 and Lemma 9 .</title>
        <p>Remark 41 We are interested in those continuos functions F : PH (X) ! PH (Y )
for which u(F ( (x))) is a singleton. As we observed previously, this property can
be veri ed using the denotational semantics. Although ? cannot be distinguised
from any other element of the Hoare powerdomain, u allows to get those maximal
elements of a given element of the Hoare powerdomain, hence, we just have to
veri ed that the image of u is a singleton, which can be done denotationally. By
adequacy there is a program which denotes such continuous function. Notice that
LRTp is more expressive because we can de ne relations, however, in this paper,
we are not concerned about the full expressivity of LRTp, we only care about the
de nability of rst order computable functions.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>The limitation operator</title>
      <p>De nition 6. For basic LRTp types, we de ne a set-theoretic interpretation as
follows:
R [[nat]] = N;</p>
      <p>R [[bool]] = T;</p>
      <p>R [[real]] = R;</p>
      <p>Theorem 1 establishes that composition in LRTp corresponds to -composition.
That is, if F and G are closed terms of type 1 ! 2 and 2 ! 3, both are
strongly disciplined and f [[F ]] and g [[G]], then g f [[ x:let y = F (x) in G(y)]]p.</p>
      <sec id="sec-5-1">
        <title>In [12] it is extended to the combinators presented in section 2. Here, we only present the limit combinator.</title>
        <p>De nition 7. De ne the following closed term of LRTp:</p>
        <p>Lim[F ](x) := aux lim F (x; 0) id
where
aux lim0 F (x; n) G :=
let r = G(F (x; n)) in
if rtest 5=16;5=16(r)
then if rtest 5=16; 4=16(r)
then consL(aux lim F (x; (+1)(n)) (tailL
else consC (aux lim F (x; (+1)(n)) (tailC
else if rtest4=16;5=16(r)
then consC (aux lim F (x; (+1)(n)) (tailC
else consR(aux lim F (x; (+1)(n)) (tailR
G))
G))
G))
G))
consa := joinA rrconsa
A := [ 1; 1] L := [ 1=2; 0]
taila := joinA rrconsa 1</p>
        <p>C := [ 1=4; 1=4] R := [0; 1=2]</p>
        <p>In these de nitions we understand Lim, for example, to be a second-order
term, where F is an argument. We set them apart for readability using square
brackets.</p>
        <p>
          Theorem 3. For any p &lt; 1=4, in the semantics [[ ]]p, the term Lim preserves
disciplined. Moreover, if f F and g G for single-valued f and g and these
\type check" in the obvious way, then lim f [[Lim]]pF . In other words if the
input of Lim is a single-valued function F then Lim[F ] convergences to a
singlevalued output
Proof. The assumption p &lt; 1=4 is needed to ensure that the limit of the strong
Cauchy sequence in which ri appears as the i-th term is bounded within a
distance of 2 (i+2) from ri. In fact, this is the only point at when the assumption
that p is small is required. Plume [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] and Farjudian [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] give a detailed
explanation of the limit algorithm used here .
6
        </p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>
        By allowing a reasonable de nition of strongly convergence for relations, we get a
characterization of single-valued relations (e.g. functions). This characterization
di ers from the one presented in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] in that the former is denotational while the
further is operational. We have already noticed in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] that the proofs of partial
correctness and strong convergence agreed, but they had to be presented. In this
paper, we proved that for rst order computable functions a denotational proof
is su cient.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>S.</given-names>
            <surname>Abramsky</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Jung</surname>
          </string-name>
          .
          <article-title>Domain theory</article-title>
          . In S. Abramsky,
          <string-name>
            <given-names>D. M.</given-names>
            <surname>Gabbay</surname>
          </string-name>
          , and T. S. E. Maibaum, editors,
          <source>Handbook of Logic in Computer Science</source>
          , volume
          <volume>3</volume>
          , pages
          <fpage>1</fpage>
          {
          <fpage>168</fpage>
          . Clarendon Press,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>V.</given-names>
            <surname>Brattka</surname>
          </string-name>
          .
          <article-title>Recursive characterization of computable real-valued functions and relations</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>162</volume>
          :
          <fpage>45</fpage>
          {
          <fpage>77</fpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>P. Di</given-names>
            <surname>Gianantonio</surname>
          </string-name>
          .
          <article-title>A functional approach to computability on real numbers</article-title>
          .
          <source>PhD thesis</source>
          , University of Pisa,
          <year>1993</year>
          .
          <source>Thecnical Report TD 6/93.</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Escardo</surname>
          </string-name>
          .
          <article-title>PCF extended with real numbers</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>162</volume>
          (
          <issue>1</issue>
          ):
          <volume>79</volume>
          {
          <fpage>115</fpage>
          ,
          <year>August 1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Escardo</surname>
          </string-name>
          .
          <article-title>PCF Extended with Real Numbers: a domain-theoretic approach to higher-order exact real number computation</article-title>
          .
          <source>PhD thesis</source>
          , University of London,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Escardo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Hofmann</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T.</given-names>
            <surname>Streicher</surname>
          </string-name>
          .
          <article-title>On the non-sequential nature of the interval-domain model of real-number computation</article-title>
          .
          <source>Mathematical Structures in Computer Science</source>
          ,
          <volume>14</volume>
          (
          <issue>6</issue>
          ):
          <volume>803</volume>
          {
          <fpage>814</fpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>A.</given-names>
            <surname>Farjudian</surname>
          </string-name>
          .
          <article-title>Sequentiality in Real Number Computation</article-title>
          .
          <source>PhD thesis</source>
          , University of Birmingham,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>A.</given-names>
            <surname>Farjudian</surname>
          </string-name>
          .
          <article-title>Shrad: A language for sequential real number computation</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>41</volume>
          (
          <issue>1</issue>
          ):
          <volume>49</volume>
          {
          <fpage>105</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Marcial-Romero</surname>
          </string-name>
          .
          <article-title>Semantics of a sequential language for exact real-number computation</article-title>
          .
          <source>PhD thesis</source>
          , University of Birmingham,
          <year>December 2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Marcial-Romero</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Escardo</surname>
          </string-name>
          .
          <article-title>Semantics of a sequential language for exact real-number computation</article-title>
          . In Harald Ganzinger, editor,
          <source>Proceedings of the Nineteenth Annual IEEE Symp. on Logic in Computer Science, LICS 2004</source>
          , pages
          <fpage>426</fpage>
          {
          <fpage>435</fpage>
          . IEEE Computer Society Press,
          <year>July 2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Marcial-Romero</surname>
          </string-name>
          and
          <string-name>
            <given-names>M. H.</given-names>
            <surname>Escardo</surname>
          </string-name>
          .
          <article-title>Semantics of a sequential language for exact real-number computation</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>379</volume>
          (
          <issue>1-2</issue>
          ):
          <volume>120</volume>
          {
          <fpage>141</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Marcial-Romero</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Moshier</surname>
          </string-name>
          .
          <article-title>Sequential real number computation and recursive relations</article-title>
          .
          <source>Mathematical Logic Quarterly</source>
          ,
          <volume>54</volume>
          (
          <issue>5</issue>
          ):
          <volume>492</volume>
          {
          <fpage>507</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>K.</given-names>
            <surname>Martin</surname>
          </string-name>
          .
          <article-title>Domain theoretic models of topological spaces</article-title>
          . In Abbas Edalat, Achim Jung, Klaus Keimel, and Marta Kwiatkowska, editors,
          <source>Proceedings of Comprox III, ENTCS</source>
          , volume
          <volume>13</volume>
          , pages
          <fpage>173</fpage>
          {
          <fpage>181</fpage>
          .
          <string-name>
            <surname>Elsevier</surname>
          </string-name>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>K.</given-names>
            <surname>Martin</surname>
          </string-name>
          .
          <article-title>The measurement process in domain theory</article-title>
          .
          <source>In Automata, Languages and Programming</source>
          , pages
          <volume>116</volume>
          {
          <fpage>126</fpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. E. Moggi.
          <article-title>Notions of computation and monads</article-title>
          .
          <source>Information and Computation</source>
          ,
          <volume>93</volume>
          (
          <issue>1</issue>
          ):
          <volume>55</volume>
          {
          <fpage>92</fpage>
          ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Plotkin</surname>
          </string-name>
          .
          <article-title>LCF considered as a programming language</article-title>
          .
          <source>Theoretical Computer Science</source>
          ,
          <volume>5</volume>
          (
          <issue>1</issue>
          ):
          <volume>223</volume>
          {
          <fpage>255</fpage>
          ,
          <year>1977</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <given-names>D.</given-names>
            <surname>Plume</surname>
          </string-name>
          .
          <article-title>A calculator for exact real number computation</article-title>
          .
          <source>Master's thesis</source>
          ,
          <source>Department of Computer Science and Arti cial Intelligence</source>
          ,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>P. J. Potts</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Edalat</surname>
            , and
            <given-names>M.H</given-names>
          </string-name>
          <string-name>
            <surname>Escardo</surname>
          </string-name>
          .
          <article-title>Semantics of exact real arithmetic</article-title>
          .
          <source>In In Proceedings of the Twelveth Annual IEEE Symposium on Logic In Computer Science</source>
          . IEEE Computer Society Press,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Scott</surname>
          </string-name>
          .
          <article-title>Lattice theory, data type and semantics</article-title>
          .
          <source>In Formal semantics of programming languages</source>
          , pages
          <volume>66</volume>
          {
          <fpage>106</fpage>
          . Englewood Cli s, Prentice-Hall,
          <year>1972</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>