String Rewriting and Metabolism: A Logical ... - Semantic Scholar

32 downloads 0 Views 227KB Size Report
Formal Grammars, DNA Computing, Molecular Computing, Arti cial Life. 1 Introduction ... is the nal language (usually all the strings of a nite alphabet of terminal.
String Rewriting and Metabolism: A Logical Perspective Vincenzo Manca

Universita di Pisa Dipartimento di Informatica Corso Italia, 40 - 56125 Pisa - Italy e-mail: [email protected]

Keywords and Phrases: String Rewriting, Formal Systems, Formal Languages, Formal Grammars, DNA Computing, Molecular Computing, Arti cial Life.

1 Introduction String rewriting is the basis of formal language theory [15], [16], where symbolic systems introduced by Chomsky [3], Marcus [11], Lindenmayer [9], and Head [7] with their main variants and related formalisms [4], [5], [6], [14], seem to amount, according to reasonable taxonomic and enumerative criteria, to several thousands of di erent types. However, all these systems can be easily reduced to the following common structure: S = (L0 ; ) ; Lf ) where L0 is the initial (usually nite) language, ) is the re exive and transitive closure of the rewriting relation ) (on the strings of some alphabet), and Lf is the nal language (usually all the strings of a nite alphabet of terminal symbols). The distinguishing feature of this system is the rewriting relation: its combinatorial schema (replacement, insertion, splicing); its sequential or parallel nature; its rules and regulation strategy; and its generative mechanism, usually expressed by the generated language L(S ): L(S ) = f 2 Lf j 9 2 L0 ( ) )g: We indicate in this paper how a general and rigorous de nition of a string generative system, based on the above triple, can be developed in logical terms. In such a perspective, we indicate how all the important aspects of the usual 1

systems can be formally and uniformly described. A rewriting relation ) can be logically represented if it is possible to determine a suitable rst order model M and a rst order formula ' such that: ) i '( ; ) holds in M: This paper outlines some initial steps which derive from this de nition. Section 2 introduces the notion of representability within rst order models and gives some introductory examples. Section 3 presents the logical representation of typical syntactical relations and provides the logical characterization of classical classes of formal languages. Section 4 shows the computational universality of three di erent notions of logical representability. These notions are based on: i) the standard syntactic model SYN on the domain ! of nite strings of natural numbers, ii) the theory RRR inspired by Raphael Robinson's arithmetical theory RR, and iii) the (SYN)1 -formulae resembling the 1 -formulae of arithmetical hierarchy. Due to the aforementioned universality results, it is reasonable to de ne a set or a relation as (logically) ! -representable i it is representable according to one of these three methods. Therefore, ! -representability is the key concept for a general, logical de nition of (string) generative system: it is a system (L0 ; ) ; Lf ) where all three components are ! -representable. We will develop in a future work a detailed analysis of the most important string rewriting systems (not only generative), aimed at showing that each of them is completely and naturally described in logical terms. However, the examples and the results given in the present paper constitute a well founded basis for a rigorous, logical analysis of rewriting. Our approach implies the possibility of uni cation and comparison of wellknown symbolic systems, and provides a natural framework where di erent aspects of classical systems could be naturally combined and integrated into new computational formalisms and Arti cial Life models [13]. Moreover, logical rewriting can be extended to deal with the new perspectives opened by DNA and molecular computing. To this end, we show that an interesting notion of metabolism, suggested by chemical and biochemical processes, can be formalized in terms of logical representability within a rst order model which extends SYN. In this model, called META, several important phenomena, such as distribution, cooperation, and complex levels of syntactical aggregation, can easily be expressed. The nal section introduces the basic de nitions and presents some examples which illustrate this potentiality of logical rewriting.

2 Logical representability Assume the `marvelous' 7 logical symbols:

!; :; ^; _; $; 8; 9

with the standard syntactical and semantical rst order logical notions (equality predicate = is assumed in its usual usage) that can be found in introductory treatises or basic chapters of textbooks in mathematical logic (cf., for example, [1], [2], [8], or [17]). We recall that j= is the predicative formalization of proof consequence ), according to the speci c sense developed by mathematical logic. More precisely this symbol has two di erent, though related, meanings. We write:

M j= ' to mean validity w.r.t. models, inasmuch as it expresses that the formula ' holds in the model M, assuming that all the symbols of ' can be interpreted in M (' is a (M)-formula, where (M) is the signature of the model M). A natural extension of this meaning is:

M j=  where  is a set of formulae, which expressees that M j= ' holds for any formula ' of . The second meaning of j= is the rst order logical validity. In this sense:  j= ' means that for all rst order models (more exactly -models, if  is the signature of the language of ):

M j=  ) M j= ': The two meanings are related, in fact if we put: Th(M) = f jM j= g then (M j= ') , (Th(M) j= ') Given a formula '(x) with a free variable x and an individual term t, we indicate by '(t) the formula obtained from '(x) by replacing in it all the occurrences of x with the individual term t.

De nition 2.1 Let  be a signature and M be a -model. A subset S of the domain of M is represented in M by the formula '(x) with a free variable x when: a 2 S , M j= '(a) 3

Note that '(a) is generally a formula in the signature which extends  with the elements of the set S considered as new individual constants. In the same manner we could de ne the representability of properties and relations within a given model.

Notation 2.1 When a set, or a relation, is representable within a model M by a formula ' that belongs to a class ? of formulae, we say that it is Mrepresentable, by ?. Let AR be the standard arithmetical model:

AR = (!; +; ; 0; 1) where ! is the set of natural numbers, + and  denote the plus and times operations on natural numbers respectively, and 0 and 1 denote numbers zero and one respectively. As usual, we may use, ambiguously, the same symbols to indicate either the symbols of a signature , or the corresponding functions, relations and individuals of a -model. Example 2.1 The set of prime numbers is represented in AR, by the following formula of the rst order language of signature f+; ; 0; 1g: 8y z (:x = 1 ^ (x = y  z ! x = y _ x = z)) Notation 2.2 S M ' indicates that ' represents S within M. When the model M is clearly understood, the subscript M may be omitted.

The following example is a list of very simple formalizations within the standard arithmetical model AR, where P(n) means that n is a prime number, jP j = @0 means that the set of prime numbers is denumerable, and is Cantor's pairing function (cf. [17]):

Example 2.2

x  y  9z(x + z = y) x = 0  8y(x + y = y) jP j = @0  8x9y(P(y) ^ y  x): < x; y >= z  (z + z = (x + y + 1)  (x + y) + x + x) In order to develop a logical representation of syntactical notions we introduce the following model SYN which we call the standard syntactic model: SYN = (! ; ??; j j; 0; ) where ! is the set of nite strings of natural numbers, ( ; ) abbreviated by is the concatenation of strings and , and j j is the length of string , and 4

0;  are the constants for zero and the empty sting. In this model numbers can be conceived as symbols of an in nite alphabet !, therefore any language can be embedded in its domain (we may identify 0; 1; 2; .. .with letters a; b; c; .. .). We write: (i) = n to say that symbol (number) n occurs in the string at position i,  to say that is a substring of , i.e., the string constituted by the symbols of which occur between two (not necessarily distinct) positions; and a 2 i a  and jaj = 1.

Example 2.3

y 2 !  (jyj = jjyjj) (x(i) = y)  9yz(x = zyw ^ y 2 ! ^ jzyj = i) (x  y)  9zw(y = zxw) (x 2 y)  (x  y ^ jxj = 1) (x + y = z)  9uv(x = juj ^ y = jvj ^ z = juvj):

Example 2.4 The languages fanbnjn 2 !g; fanbncnjn 2 !g are SYN-representable: 2 fanbn jn 2 !g  9xy( = xy ^ jxj = jyj ^ 8uv((u  x ^ juj = 1 ! u = a) ^ (v  y ^ jvj = 1 ! v = b)) 2 fanbn cnjn 2 !g  9xyz( = xyz ^ jxj = jyj ^ jxj = jz j ^

8uvw((u  x ^ juj = 1 ! u = a) ^ (v  y ^ jvj = 1 ! v = b) ^ (w  z ^ jwj = 1 ! w = c))) Note that with the representation of + in SYN we inherit in it all the arithmetical relations whose de niens uses such a function symbol. The following example is more complicated. How can we represent the product between natural numbers in terms of relationships among strings? We can get a solution to this question by representing the natural process of calculating a product by means of iterated sums. In fact if m  k = n, there exists a sequence of natural numbers m; m  m; m  m  m; : : :; of length k that ends with n.

Example 2.5

mk = n  9w(jwj = k ^ w(1) = m ^ 8x(x < k ! w(x + 1) = w(x) + m) ^ w(k) = n) 5

The idea of the previous example has a wide application. Moreover, notice that the simple structure of the formula representing multiplication is mainly due to the possibility of SYN-representing computations directly (thus avoiding all kinds of syntax encoding, e.g. Godel's -function, cf. [17]). In fact, we have:

Example 2.6 The following relations are representable in the model SYN, where k is the k-th prime number, G(n; m; k) indicates that m is a prime number, and mk is the maximum power of m that is divisor of n: n = mk n = m! n = k G(n; m; k):

3 Logical Syntax of Formal Languages Let us assume the classical notions of formal language theory, for further details see [15] [16]. We only recall brie y some basic de nitions in order to x notations. Given a nite alphabet A of symbols, A = fa1 ; : : :; ang, we can embed it into a nite subset NA of natural numbers by means of a one-to-one mapping f between A and NA . In this manner a corresponding one-to-one mapping f 0 between A and NA  is de ned in the natural way: f 0 () = f() =  f 0 (ai ) = f(ai )f 0 ( ) for each ai 2 A; 2 A Therefore, we can consider languages over alphabet A as particular subsets of the free monoid ! . This embedding allows us to represent syntactic properties in the model SYN. Let us consider a Chomsky grammar G = (T; N; P; S), where T is the nite alphabet of terminals, N is the nite set of nonterminals, P is the nite set of productions ! , with 2 V + , 2 V  (V  being the free monoid generated by V , and V + = V  ? fg) and, nally, S 2 N is the start symbol. From S and replacing iteratively in a string the left side of a production with the right one, a grammar G generates a type-0 language L(G) constituted by all 2 T  generated from S with a nite number of replacements. Type-0 languages coincide with the recursively enumerable subset of T  , i.e. the subsets generated by some process that is e ective w.r.t. some universal computation formalism. 6

A substitution f is a mapping from a nite alphabet A to the powerset of A: f : A ! 2A Thus f associates some language with each symbol of A. Such a mapping can naturally be extended to string in A in the following manner (here juxtaposition indicates concatenation between languages): f() =  f(ax) = f(a)f(x); a 2 A; x 2 A Further, we can also extend f to languages L  A by de ning f(L) = [x2L f(x) If f(a) is a singleton for all a 2 A, then we say that f is a homomorphism in A, and we identify f(a) with its unique element. Consider the following syntactical relation:  sub( ; i; j; ) means that the string is the substring of starting at position i + 1 and ending at position j: [i; j] = ; i < j For example:

z }| {

= b a b c a d b; with i = 2 and j = 6

 occur( ; a; n) means that in the string the symbol a occurs exactly n times:

j ja = n

 homf ( ; ) means:

f( ) = where f is a string homomorphism.  perm( ; ) means that is a permutation of . The following lemma will be useful in our discussion. Lemma 3.1 Syntactical relations: sub; occur; perm; and homf are SYNrepresentable.

Proof.

7

 sub

( [i; j] = )  (i = j ! = ) ^ (i < j

 occur

! (9 ;  ( =  ^ j j= i ^ j j= j)))

(j ja = n)  9(j j = n ^ 8i(1  i  n $ ((i)) = a))

^8i  j j( (i) = a ! 9j  n((j) = i))  perm perm( ; )  8x(x 2 $ x 2 ) ^ j j = j j ^ 8x(x 2 ! j jx = j jx)

 homf f( ) =  ( =  ! = ) ^ ( 6=  ! (

9  8 i (i  j j ! [(i); (i + 1)] = f( (i))) )

Example 3.1 homomorphism: f(c) = ab; f(d) = ccc; f(e) = 

c

d

e

c

d

e e

7

8

c

(i) ( )

#

#

# #

#

# #

#

#

1

2

3

4

5

6

ab ccc  ab ccc   a b 1 2 3 4 5

6 7

8 9 10

11 12

( ) ([ (i);  (i + 1)])

0 2 5 5 7 10 10 10 12 1 2 3 4 5

6

7

8

9

( ) (i)

A Dyck language is a context-free language generated by a grammar Gk = ffa1; a2; : : :; ak; b1; b2; : : :; bk g; fS g; P; S g where P consists of productions fS ! SS, S !  ; S ! ai Sbi j1  i  kg. L(Gk ) can be considered as the language of correct strings over parentheses of k types (where ai and bi are each pair of left and right parentheses of type i). 8

Example 3.2 Given the Dyck expression = (3 (1 )1 )3 (2 )2 we can

associate with it a sequence of strings where the rst one is , and each of the others is obtained from the previous one by deleting a pair of parentheses:

0 = (3 (1 )1 )3 (2 )2 1 = (3 )3 (2 )2 2 = ( 3 ) 3 Put:

Corresp (p; q)



(

p = (1 ^ q =)1

)

_

p = (2 ^ q =)2 ) _ : : : _ ( p = (k ^ q =)k ) where the formula Corresp (p; q) depends on the parentheses constituting the language D (k denotes the number of kinds of parentheses in the language Dk ). The following instances of  and  relate to the Dyck sequence in the example: (

 =

1

2

(3

3

(1

)1

 = 0 6 10 12 1 2

3

4

4

)3

5

(2

6

)2

7

(3

8

)3

9

(2

10

)2

11 (3

(i)

[(1); (2)] = [0; 6] = 0 [(2); (3)] = [6; 10] = 1 [(3); (4)] = [10; 12] = 3 In general, the rst order formalization of Dk is the following:

2 Dk  ( = ) _ (9 p; q ( = pq ^ Corresp (p; q)) _ ( j j> 2 ^ 9 ;  ([(1); (2)] = ^

9 p; q ([((j j ? 1)); (j j)] = pq ^ Corresp (p; q)) ^ 8 i (1  i  (j j ? 2) ! 9 ; ; r; s ([(i); (i + 1)] = rs ^ [(i + 1); (i + 2)] = ^ Corresp (r; s))))): 9

12 )3

The following theorem gives us a rst result of logical representability for an important class of formal languages. Theorem 3.2 Any regular language is SYN-representable. Proof. Let us consider a regular language L(e) described by means of a regular expression e. We give the formalization of relation 2 L(e) by induction over the structure of expression e: 1. if e = fg, then 2 L(e)  = ; 2. if e = fag, a 2 A then 2 L(e)  = a; 3. if e = e1 + e2 , with relations 2 L(e1 ) and 2 L(e2 ) already formalized, then 2 L(e)  2 L(e1 ) _ 2 L(e2 ) 4. if e = e1 e2 , with relations 2 L(e1 ) and 2 L(e2 ) already formalized, then 2 L(e)  9 ; ( = ^ 2 L(e1 ) ^ 2 L(e2 )) 5. if e = (e1 ) , then we build an auxiliary array of integers to express = 1 2 : : : n; this allows us to formalize 2 L , provided that the formalization of i 2 L is already available: ( 2 L(e))  9  ( 8 i ( 1  i  (j j ? 1) ! [(i); (i + 1)] 2 L(e1 ))) Q.E.D.

From the examples and theorems given so far we can easily obtain the following theorem. Theorem 3.3 Any context-free language is SYN-representable. Proof. A language L is context-free if and only if there exists a homomorphism h, a Dyck language D and a regular language R such that L = h(D \ R). Therefore, it is sucient to combine the representability into SYN of Dyck languages, of regular languages and of homomorphisms. Q.E.D. From this and previous results, we can deduce the representability of any type-0 language L in the model SYN. In fact, we know [16] that L = h(L1 \ L2 ) for a suitable homomorphism h and two context-free languages L1 ; L2 . However, by using the techniques already introduced we also have a direct proof of this general theorem. Theorem 3.4 Any type-0 language is SYN-representable. 10

Proof. (Sketch) Let L be a language generated by a type-0 grammar G. A

string belongs to L if there exist two strings and , the rst one constituted by the concatenation of all strings of a derivation of , the second one (whose length is the length of the derivation + 1) being a vector that allows us to extract from , for every pair of values of consecutive indices, the derivation steps of . In order to characterize all strings of L and only them, it is sucient to express that, for any derivation of them, any step is obtained from the previous one by applying some production of G. This is easily representable by a simple logical condition expressed by concatenation and existential quanti cation. Q.E.D. Is any SYN-representable language a type-0 language? If not, which class of formulae represents type-0 languages? In order to answer these questions, we will extend the notion of rst order representability.

4 Three Logical Characterizations of Computational Universality In this section we extend the notion of logical representability by introducing: i) representability within a theory and ii) axiomatic representability. We then show that there is a class of formulae, indicated by (SYN)1 such that SYNrepresentability by this class is computationally universal, i.e. identi es the class of type-0 languages. Moreover, this representability is equivalent to the representability within a particular theory called RRR by (SYN)1 , and is also equivalent to the axiomatic representability within RRR. Let us recall some basic notions about rst order theories. A set  of -formulae is recursively enumerable (r.e.) or semidecidable if we have an algorithm that will e ectively generate all the formulae of . It is decidable or recursive i we have an algorithm for deciding when a given -formula belongs to  or not, or equivalently, i we can e ectively generate all the formulae of  and all the -formulae that do not belong to . A -theory  is a set of formulae closed w.r.t. the rst order logical consequence, that is, for every -formula:  j= ' ) ' 2 . If AX is a decidable (recursive) set, then  is an axiomatic theory (if AX is nite,  is nitely axiomatizable). Given the e ective nature of rst order logical consequence (for the deductive completeness of proof systems), the set of theorems of an axiomatizable theory is recursively enumerable. A theory  is axiomatizable i  = f'jAX j= 'g for some r.e. set of formulae AX called axioms of . A -theory  is complete i , for any -formula ',  j= ' or  j= :' holds ( is sound i it is not the case that both conditions hold). A very simple, but fundamental result establishes that any axiomatizable and complete theory is also decidable. 11

We can extend the notion of logical representability of sets (and relations) by the following de nition. Let T be the set of terms without variables on the signature . De nition 4.1 Let  be a theory over the signature . A subset S of T is represented in , by the formula '(x) with a free variable x, when: a 2 S ,  j= '(a):

Notation 4.1 When a set is representable within a theory  by a formula ' that belongs to a class ? of formulae, we say that it is -representable by ?.

An interesting case of representability within a theory is axiomatic representability: De nition 4.2 A subset S of T is -representable by a nite set of axioms AX if for some formula ' in the signature of  [ AX : a 2 S ,  [ AX j= '(a): A set S is axiomaticallyrepresentable when it is AX-representable by some nite set of axioms AX. Of course, representability within a theory and axiomatic representability can naturally be extended to any relation.

Remark 4.1 We use symbols  and  (meaning the usual order on natural numbers and the substring inclusion respectively) as abbreviations, according to the formal representations, in terms of +; ??, given in Examples 2.2 and 2.3.

Consider the following theory RRR on the signature f!; ??; jj; g where ! indicates a denumerable set of constants for natural numbers (denoted by the usual symbols). This theory is strongly related to Raphael Robinson's arithmetical theory RR (R? in [17]), and consists of the following axiom schemata, where given k constants n1; : : :; nk 2 ! with k  1, then (n1 ; : : :; nk) stands for the left-associated term ((: : :(n1 n2) : : :)nk ), and if k = 1, then (n1 ; : : :; nk) has to be considered equivalent to n1. That is, we identify left-associated terms (without variables) of RRR with the elements of ! .

 (n1 : : :nk ) (m1 : : :mh ) = (n1 : : :nk m1 : : :mh )  (n1 : : :nk )  =  (n1 : : :nk ) = (n1 : : :nk )  jj = 0  j(n1 : : :nk )j = k  :(n1; : : :; nk ) = (m1 : : :mh )

for any (n1 ; : : :; nk ) 6= (m1 : : :mh ) 2 ! 12

 8x(x  n $ (x = 0 _ x = 1 _ : : : _ x = n))

W

 8x(x  (n1 : : :nk ) $ ij k x = (ni : : :nj ) _ x = ) The following are interesting examples of rst order axiomatic representabilities, where a; b; and c stand for any three natural numbers. Example 4.1 fanbnjn 2 !g is RRR-representable by the following axioms:  L()  8x (L(x) ! L(axb)) In fact: 2 fanbn jn 2 !g , RRR [ AX j= L( ).

Example 4.2 fanbncn jn 2 !g is RRR-representable by the following axioms:  L()  8x y (L(xby) ! L(axbbyc)) In fact: 2 fanbn cnjn 2 !g , RRR [ AX j= L( ). In general we can prove that:

Theorem 4.1 Any type-0 language is axiomatically RRR-representable. Proof. Let G be the grammar of a type-0 language L with terminal symbols a1; : : :; an and start symbol S (write ! 2 G to say that ! is a production of G). Consider the following axioms AX in a signature which extends that of RRR with a unary predicate D: AX = fD(S)g [ fD(x y) ! D(x y)j ! 2 Gg In this manner we have: 2 L , RRR [ AX j= D( ) ^ 8x(x 2 ! x = a1 _ : : : _ an) Q.E.D.

The next example shows the expressive power of RRR-axiomatic representability.

Example 4.3

2 fap j p is a prime numberg , RRR [ AX j= L( ) where AX are the following axioms:

13

 8x R(x; x)  8x y (R(x; y) ! R(x; xy))  8x ( L(x) $ 8z(z 2 x $ z = a) ^ 8x y(y  x ! (:R(y; x))) Consider the following abbreviations:

8x  t :'  8x(x  t ! ') 8x  t :'  8x(x  t ! ') 9x  t :'  9x(x  t ^ ') 9x  t :'  9x(x  t ^ ')

where the term t is said to bound the quanti ers (a normal quanti cation considered as an unbounded quanti cation). A formula ' of the signature (AR) of AR is a (AR)1 -formula, or in brief, according the standard usage, a 1 formula i it is constructed starting from atomic formulae by means of connectives, bounded universal quanti cations and either unbounded or bounded existential quanti cation. Analogously, a (SYN)-formula formula ' over the signature (SYN) of SYN is a (SYN)1-formula i any universal quanti cation that occurs in it is a bounded quanti cation. For the sake of brevity, we refer to 1 and to (SYN)1 as the set of 1 -formulae and the set of (SYN)1 -formulae respectively. The most important fact about 1-formulae is a theorem strictly connected to Kleene's Normal Form Theorem in Computability theory (cf. Th. I.11.7 and related topics in [17]): A set L of natural numbers is recursively enumerable i it is AR-representable by some 1-formula. 1 -formulae and (SYN)1-formulae, are intrinsically related to the RR theory, which we report below, and to the already considered RRR theory. These theories allow us to analyze fundamental arithmetical and syntactical notions in terms of logical representability. Robinson's RR rst order arithmetical theory of signature f!; +; g, where as for RRR ! is a denumerable set of constants, consists of the following axiom schemata:  n+k = m i AR j= n + k = m  nk =m i AR j= n  k = m  :n = m for all n 6= m 2 !  8x(x  n $ (x = 0 _ x = 1 _ : : : _ x = n)) for all n 2 ! 14

De nition 4.3 A theory  is 1-sound i for every 1-formula ':  j= ' ) AR j= ' De nition 4.4 A theory  is (SYN)1-sound i for every (SYN)1-formula ':  j= ' ) SYN j= ' Theorem 4.2 1 -completeness of RR Let ' a 1 -formula with k free variables and let n1; : : :; nk 2 !, then: AR j= '(n1; : : :; nk ) , RR j= '(n1 ; : : :; nk ) Proof. By induction on the complexity of ' (see Th. III.6.13 in [17]). Corollary 4.3 If  is a 1-sound extension of theory RR, then it is also a 1-complete theory.

Theorem 4.4 (SYN)1-completeness of RRR Let ' a (SYN)1 -formula with k free variables and let 1; : : :; k 2 ! , then: SYN j= '( 1 ; : : :; k) , RRR j= '( 1 ; : : :; k)

Proof. By induction on the complexity of ', analogously to the proof of the

1-completeness of RR. Corollary 4.5 If  is a (SYN)1-sound extension of theory RRR, then it is also a (SYN)1 -complete theory. Now we can prove that the three notions of: SYN-representability by (SYN)1 formulae, RRR-representability by (SYN)1-formulae, and axiomatic RRRrepresentability are equivalent each to other inasmuch as all of them are universal, i.e. a language is type-0 i it is logically representable according to one of these methods. De nition 4.1 A language L, is a subset of A for some nite alphabet A  !.

Theorem 4.6 A language L is type-0 i it is SYN-representable by a (SYN)1-

formula.

Proof. A recursively enumerable set L of strings is generated by some e ective device (a Turing Machine or a type-0 grammar). We avoid going into details, because, in any case, we can express any step of the computation process which generates a string 2 L by some string, and thus we can express the generation process by the sequence of these strings. This means that we have a string and a string  such that the length of  is equal to the steps of the computation,

is the concatenation of all the sequences representing the steps, and for each i 15

such that 1  i  j j, the substring representing the i-th step is located between positions (i); (i + 1) of . Moreover, the string representing i + 1-th step has to be obtained from the one representing step i-th by some symbolic transformations speci ed by the particular generation method. All these properties of

and  can easity be expressed formally in the model SYN by some (SYN)1 formula. Conversely, i L is SYN-represented by some (SYN)1-formula, then for (SYN)1-completeness of RRR it is also RRR-representable by this formula. Therefore, for the recursive enumerability of the theorems of an axiomatizable theory, L is recursively enumerable. Q.E.D.

Theorem 4.7 A language L is type-0 i it is RRR-representable by some (SYN)1 -formula.

Proof. It follows from the previous theorem and from the (SYN)1 -completeness of RRR. Q.E.D.

Theorem 4.8 A language is axiomatically RRR-representable i it is type-0. Proof. We have already shown that any type-0 language is axiomatically RRRrepresentable. Conversely, if the language is RRR-representable by some nite set of axioms AX, then theory RRR [ AX has a recursively enumerable set of

axioms, hence the language is recursively enumerable, therefore it is a type-0 language. Q.E.D.

The previous three theorems suggest the following de nition. De nition 4.5 A language L is (logically) ! -representable if one of the fol-

lowing conditions holds:  L is SYN-representable by (SYN)1

 L is RRR-representable by (SYN)1  L is axiomatically RRR-representable. Theorem 4.9 All syntactical relations considered in the previous section are logically ! -representable.

Proof. It is sucient to check that all the formulae considered are or can be equivalently transformed into (SYN)1-formulae, and therefore, for the previous theorems, they are ! -representable. Q.E.D. Our logical characterizations of type-0 languages are very close to an analogous representation theorem formulated in terms of rudimentary predicates (cf. [16] Ch. III Th. 12.5, and [18]). A rudimentary predicate is essentially determined by a (SYN)1 -formula where no symbol j j occurs. The representation 16

of a language via rudimentary predicates is equivalent to its representability by (SYN)1 , with no occurrence of j j within the following model: (! ; ? ?; $) where $ denotes a predicate that holds on atomic strings (i.e. single numbers). This equivalence is a straightforward consequence of the next theorem. Theorem 4.10 j j = j j is representable in the model (! ; ? ?; $) by a (SYN)1formula with no occurrence of j j.

Proof. (Informal) We can express that two strings have the same length by

using an auxiliary symbol, say ]. Assume that and are not empty and not atomic. Let us say that a string is monic i it is constituted only by occurrences of the symbol ], and that a monic string is a full substring of a string  when it occurs in  as a substring that is not a proper substring of another monic string. Under these assumptions j j = j j i there are two strings 0 ; 0 that satisfy the following requirements:  both 0 and 0 begin with one symbol followed by ], and end with a monic substring;  a monic can occur only once in 0 as its full substring;  a monic is a substring of 0 i it is a substring of 0 ;  i ] is a full substring of 0, then also is a full substring of 0 which precedes ] (from the left);  given a monic , let ]], ], and be full substrings of 0 and 0 , and let 1 ; 2 and 1 ; 2 be the pairs of strings such 1 ] 2  ` and

1 ] 2  `. In this case: 2 is obtained from 1 by adding to it only one (rightmost) symbol; analogously, 2 is obtained from 1 by adding to it only one (rightmost) symbol;  and are the two strings that in 0 and 0 are between the two rightmost (monic) full substrings;  the two ending monic strings of 0 and 0 are equal. For example, if = abc and = cbb, the strings 0 and 0 considered above are: 0 = a]ab]]abc]]] 0 = c]cb]]cbb]]] It is easy to verify that we can put together all these conditions in a (SY N)1 formula with no occurrences of j j. Q.E.D. 17

5 Logical Metabolism In this section we show that logical rewriting can be extended to metabolic rewriting, if a model META, more powerful than SYN, is considered, where not only the syntactical structure of strings, but also localization relations (distribution and encapsulation) between strings can be represented. The most important mathematical aspect of metabolic rewriting is that at any step a nite language, rather than a single string, is rewritten. This means that classical generative systems are particular metabolic systems, and in turn, it is possible to associate a canonic metabolic system with any generative system. It is sucient that at any step of a generative process, we keep all generated strings in a language L, and consider a rewriting step from a string 2 L to a string as the passage from L to L [f g. Model META allows us to express the abstract form of transformations that holds in chemical and biochemical processes. The reader can nd in [10] the original motivations to logical metabolism along with examples showing its chemical and biochemical relevance. Here we only want to stress its natural relationship with logical rewriting, therefore, we consider the basic de nitions and revisit in metabolic terms some classical examples. Consider the following structure: META = (F ;

Suggest Documents