• No results found

non-deterministic programs

Stela K. Nikolova

Faculty of Mathematics and Computer Science, Sofia University,

5 James Bourchier Blvd., 1164 Sofia, Bulgaria,

[email protected]

1

Introduction

We consider a kind of while programs over an abstract data type, that along with the usual assignment and loop statements has also a non-deterministic choice statementxi:=arbitrary(A), whereAis a subset of the basic set. After the ex-

ecution of such a statement, the registerxiis evaluated with an arbitrary element

ofA. The choice of this element is completely arbitrary – it does not depend on the input, the current configuration, etc. Due to this non-deterministic operator, one and the same input may lead to different computational paths, both finite and infinite. By analogy with the non-deterministic Turing machines, we can speak about the set,acceptedby a non-deterministic programP – this is the set L(P) of those inputs, for whichthere existsa finite (accepting) computation. The set of all inputsI, such thatevery computation, starting fromI is finite, is the setD(P) of the so-calledpoints of-definednessofP (cf.Manna[1]). It is clear that the set of all points of∀-definedness of a non-deterministic Turing machine is again Turing semi-recognizable (although at exponential prise). However, this is no longer true for the type of non-determinism that we consider here ([2], [3]). For example, in [2] it is shown that for the case of non-deterministic programs over the natural numbers IN with a choice operator xi := arbitrary(IN), the setsD(P) coincide with theΠ11 sets, while the setsL(P) are exactly the recur-

sively enumerable sets. In [3] a syntactical characterization of the setsL(P) and D(P) for the most general case of non-deterministic programs with counters and stacks is obtained.

In the present work we study the setsD(P) andL(P) for a non-deterministic programP over an admissible abstract structureA. We give both explicite and

inductive characterization of these sets. In the next section we introduce the appropriate definitions and formulate the precise results.

2

Preliminaries

Given an arbitrary total structureA0= (B;f1, . . . , fa;P1, . . . , Pb) (the casefi is

On the notion of∀-definedness of non-deterministic programs 179 follows: Take an object O 6∈B and leth i be a pairing operation, such that no element ofB0=B∪{O}is an ordered pair. LetB∗be the least set, that contains

B0 and is closed under h i. Denote by L and R the left and right decoding

functions for the mapping h i (assume that L(s) = R(s) = O for s B0).

The initial functions and predicates ofA0 are extended onBby the equalities

fi(s1, . . . , sn) = O for (s1, . . . , sn) 6∈ Bn and Pi(s1, . . . , sn) = ”f alsity” for

(s1, . . . , sn)6∈Bn.

Now put A = (B;O,h i, L, R, f1, . . . , fa;B, P1, . . . , Pb). We shall suppose

that the equality relation is among the basic predicates of A. Throughout the

paper we shall assume this structureAfixed. As customary, the natural numbers

will be identified with the elements of the setN at={O,hO, Oi,hhO, Oi, Oi, . . .}. Using the coding function h i, we define a coding ¿ À of all finite sequences fromB∗, putting ¿ À=O,¿s

1, . . . , sn+1À=h¿s1, . . . , snÀ, sn+1i.

Anon-deterministic programP overAis a construction of the type

input(x1, . . . ,xk),S., where x1, . . . ,xk are the input variables of P and S is a

statement. Here a statement is defined inductively as follows: initial statements arexi:=τ (assignment) andxi:=arbitrary(B∗) (choice statement); ifS1and

S2 are statements, thenS1;S2 (composition) andwhile C doS od(loop) are

statements (here τ and C are a term and a quantifier-free formula in the lan- guage LA of A). The semantics of the assignment, the composition and the

loop statements is the usual one. As we said above, the execution of the choice statementxi:=arbitrary(B∗) assigns to the registerxian arbitrary element of

B∗. Let us notice that, sinceBis infinite, the computational trees are infinite branching, hence D(P) turns out to be much more complex than L(P). The precise definitions, concerning the setsL(P) andD(P), are in the next section.

We will need infinite sequences{Φn

}n of quantifier-free formulas in LA for

the explicite description of the setsD(P) andL(P). Let us call such a sequence primitive recursive, if the function, which assigns to each n the code of Φn is

primitive recursive.

We next remind some basic notations and results concerning inductive defin- ability (cf. for example [4]). Letϕ(x1, . . . , xk, X) be a first-order formula inLA,

in which the relational variableX occurs only positively. Thenϕdetermines the mapping Γϕ:P((B∗)k)→ P((B∗)k), defined withΓϕ(A) ={(s1, . . . , sk)|

A |= ϕ(s1, . . . , sk, A)}. The sets Iϕξ are defined by transfinite induction on ξ:

ϕ=Γϕ(Sη<ξIϕη). Then the setIϕ=SξIϕξ is the least fixed point ofΓϕ. Finally,

for every ¯sIϕ put |¯s|ϕ= min{ξ|s∈Iϕξ}. It is convenient to consider that for

all ¯s6∈Iϕ,|s¯|ϕ=ζ, whereζ is any ordinal, greater thansup{|s¯|ϕ : ¯s∈Iϕ}. A

set A(B∗)m isinductively definable(byϕonA) ifAis I

ϕ or a section of Iϕ

for someX-positive formulaϕ.

For the inductive characterization we will need formulas in the first-order language of an extentionA+ofA. The structureA+is (A;N at, Seq, U, φ), where

U(a, s) is some fixed universal relation for all quantifier-free formulas with one free variable in LA, and φ(a, n) is some fixed universal function for all unary

primitive recursive functions.

180 S.K. Nikolova

Theorem 1. Let D andL be subsets of (B∗)k. Then the following statements

are equivalent:

(i) There exists a non-deterministic programP overAsuch thatD=D(P)and

L=L(P).

(ii) There exists a primitive recursive sequence of quantifier-free formulas{Φn

}n

inLA with variables among x1, . . . , xk, y such that

L={(s1, . . . , sk)| ∃αα:IN→B∗∃nA|=Φn(s1, . . . , sk,α¯(n))}, D={(s1, . . . , sk)| ∀αα:IN→B∗∃nA|=Φn(s1, . . . , sk,α¯(n))}.

(iii) There exists anX-positive quantifier-free formulaϕ(x1, . . . , xk, y, z, t, X)in

LA+ such that

L={(s1, . . . , sk)|(s1, . . . , sk, O, O)∈I∃yϕ},

D={(s1, . . . , sk)|(s1, . . . , sk, O, O)∈I∀yϕ}.

Here, as usual, ¯α(n) stands for ¿ α(1), . . . , α(n) À. We can imagine the sequence α = α(1), α(2), . . . in (ii) as the sequence of the successive values, returned by the choice statement in the course of the computation. Clearly, if we have these values in advance, the execution ofP (no matter finite or infinite) over a fixed input (s1, . . . , sk) is uniquely determined. Our proposition (ii) says that

this execution can be carried out in some canonical way: compute successively Φ0s,α¯(0)), Φ1s,α¯(1)), . . . until you find the firstnfor whichΦns,α¯(n)) holds.

(Here and further, when saying that a formulaΦholds, we will mean that it holds in the relevant structure –AorA0.) Another way to formulate (ii) is to say that

some absolutely prime computable (cf. [5]) on Apredicate R exists, such that

L={¯s|∃αnR(¯s,α¯(n))}andD={|∀αnR(¯s,α¯(n))}.

In [6] it is shown that the relations Seq, N at, U, and the graph of φ are ∆0

1-positively inductively definable on A. Hence the sets I∀yϕ are in fact Π10-

positive inductive onA. Thus the equivalence between (i) and (iii) gives us also

a computational characterization of theΠ0

1-positive inductive definitions onA.

As for the sets of the type I∃yϕ, i.e., the sets that are Σ10-positive inductively

definable onA– in [7] it is shown that they coincide with the absolutely search

computable relations.

In the next section we prove the implication (i)(ii) of Theorem 1, in our last section are the proofs of (ii)⇒(iii) and (iii)⇒(i).

3

Syntactical characterization of the sets

L(P) and

D(P)