universal

Document Sample
universal Powered By Docstoc
					                                                 1
                                                 .




Complexity of Universal Programs


        Alain Colmerauer


         St. Petersburg, September 22, 2004




       Laboratoire d’Informatique de Marseille
          CNRS, Universités de Provence
                et de la Méditerranée
Contents                                                                                                                                  Definition of complexity and introspection coefficient . . . . . . . . . . . . . . . 37                                         2
                                                                                                                                          Keeping the same complexity and introspection coefficient . . . . . . . . . . . 38
What is a machine and a program? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3                  Existence and value of the introspection coefficient . . . . . . . . . . . . . . . . . . . . . . . . 39
        ..................................................................4                                                               Toward the labeling hypothesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
       A machine programmed for translating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5                                 Labeling hypothesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
       A machine programmed for multiplying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6                                   Vector B and Matrix A related to δ and ϕ . . . . . . . . . . . . . . . . . . . . . . . . . . 42
       A programmed machine is a dynamic system . . . . . . . . . . . . . . . . . . . . . . . . 7                                         Vector B and Matrix A related to δ and ϕ, next . . . . . . . . . . . . . . . . . . . . . 43
       Formal definition of a programmed machine . . . . . . . . . . . . . . . . . . . . . . . . . 8                                       Properties of A and B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
       The main functions of a programmed machine . . . . . . . . . . . . . . . . . . . . . . . 9                                         Main theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
       Simulation of a machine by another . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10                        Universal pair (U2 , code 2 ) for Turing machine with internal direction . . . . . . 46
Turing machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11         Presentation of (U2 , code 2 ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
       Alan Turing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12           Coding function code 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
       Current configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13                  How program U2 operates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
       Executed instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14                How program U2 operates, next 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
       Next configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15                 How program U2 operates, next 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
       Executed instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16                Architecture of program U2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
       Next configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17                 Graph of program U2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
       Program example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18                 Listing of program U2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
       Formal definition of a Turing machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19                                Listing of program U2 , next 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Turing machine with internal direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20                           Listing of program U2 , next 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
       Program example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21           Complexity and introspection coefficient of (U1 , code 1 ) and (U2 , code 2 ) . . 57
       Graph of a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22                  General complexity of (U1 , code 1 ) and (U2 , code 2 ) . . . . . . . . . . . . . . . 58
       Formal definition of a Turing machine with internal direction . . . . . . . . . 23                                                  Complexity of (U1 , code 1 ) and (U2 , code 2 ) on examples . . . . . . . . . . 59
Relationship between the two types of Turing machines . . . . . . . . . . . . . . . . . . . . 24                                          Introspection coefficient of (U1 , code 1 ) and (U2 , code 2 ) . . . . . . . . . . . 60
       Program transformations f1 and f2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25                         Universal pair (U3 , code 3 ) for arithmetic machine with indirect adressing . . 61
Arithmetic machine with indirect adressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26                               Execution of P3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
       Arithmetic machine with indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . 27                                     Execution of U3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Universal program and coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28                     Listing of program U3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
       Universal program for translating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29                           Listing of program U3 , next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
       Same universal program for multiplying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30                                  Complexity and introspection coefficient of (U3 , code 3 ) . . . . . . . . . . . . 65
       Definition of a universal pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31                       Matrix A and vector B for U3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Example of an universal program running on itself . . . . . . . . . . . . . . . . . . . . . . . . 32                                Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
       Translating program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33                 Open problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
       Input: English sentence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33                   Open problem, next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
       Universal program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34                 Final conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
       Input: translating program + English sentence . . . . . . . . . . . . . . . . . . . . . . 34
       Same universal program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
       Input: universal program + translating program + English sentence . . 35
Complexity and introspection coefficient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
                                   3
                                   .




What is a machine and a program?
4
                                                          5
A machine programmed for translating


Σ = { ,0,1,...,9,a,b,...,z}



        colorless green ideas sleeep furiously
        ⇓
                           Translating
                            program
                                        
                           
                           
                           
                           
                           
                           
                            instruction 1,
                                         
                                         
                                         
                                         
                                         
                                         
                            instruction 2,
                           
                                        
                                         
                           
                                        
                                         
                                        

                           . . .
                           
                                         
                                          
                                         
                                          
                           
                                         
                                          
                                         
                           instruction n 
                           
                                         
                                          
                                         

        ⇓
        des idees vertes incolores dorment furieusement
                                                             6
A machine programmed for multiplying


Σ = { ,0,1,...,9,a,b,...,z}



                  26010x37979721
                  ⇓
                                           Multiplying
                                            program
                                                        
                                       
                                       
                                       
                                       
                                       
                                       
                                        instruction 1,   
                                                         
                                                         
                                                         
                                                         
                                                         
                                        instruction 2,
                                       
                                                        
                                                         
                                       
                                                        
                                                         
                                                        

                                       . . .
                                       
                                                     
                                                      
                                                     
                                                      
                                       
                                                     
                                                      
                                                     
                                       instruction n 
                                       
                                                     
                                                      
                                                     

                  ⇓
                  9876543210
                                                           7
A programmed machine is a dynamic system




             x                                        y
             ↓                                        ↑
                                                  4
                − −→ c1 − −
            c0 − −       − −→ c2   ···           − −→ cn
                                           cn−1 − −
                                                                                                   8
Formal definition of a programmed machine

• A programmed machine is an ordered pair (M, P ), where M is a machine and P a program
for M.

• A machine M is a 5-tuple (Σ, C, α, ω, I), where
Σ, the alphabet of M, is a finite not empty set;
C, is a set, generally infinite, of configurations; the ordered pairs (c, c ) of elements of C are
   called transitions;
α, the input function, maps each element x of Σ to a configuration α(x);
ω, the ouput function, maps each configuration c to an element ω(c) of Σ ;
I, is a countable set of instructions, an intruction being a set of compatibles transitions, that is
   to say, whose first components are all distinct.


• A program P for a machine M is a finite subsets of the instructions set I of M, such that the
transitions of P are compatible. The set of configurations occurring in P is denoted by CP . A
configuration c of M is final for P , if there exists no transition of P starting with c.
                                                                                   9
The main functions of a programmed machine
Let M = (Σ, C, α, ω, I) be a machine and P a program for M. For all words x on Σ and
configurations c, c of C:
                                
                               the longuest sequence c0, c1, c2, . . . with
                                
                                
                                
            orbit M(P, x)    =
                              c = α(x) and each (c , c
                                0                   i i+1 ) an element of P .
                              


                                
                                ,
                                
                                
                                
                                     if orbit(P, x) is infinite,
            out M(P, x)      =
                              ω(c ), if orbit(P, x) ends with c
                              
                                  n                              n
                              


                                
                                
                                
                                
                                
                                
                                
                                 the shortest sequence of the form
                                 (c0, c1) (c1, c2) (c2, c3) . . . (cn−1, cn),
                                
                                
                                
                                
                                
                                
            track M(P, c, c ) = with c = c , each (c , c ) ∈ P , c = c ,
                                
                                
                                
                                
                                
                                             0           i i+1              n
                                
                                
                                 , if this shortest sequence does not exist,
                                
                                
                                



                                
                                the longest sequence of the form
                                
                                
                                
                                
                                
                                
                             = (c0, c1) (c1, c2) (c2, c3) . . .
                                
            track M(P, x)      
                               
                               with orbit(P, x) = c , c , c , . . . .
                               
                               
                                                          0 1 2
                               


                                
                               ∞,
                                
                                
                                
                                              if track (P, x) is infinite,
            cost M(P, x)     =
                              |track (P, x)|, if track (P, x) is finite,
                              
                              
                                                                                         10
Simulation of a machine by another


• Let M1 and M2 be two machines of same alphabet Σ and let P1 and P2 be the sets of their
programs.



• Definition Two programmed machines of the form (M1, P1) and (M2, P2) are equivalent if,
for all x ∈ Σ ,
                          out M1 (P1, x) = out M2 (P2, x),
                          cost M1 (P1, x) = cost M2 (P2, x).



• Definition The program transformation f1 : P1 → P2 simulates M1 on M2 if, for all P1 ∈ P1,
the programmed machines (M1, P1) and (M2, f1(P1)) are equivalent.
                 11
                  .




Turing machine
                                                                                     12
Alan Turing




Alan M. Turing, "On computable numbers with an application to the Entsheidungsproblem",
Proc. London Math. Society, 2, 42, pp. 230–265, 1936.
                             13
Current configuration




                        qi


                       YAX
                                        14
Executed instruction




                       [qi, ABR, qj ]
                          15
Next configuration




                    qj


                    YBX
                                        16
Executed instruction




                       [qi, ABL, qj ]
                           17
Next configuration




                      qj


                    YBX
                                                                                           18
Program example                                                        u u u o o i u u u
                                                                                   ↑
• With program                                                                     q2 P
                                   
                     
                       [q1, uuR, q ],
                                                                      u u u o o i u u u
                                  2 
                     
                                   
                                                                                 ↑
                     
                                   
                                    
                     
                                   
                                    
                                   
                     [q2, oiR, q ],
                                   
                                                                                 q3 P
                                   
                                  2 
                     
                                   
                     
                                   
                                    
                                   
                     [q , ioR, q2],
                     
                                   
                                    
                                   
                 P = 2
                                   

                    [q , uuL, q ], 
                                      ,                                u u u o o i u u u
                     2
                    
                    
                    
                                3  
                                    
                                    
                                                                              ↑
                                                                               q3 P
                     
                                       
                                        
                       [q3, ooL, q3],
                     
                                       
                                        
                     
                                       
                                        
                     
                                       
                                        
                                       
                       [q3, iiL, q3]
                     
                                       
                                        
                     
                                       
                                                                      u u u o o i u u u
                                                                             ↑
                                                                             q3 P
• and input
                         iio,                                          u u u o o i u u u
                                                                           ↑
• the machine moves through the sequence of configura-                      q3 P
tions
              u u u i i o u u u
                  ↑
                  q1 P
                                                        • and produces the result
              u u u i i o u u u
                    ↑                                                               ooi
                    q2 P

              u u u o i o u u u
                      ↑
                      q2 P

              u u u o o o u u u
                        ↑
                                                                                                  19
Formal definition of a Turing machine


A Turing machine has a 5-tuple of the form (Σ, C, I, α, ω) where,
 • Σ = Σu, with Σu = Σ ∪ {u},
 • C is the set of 4-tuples of the form [qi, ·x, a, y·], with qi being any state, x, y taken from Σu
   and a taken from Σu,
 • α(x) = [q1, ε, u, x], for all x ∈ Σ ,
 • ω([qi, ·x, a, y·]) is the longest element of Σ beginning y·,
 • I is the set of instructions denoted and defined, for all sates qi, qj and elements a, b of Σu,
   by
   [qi, abL, qj ] def {([qi, ·xc, a, y·], [qj , ·x, c, by·]) | (x, c, y) ∈ E},
                  =
   [qi, abR, qj ] def {([qi, ·x, a, cy·], [qj , ·xb, c, y·]) | (x, c, y) ∈ E},
                  =
   with E = Σu × Σu × Σu.
                                         20
                                          .




Turing machine with internal direction
                                                                                            21
Program example                                                        u u u o o i u u u
                                                                                   ↑
• With program                                                                     R q2 P
                                       
                     
                     
                      [q1, uu+, q2],   
                                        
                                                                      u u u o o i u u u
                                                                                 ↑
                     
                                       
                                        
                     
                                       
                                        
                                       
                     [q2, oi+, q2],
                                       
                                                                                 L q3 P
                     
                                       
                                        
                     
                                       
                                        
                     
                                       
                                        
                     [q , io+, q2],
                     
                                       
                                        
                                       
                 P = 2
                                       

                    [q , uu−, q ],
                                      ,                                u u u o o i u u u
                     2
                    
                    
                    
                                3  
                                    
                                    
                                                                              ↑
                                                                               L q3 P
                     
                                       
                                        
                       [q3, oo+, q3],
                     
                                       
                                        
                     
                                       
                                        
                     
                                       
                                        
                                       
                       [q3, ii+, q3]
                     
                                       
                                        
                     
                                       
                                                                      u u u o o i u u u
                                                                             ↑
                                                                             L q3 P
• and input
                         iio,                                          u u u o o i u u u
                                                                           ↑
• the machine moves through the sequence of configura-                      L q3 P
tions
              u u u i i o u u u
                  ↑
                  R q1 P
                                                        • and produce the result
              u u u i i o u u u
                    ↑                                                              ooi
                    R q2 P

              u u u o i o u u u
                      ↑
                      R q2 P

              u u u o o o u u u
                        ↑
                     22
Graph of a program




               









 [q1, uu+, q2], 
                
                
                
                
                
                
                
                

               
                
 [q2, oi+, q2],

               
                

               
                

               
                

               
                

               
                
 [q2, io+, q2],

               
                

               
                

               
                

[q , uu−, q ],
               
   2        3 

               

               
                

               
                

               
                
               
[q , oo+, q ], 

               
                
   3        3 

               

               
                

               
                
               
[q , ii+, q ] 

               
                
   3        3 

               
               
                                                                                                    23
Formal definition of a Turing machine with internal direction


A Turing machine, with internal direction, has a 5-tuple of the form (Σ, C, α, ω, I) where,
 • Σ = Σu, avec Σu = Σ ∪ {u},
 • C is the set of 5-tuples of the form [d, qi, ·x, a, y·], with d ∈ {L, R}, qi being a state, x, y
   taken from Σu and a taken from Σu,
 • α(x) = [R, q1, ε, u, x], for all x ∈ Σ ,
 • ω([d, qi, ·x, a, y·]) is the longest element of Σ beginning y·,
 • I is the set of instruction denoted and defined, for all states qi, qj , all elements a, b of Σu and
   all s ∈ {+, −}, by
   [qi, abs, qj ] def
                   =
   {([d, qi, ·xc, a, y·], [L, qj , ·x, c, by·]) | (d, s) ∈ E1 and (x, c, y) ∈ F }} ∪
   {([d, qi, ·x, a, cy·], [R, qj , ·xb, c, y·]) | (d, s) ∈ E2 and (x, c, y) ∈ F },
   wth E1 = {(L, +), (r, −)}, E2 = {(L, +), (R, −)} and F = Σu × Σu × Σu.
                                                        24
                                                         .




Relationship between the two types of Turing machines
                                                                                             25
Program transformations f1 and f2

• Let M1 and M2 be machines of same alphabet Σ, the first one of type Turing and the second
one of type Turing with internal direction and let P1 and P2 denote the sets of their programs.


• Property The program transformations g1 : P1 → P2 and g2 : P2 → P1, defined below,
strongly simulate M1 on M2 and M2 on M1 :
            g1(P1) def {[q2i−h, abs, q2j−k ] | [qi, abd, qj ] ∈ P1 and (h, k, d, s) ∈ E},
                   =
            g2(P2) def {[q2i−h, abs, q2j−k ] | [qi, abd, qj ] ∈ P2 and (h, k, s, d) ∈ E},
                   =
with                                                             
                                     (1, 1, +, R)
                                     
                                     
                                 def 
                                                 
                                                     (0, 1, −, R)
                                                      
                                                                   
                                                                    
                                                    ∪
                                                                  
                              E=                                     .
                                     (1, 0, −, L) (0, 0, +, L) 
                                     
                                     
                                                 
                                                                 
                                                                   




• Theorem 1 The program transformations f1 : P1 → P2 and f2 : P2 → P1, defined, for = 1
and = 2, by f = clean ◦ g , with g defined above, simulate M1 on M2 and M2 on M1 and
are such that
                  f2 ◦ f1 ◦ f2 ◦ f1 = f2 ◦ f1, f1 ◦ f2 ◦ f1 ◦ f2 = f1 ◦ f2.
                                             26
                                              .




Arithmetic machine with indirect adressing
                                                                                                                    27
Arithmetic machine with indirect addressing
Definition An indirect addressing arithmetic machine has a 5-tuple (Σ, C, α, ω, I) where,
 • Σ = {c1, . . . , cm},
 • C is the set of infinite sequences on natural integers of the form r = (r0, r1, r2, . . .),
 • α(a1 . . . an) = (0, 25, 1, . . . , 1, r24+1, . . . , r24+n, 0, 0, . . .), with r24+i equal to 1, . . . , m depend-
   ing whether ai equals c1, . . . , cm,
 • ω(r0, r1, . . .) = a1 . . . an, with ai equal to c1, . . . , cm depending whether ai equals 1, . . . , m,
   and satisfting the condition that n is the greatest integer such that rr1 , . . . , rr1+n are elements
   of {1, . . . , m},
 • I is the set of instructions denoted and defined, for all natural integers i, j, k, by:
                     def
   [i, cst, j, k]    = {(r, s ) ∈ C 2 | r0 = i, sj = k and si = ri elsewhere},
   [i, plus, j, k] def {(r, s ) ∈ C 2 | r0 = i, sj = rj +rk and si = ri elsewhere},
                     =
   [i, sub, j, k] def {(r, s ) ∈ C 2 | r0 = i, sj = rj ÷rk and si = ri elsewhere},
                     =
   [i, from, j, k] def {(r, s ) ∈ C 2 | r0 = i, sj = rrk and si = ri elsewhere},
                     =
                     def
   [i, to, j, k]     = {(r, s ) ∈ C 2 | r0 = i, srj = rk and si = ri elsewhere},
                                                     
                                                     r ,
                                                     
                                                      k     if rj = 0,
                     def            2
   [i, ifzero, j, k] = {(r, s ) ∈ C | r0 = i, s0 =  r +1, if r = 0
                                                                        and si = ri elsewhere},
                                                        0        j
                                                     

   with s equal to s except that s0 = s0 + 1 and with rj ÷rk = max{0, rj −rk }.
                               28
                                .




Universal program and coding
                                                                  29
Universal program for translating


Σ = { ,0,1,...,9,a,b,...,z}



     Translating program colorless green ideas sleeep furiously
     ⇓
                              Universal
                              program
                                       
                          
                          
                          
                          
                          
                          
                           instruction 1,
                                        
                                        
                                        
                                        
                                        
                                        
                           instruction 2,
                          
                                       
                                        
                          
                                       
                                        
                                       

                          . . .
                          
                                        
                                         
                                        
                                         
                          
                                        
                                         
                                        
                          instruction n 
                          
                                        
                                         
                                        

     ⇓
     des idees vertes incolores dorment furieusement
                                                            30
Same universal program for multiplying


Σ = { ,0,1,...,9,a,b,...,z}



                  Multiplying program 26010x37979721
                  ⇓
                                           Universal
                                           program
                                                      
                                         
                                         
                                         
                                         
                                         
                                         
                                          instruction 1,
                                                       
                                                       
                                                       
                                                       
                                                       
                                                       
                                          instruction 2,
                                         
                                                      
                                                       
                                         
                                                      
                                                       
                                                      

                                         . . .
                                         
                                                       
                                                        
                                                       
                                                        
                                         
                                                       
                                                        
                                                       
                                         instruction n 
                                         
                                                       
                                                        
                                                       

                  ⇓
                  9876543210
                                                                                      31
Definition of a universal pair

• Let M = (Σ, C, α, ω, I) be a machine and let us code each program P for M by a word
code(P ) on Σ.


Definition The pair (U, code), the program U and the coding function code, are said to be
universal for M, if, for all programs P of M and for all x ∈ Σ ,
                               out(U, code(P ) · x) = out(P, x) .


• If in the above formula we replace P by U , and x by code(U )n · x we get :
                        out(U, code(U )n+1 · x) = out(U, code(U )n · x)
and thus:


Property If (U, code) is a universal pair, then for all n ≥ 0 and x ∈ Σ ,
                              out(U, code(U )n · x) = out(U, x) .
                                                    32
                                                     .




Example of an universal program running on itself
                                                                        33
Translating program                           Input: English sentence




          1. Give to i the value 0.
                                        
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
          2. Increase i by 1.
      
                                        
                                         
      
                                        
                                         
                                        
                                                          colorless
      
                                        
                                         
      
                                        
                                         
                                        
          3. If i is greater than the num-
      
                                        
                                         
                                        
      
      
      
      
      
                                         
                                         
                                         
                                         
                                                         green idea
             ber of words to be tranlated,
      
                                        
                                         
      
      
      
                                         
                                         
                                                         s sleep fu
      
      
      
      
             go to 6.                     
                                          
                                          
                                                         riously
      
                                        
                                         
          4. Translate the ith word.
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
          5. Go to 2.
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
      
                                        
                                         
                                        
          6. Stop.
      
                                        
                                         
Universal program                                     Input: translating program + English
                                                                                        34


                                                 
                                                      sentence
   
   
   
   
        1. Give to n the value 0.                 
                                                  
                                                  
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        2. Increase n by 1.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
        3. Find instruction number n at the be-
   
                                                 
                                                  
                                                             1. Give to i the
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
           ginning of the input.
   
                                                 
                                                  
                                                 
                                                                value 0.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        4. If the found instruction is a halting
   
                                                 
                                                  
                                                             2. Increase i by
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
           instruction, go to 12.
   
                                                 
                                                  
                                                 
                                                                1.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        5. If the found instruction is of the
                                                 
                                                             3. If i is greater colorless
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
           form "if test then go to p", go to 8.
                                                 
                                                                than . . . , go to green idea
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
       6. Execute the found instruction.                      6.                 s sleep fu
                                                 
   
   
   
   
   
                                                  
                                                  
                                                  
                                                  
                                                                                  riously
                                                             4. Translate the
                                                 
        7. Go to 2.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                ith word.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
        8. Perform the test required by the
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                             5. Go to 2.
                                                 
           found instruction.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                             6. Stop.
                                                 
        9. If the test succeed, go to 2.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
       10. Give to n the value p.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
       11. Go to 3.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
       12. Stop.
   
                                                 
                                                  
                                                 
Same universal program                                Input: universal program + trans- 35


                                                 
                                                      lating program + English sentence
   
   
   
   
        1. Give to n the value 0.                 
                                                  
                                                  
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        2. Increase n by 1.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                       1. Give . . .
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        3. Find instruction number n at the be-
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                       2. Increase . . .
   
                                                 
                                                  
           ginning of the input.
                                                 
                                                                              1. Give to i the
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                                 value 0.
                                                 
                                                       3. Find . . .
   
                                                 
                                                  
        4. If the found instruction is a halting
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
           instruction, go to 12.
                                                 
                                                       4. If . . .            2. Increase i by
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                                 1.
   
                                                 
                                                  
                                                 
        5. If the found instruction is of the
                                                 
                                                       5. If . . .
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                              3. If i is greater colorless
                                                 
           form "if test then go to p", go to 8.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                       6. Execute . . .
   
                                                 
                                                  
                                                                                 than . . . , go to green idea
   
                                                 
                                                  
       6. Execute the found instruction.         
                                                                                                    s sleep fu
                                                       7. Go to 2.
                                                 
                                                                                 6.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                                                    riously
                                                 
        7. Go to 2.
   
                                                 
                                                  
   
                                                 
                                                  
                                                       8. Perform . . .       4. Translate the
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
        8. Perform the test required by the                                      ith word.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                       9. If the test . . .
   
                                                 
                                                  
                                                 
           found instruction.
   
                                                 
                                                  
   
                                                 
                                                  
                                                                              5. Go to 2.
   
                                                 
                                                  
                                                 
                                                      10. Give . . .
   
                                                 
                                                  
                                                 
        9. If the test is not true, go to 2.
   
                                                 
                                                  
   
                                                 
                                                  
                                                 
                                                                              6. Stop.
   
                                                 
                                                  
                                                 
                                                      11. Go to 3.
   
                                                 
                                                  
                                                 
       10. Give to n the value p.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
                                                      12. Stop.
   
                                                 
                                                  
                                                 
       11. Go to 3.
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
   
                                                 
                                                  
       12. Stop.
   
                                                 
                                                  
                                                 
                                          36
                                           .




Complexity and introspection coefficient
                                                                                           37
Definition of complexity and introspection coefficient

Let (U, code) be a universal pair for the machine M = (C, I, Σ, α, ω).


Definition Given a program P for M and a word x on Σ such that cost(P, x) = ∞, the
complexity of (U, code) is the real number denoted and defined by
                                         cost(U, code(P ) · x)
                               λ(P, x) =                       .
                                              cost(P, x)



Definition If for all x ∈ Σ , with cost(U, x) = ∞, the real number
                                                   cost(U, code(U )n+1 · x)
                    lim λ(U, code(U )n · x) = n→∞
                                               lim
                   n→∞                              cost(U, code(U )n · x)
exists and does not depend on x, then this real number is the introspection coefficient of the
universal pair (U, code).
                                                                                              38
Keeping the same complexity and introspection coefficient

• Let M1 be a Turing machine and M2 a Turing machine with internal direction and same
alphabet Σ.


• Let f1 and f2 be the program transformations of Theorem 1.


• Property If P1 = f2(P2) or P2 = f1(P1) and if (U2, code 2) is a universal pair for M2 then the
pair (U1, code 1) def (f2(U2), code 2 ◦ f1)
                  =
1. is universal for M1,
2. has a complexity λ1(P1, x), not defined or equal to the complexity λ2(P2, x) of the pair
   (U2, code 2), depending whether the real number λ2(P2, x) is not defined or defined,
3. admits the same introspection coefficient as (U2, code2) or does not admit an introspection
   coefficient, depending whether (U2, code2) admits or does not admit one,
4. is such that code 1(P1) = code 2(P2).
                                                      39
                                                       .




Existence and value of the introspection coefficient
                                                                40
Toward the labeling hypothesis




                                 out(P, x) = y
                 x                                       y
                 ↓                                       ↑
                     1       2          2        1   3
      code(P )·x    − −→•− −
                  •− −     − −→•− −− −→•− −       − −→•
                                           − −→•− −         y
          ↓       ↓      ↓       ↓       ↓      ↓           ↑
            1 1 4    3 2   2 3 3   2 3 3    3 2   3 3 1 5 5
          •→→→• →→ • →→→• →→→• →→ • →→→→→ •


                          out(U, code(P ) · x) = y
                                                                                             41
Labeling hypothesis


Let M = (Σ, C, α, ω, I) be a machine and (U, code) a universal pair for M



Hypothesis There exist
 • a synchronization function Φ : CU → CU , with Φ(c) final for U when c is final for U ,
 • a labeling function µ : ( U ) → (1..n) with n a positif integer and µ being surjective, such
   that µ(t1 . . . tk ) = µ(t1) . . . µ(tk ), for all t1 . . . tk ∈ ( U ) ,
 • an initial sequence of labels δ ∈ (1..n) , independent of x, such that
                    δ = µ(track (U, α(code(U )·x), Φ(α(x)))), for all x ∈ Σ ,

 • a label rewriting ϕ : 1..n → (1..n) such that, for all (c, c ) ∈ U ,
                              ϕ(µ(c, c )) = µ(track (U, Φ(c), Φ(c ))).
                                                                           42
Vector B and Matrix A related to δ and ϕ



                    
                b1 
                 
                  
                 · 
                  
                 
            B = · ,            bi = number of occurrences of i in δ.
                  
                 
                 · 
                 
                 
                 
                 
                   
                   
                   
                bn
                  



                           
               a11 . . .a1n 
                
                           
                ·        · 
                           
                
            A= ·         ·  , aij = number of occurrences of i in ϕ(j).
                           
                
                ·
                
                
                
                
                         · 
                            
                            
               an1. . .ann
                           
                                                                                43
Vector B and Matrix A related to δ and ϕ, next


• For example, for
                       x                                                    y
                       ↓                                                    ↑
                           1           2     2               1          3
       code(P )·x    − −→•− −
                   •− −     − −→•− −− −→•− −       − −→•
                                            − −→•− −         y
           ↓       ↓      ↓       ↓       ↓      ↓           ↑
             1 1 4    3 2   2 3 3   2 3 3    3 2   3 3 1 5 5
           •→→→• →→ • →→→• →→→• →→ • →→→→→ •



• with n = 5, we get                                           
                                   2
                                   
                                    
                                              0  
                                                 
                                                     0   1   0   0
                                   0
                                   
                                   
                                   
                                   
                                     
                                     
                                     
                                              1  
                                                 
                                                 
                                                 
                                                     1   0   0   0
                                                                   
                                                                   
                               B = 0 ,    A= 1      2   2   0   0 .
                                                                
                                                
                                                                
                                                                
                                   1         0      0   0   0   0
                                                                
                                                
                                                                
                                                                
                                   0          0      0   2   0   0
                                                                
Properties of A and B                                                                            44




• Property For all x ∈ Σ , with out(U, x) = , by introducing the column matrix,
                                  (k)
                                        
                             
                                x1      
                                                          

                                  ·                      number of occurrences of i
                                        
                                                    (k)
                                                           

                   X (k) =
                                                         
                                                           
                                  ·          ,     xi = 
                                        
                                        
                                                                                k
                                                        in µ(track (U, code(U ) ·x)),
                                  ·
                                        
                                                      
                                        
                                        
                                 xn
                                        



we have
                                                  X (k+1) = AX (k) + B



• Thus
               k             (k)                       cost(U, code(U )k+1 ·x)| ||X (k+1)||
cost(U, code(U ) ·x) = ||X         ||,           and                     k ·x)
                                                                               =      (k) ||
                                                                                             .
                                                        cost(U, code(U )          ||X
                                                                                                45
Main theorem

Here B and A are the vector and the matrix associated with β and ϕ.


Theorem 2 If the matrix A admits a real eigenvalue λ, whose multiplicity is equal to 1 and
whose value is strictly greater than 1 and strictly greater then the absolute value λ of the other
eigenvalues of A then:
                     ¯
  • the limit matrix A = limn→∞ ( 1 A)n exists, and is not everywhere zero,
                                  λ
        ¯
 • if ||AB|| = 0, the introspection coefficient of U exists and is equal to λ,
 • if is a real numbers such that λ < < λ and the Xi’s are column vectors defined by
                                                   1
                                   X0 = B, Xn+1 = AXn,
   then, when n → ∞,
                                                     ¯
                                             
                                             0, if ||AB|| = 0,
                                             
                                             
                                             
                                   ||Xn|| → 
                                             

                                                     ¯
                                            ∞, if ||AB|| = 0.
                                            
                                            
                                                                         46
                                                                          .




Universal pair (U2, code 2) for Turing machine with internal direction
                                                                                                47
Presentation of (U2, code 2)



• (U2, code 2) is a universal pair for the Turing machine with internal direction M2 with alphabet
                                             Σ = {o, i, z}.




• In order to assign a position to each instruction [qi, abs, qj ] of a program, we introduce the
numbers:                             
                                       
                                       
                                       
                                       
                                       
                                        1,   if a = u
                                        2,   if a = o
                                       
                                       
                                                          π(i) = 1 (f (i, o) + f (i, i)),
                                       
                π(i, a) =   4(i − 1) +               ,
                                       

                                       3,
                                       
                                            if a = i            2
                                       
                                       
                                       4,   if a = z
                                       
                                       


defined for all positive integers i and symbols a ∈ {u, o, i, z}.
                                                                                               48
Coding function code 2
• Let P2 be a program for M2 and let P2 = f1(f2(P2)). We take code 2(P2) = code 2(P2), with
code 2(P2) the word on {o, i, z}:
                            zI4nz . . . zIk+1zIk zIk−1z . . . zI1zoi . . . izz,
where n is the number of states of P2, and the size of the shuttle oi . . . iz equals the longest
size of the Ik ’s minus 5,
• where, for all a ∈ Σu and i ∈ 1..n,
                           
                           [qi, abs, qj ], if there exists b, s, j with [qi, abs, qj ] ∈ P2,
                           
                           
                           
                           
               Iπ(i,a)   =
                          oi,
                          
                          
                                           otherwise,

• with,                                    
                                           
                                           
                                           
                                              iam . . . a2o, if π(j) − h(i, a) > 0,
                         [qi, a, b, s, qj ] = 
                                              oa . . . a i, if π(j) − h(i, a) < 0,
                                              
                                                 2        m
                                              



• with a2a3 equal to io, oi, ii, depending whether b equals u, o, i, z,
• with a4 = o or a4 = i depending whether s = + or s = −,
• with iam . . . a5 a binary number (o for 0 and i for 1) whose value is equal to
                                                          3
                                      |π(j) − π(i, a)| + .
                                                          2
How program U2 operates                                                                           49




• Initial configuration of P2
                                               · · · uu x uu · · ·
                                                      ↑
                                                      R q1 P2




• Initial corresponding configuration of U2
                                                  code(P )

                     . . . uu zI4nz . . . zIk+1zIk zIk−1z . . . zI1zoi . . . izz   x   uu . . .
                            ↑
                            R q1 P2                                  shuttle
How program U2 operates, next 1                                                                                    50




• Current configuration of P2
                                                     v     a w
                                                           ↑
                                                           d qi P2


• Current corresponding configuration of U2
                                                         standard shuttle
                                                                                                                  (1)
                            v   uzzI4nz . . . zIk+1zIk zd u . . . uzIk−1z . . . zI1zu w
                                                    ↑
                                                    L q24 U2

or
                                                  reversed shuttle
                                                                                                                  (2)
                            v   uzzI4nz · · · zIk+1zu . . . ud zIk zIk−1z · · · zI1zu w
                                                                ↑
                                                                R q24 U2

depending whether Ik , with k = π(i, a), is in the standard form iam . . . a2o or in the reversed form iam . . . a2o.
The read-write points to a3 or to the z which follows Ik when Ik is the empty instruction oi. Depending whether
d is equal to L or R, the symbol d is equal to u or o, if Ik is standard, and to o or u, if Ik is reversed.
How program U2 operates, next 2                                                         51




• Final configurations of P2
                                                 b y u
                                                 ↑
                                                 d qm P2




• Final corresponding configurations of U2
                         uzzI4nz · · · zIk+1zu . . . ud zIk zIk−1z · · · zI1zu y u
                                                                             ↑
                                                                             R q23 P2




with Ik = oi, k = π(m, b) and d equal to o or u, depending whether d equals L or R.
Architecture of program U2                                                         52



                                        I Instruc-
             0   A Start       8        tion orien         1           J End   9
                                        tation test
                                                       B Shuttle
                 I         H Shuttle
                 N                                     direction
                           reversing
                 S                                     updating
                 T                                                         I
                 R                                                         N
                 U                                                         S
                               7                           2               T
                 C
                 T                                                         R
                 I                                                         U
                           G Shuttle                    C Shuttle          C
                 O
                 N          counter                      counter           T
                           decreasing                 initialization       I
                 L                                                         O
                 O                                                         N
                 C             6                           3
                 A                                                         E
                 L                                                         X
                 I                                                         E
                           F Moving                   D Writing,           C
                 Z
                 A          shuttle                    moving,             U
                 T         to next z                   reading             T
                 I                                                         I
                 O                                                         O
                 N                      E Shuttle                          N
                               5
                                         counter           4
                                        updating
Graph of program U2                                                                                                                                                                                53



        uu+
        ii+
                                                                                                                                                                   u                           i
        oo+                                                                                                                                              o         o         o   u             u
                                                                                                                                                         o         +         u i i             +
        9                                                                                                                                          uu+   +                   + o +
                                                                                                                                                                               +
                                                                                                                                                   ii+
                       uu+                 uu+                             uu+                           uu−                                                                   o
                                                                                                                                                   oo+         o             u i i
                       ii+                 ii+                             ii+       ii+                 io+         ii+                                       u   o         o +u              u   i
                                       o                                                                                           uu+                   u         u         +   +             i   i
                       oo+    u        i   oo+       i             o       oo+       oo+                                                                 u     +                                   +
        +                     u                      u             u                                     oi+         oo+                                           +                           +
        u                     +                      +             +                                                               oo+                   −
        u                              −
                                                                                                                                                   uu+
                                       i                 u     u                                                                                                       u                  u
                                                         i     o                                                           u       ii+         u   ii+   u             u                  u
                                       o                                                         i             u i                       o     u         u
                       i                                 +u    +                     u   u       u             i i     u   i   o   uu+   o         oo+
                                                                                                                                                               u       +         u        +
                 i     u               −                   u                         u   u                                 +   i
                                                                                                                                               −         −     u                 u
                 i                               i                     o                 +   o   −             + −     u                 −     i               +                 +
                                                 u                     u
                       −                                   −                         −
                 +                                                                           o                         +       −               u         ui−
                                                 −                     −                     +                                                 −         ou−
        1                              o                           u             u               2       o                         i      3    o         iu−
                                                                                                                                                                                 4
                 o                     o                           u             o                       o             u           i           u         uo−
                 o                     +                                   oo+   +                       +             o
    o        i   +
                                                                   −                                            o          u
                                                                                                                                   −           −
                                                                                     uo+                        o      +   u                   u   oo+   u
    o        i                                                             ii+                                                                 u         u               i               o
    +        +                                                                                                  −          +                       ii+
                                                                           uu+                                                                 −         −               o               o
                                                                                                                                                                       u −       a       − u
                                                                                                                                                   uu+                 u                   u
         d                                                                                                                                               u             −                   +
                                                                                                                     oo+                                 u                   i       o
                                                                                                                                                         −                   u       o
    o        i u                                                                                                     ii+                                                     +       +
    o        i u                                                                                                                                   oo+                 o                  i
    +        − +                                                                                                                                                       u                  u
                                                                                                                                                   ii+                 −         b        +
         c                                                                                                                                         uu+
                                                                                                                                                                                 i        o
                                                                                                     i                                                                           i        o
                                   u                                                                 u                                                                           +        +
                                   u                                                                 −           o             u o i
        u                          +                     u     i                                                 o             u o i
                                                         u     o                                     u           +                                                               i
        u                     u            i                   +                                     o                         + + +
        +                     u                          −
                                                                                                     +                                                                 uu+       o
                 u            −        o   u                                                         o                     u                                                     −
                 i      d              u   +                                                         i                     i                                                             oi+
                                                     u                                       i               i     o                               u                   oo+
                                                                                             i       +                     −                       u
                                                     u                                                             u
                 −                     −
                                                                   iu+                                       o                                                         ii+
i o u                                                −                                       +               + o u +                               −
u o i   8                                  7                               6                 u                 u o
                                                                                                             u ++ u                      5
+ + +                                                              oo+           u                                                 u               u
                                                                                 u           i               i     u               u               u
        u        u                     u                                                     +       i       +     +       u             uu+
        u        o                     u                 o         uu+           −
                                                                                                     u
                                                                                                                                   −               +
        +               c                                i                                                                 o                                   i   u                           o       u
                 −            u        −                                                             +                                   oo+                   u   u                           u       u
                              u                          +                                           u                     −
                                                                                                                                                                                               +
         7                    −                                                                      u           u             u o i     ii+                   −   −                                   −
                                   u                                                                 +           u             u o i
        u                          u                                                                 o           +             + + +
        u        uu+               +                                                                 u
        −                                                                                            −
                 oo+         o i
        0                    o i
                 ii+         + +

                 uu+
Listing of program U2                                           54



54 states and 184 instructions
# A BEGINNING
[X0,uz+,A1],    [X0,oo+,A1],   [X0,ii+,A1],    [X0,zu-,X7],
                [A1,oo+,A1],   [A1,ii+,A1],    [A1,zz+,X0],
                                               [X7,zz+,X8],

# B INSTRUCTION TAIL COPYING
               [X1,oo+,B1],   [X1,ii+,B1],
               [B1,oo+,B5],   [B1,iu-,B2],
               [B2,oo+,B2],   [B2,ii+,B2],     [B2,zz+,B3],
               [B3,oi-,B4i], [B3,io-,B4i],
[B4o,uo+,B5], [B4o,oo+,B4o], [B4o,ii+,B4o],    [B4o,zz+,B4o],
[B4i,ui+,B5], [B4i,oo+,B4i], [B4i,ii+,B4i],    [B4i,zz+,B4i],
[B5,uu-,B6],   [B5,ou-,B4o], [B5,iu-,B4i],     [B5,zz-,B7],
               [B6,oo+,B4o], [B6,ii+,B4i],
# Replacement of the remaining u’s by o’s
[B7,uo+,B9],   [B7,oo+,B7],   [B7,ii+,B7],     [B7,zz+,B7],
[B9,uo+,B9],   [B9,oo+,X2],                    [B9,zz-,B10],
               [B10,oo+,B10], [B10,ii+,B10],   [B10,zz+,B9],

# C INSTRUCTION HEAD COPYING
# Creating the symbol to be written
               [X2,oo+,C2],   [X2,iu-,C1],
[C1,ui+,C2],   [C1,oi+,C1],   [C1,io+,C1],     [C1,zu-,C1],
               [C2,oo-,C3o], [C2,ii-,C3i],
[C3o,uo+,C4], [C3o,oo+,C3o], [C3o,ii+,C3o],    [C3o,zu+,C4],
[C3i,uz+,C4], [C3i,oo+,C3i], [C3i,ii+,C3i],    [C3i,zi+,C4],
# Taking in account the direction
               [C4,oi-,C5],   [C4,ii-,X3],
[C5,uu+,C6],   [C5,oo+,C6],   [C5,ii+,C6],     [C5,zz+,C6],
               [C6,oo-,X3],
Listing of program U2, next 1                                    55




# D WRITING, MOVING AND READING
# Writing and reading
[X3,uu-,D1u], [X3,ou-,D1o], [X3,iu-,D1i],      [X3,zu-,D1z],
[D0,uu-,D1z], [D0,ou-,D1i], [D0,iu-,D1o],      [D0,zu-,D1u],
[D1u,uu-,X4], [D1u,oo+,D1u], [D1u,ii+,D1u],    [D1u,zz+,D1u],
[D1o,uo-,X4], [D1o,oo+,D1o], [D1o,ii+,D1o],    [D1o,zz+,D1o],
[D1i,ui-,X4], [D1i,oo+,D1i], [D1i,ii+,D1i],    [D1i,zz+,D1i],
[D1z,uz-,X4], [D1z,oo+,D1z], [D1z,ii+,D1z],    [D1z,zz+,D1z],
# Moving
                                               [X4,zu+,D2z],
                 [D2u,ou+,D2o], [D2u,iu+,D2i],
[D2o,uo+,D2u],   [D2o,oo+,D2o], [D2o,io+,D2i], [D2o,zo+,D2z],
[D2i,ui+,D2u],   [D2i,oi+,D2o], [D2i,ii+,D2i], [D2i,zi+,D2z],
[D2z,uz+,X3],    [D2z,oz+,D2o], [D2z,iz+,D2i], [D2z,zz+,D2zz],
[D2zz,uz+,D0],   [D2zz,oz+,D2o],

# E SHUTTLE UPDATING
# Beginning of the updating
               [X4,oo-,E1b],    [X4,io-,E1a],
[E1a,uz-,E2a], [E1a,oz-,E2b],   [E1a,iz-,X6], [E1a,zz-,X5],
[E1b,uz+,X5], [E1b,oz+,X6],     [E1b,iz+,E2b], [E1b,zz+,E2a],
# End of the updating
               [E2a,oo+,E2b],   [E2a,iu+,E2b],
               [E2b,oo+,E4],    [E2b,ii+,E4],
               [E4,oi+,E4],     [E4,io-,E5],   [E4,zz-,X7],
[E5,uu+,E5],   [E5,oo+,E5],     [E5,ii+,E5],   [E5,zz-,X6],
Listing of program U2, next 2                                       56




# F SUTTLE MOVING TO NEXT z
[X5,uu+,X5],   [X5,oo+,X5],     [X5,ii+,X5],     [X5,zz-,F1],
[F1,uz+,F2u], [F1,oz+,F2o],
[F2u,uu+,F2u], [F2u,ou+,F2o],   [F2u,iu+,F2i],   [F2u,zu+,F3],
[F2o,uo+,F2u], [F2o,oo+,F2o],   [F2o,io+,F2i],   [F2o,zo+,F3],
[F2i,ui+,F2u], [F2i,oi+,F2o],   [F2i,ii+,F2i],   [F2i,zi+,F3],
               [F3,oz-,F4o],    [F3,iz-,F4i],    [F3,zz-,X6],
[F4o,uu+,F4o], [F4o,oo+,F4o],   [F4o,ii+,F4o],   [F4o,zo-,F1],
[F4i,uu+,F4i], [F4i,oo+,F4i],   [F4i,ii+,F4i],   [F4i,zi-,F1],

# G SHUTTLE DECREASING
[X6,uu+,G1],   [X6,oo+,G1],     [X6,iu+,G1],
[G1,uu-,X7],   [G1,oi+,G1],     [G1,io+,X5],     [G1,zz-,X8],

# H SHUTTLE REVERSING AFTER BLANK SYMBOLS INTRODUCTION
[X7,uu-,E2a], [X7,ou-,E2b], [X7,iu+,X7],
[E2a,uu+,E2a],                               [E2a,zz-,I1],
[E2b,uu+,E2b],                               [E2b,zz-,I2],
[I1,uo-,X8],
[I2,ui-,X8],

# I INSTRUCTION ORIENTATION TEST AFTER BLANK SYMBOLS INTRODUCTION
[X8,ui+,X8],   [X8,oo+,X8],   [X8,iu+,X8],   [X8,zz+,I1],
               [I1,oo+,I2],   [I1,ii-,I2],
               [I2,oo+,X1],   [I2,ii+,X1],   [I2,zz+,X5],

# J END OF THE PROGRAM
                                                 [X1,zz+,X9],
               [X9,oo+,X9],     [X9,ii+,X9],     [X9,zz+,X9]];
                                                                           57
                                                                            .




Complexity and introspection coefficient of (U1, code 1) and (U2, code 2)
                                                                                              58
General complexity of (U1, code 1) and (U2, code 2)

• Let (U1, code 1) be the universal pair (f2(U2), code 2 ◦ f1) for the Turing machine M1 of same
alphabet Σ = {o, i, z} then M2.

• U1 has 361 instructions and 106 states, while U2 has 184 instructions and 54 states.

• For = 1 and = 2, and any program P for M ,
                                   |code (P )| = O(n log n) ,
where n is the number of states of clean(P )).

• There exists a positive real number k, not dependent on x ∈ Σ , such that
                                      λ (P , x) ≤ n log2 n


• If m = |code (P )|, then there exists a positive real number k, not dependent on x ∈ Σ , such
that
                                      λ (P , x) ≤ m log m
                                                                                             59
Complexity of (U1, code 1) and (U2, code 2) on examples

• For = 1 and = 2.
               cost( cost(U ,      cost(U , code (U )·           λ (U ,
             x                                         λ (P , x)
               P , x) code (P )·x) code (P )·x)                  code (P )·x)
             ε   2       5 927         22 974 203      2 963.50    3 876.19
             o   6       13 335        51 436 123      2 222.50    3 857.23
            oi   12      23 095        88 887 191      1 924.58    3 848.76
           oiz 20        35 377        136 067 693     1 768.85    3 846.22
          oizo 30        49 663        190 667 285     1 655.43    3 839.22

•

• Here P , with P1 = f2(P2), is a reversing program of 32 instructions and 9 states, such that,
for all n ≥,
                             out(P2, a1a2 . . . an) = an . . . a2a1,
with the ai’s taken from {o, i, z}.

• For = 1 and = 2, |code (P )| = 265 and |code (U )| = 1552.
                                                                                              60
Introspection coefficient of (U1, code 1) and (U2, code 2)
• In order to satisfy our Hypothesis, code 2(U2) = f1(f2(code 2(U2))) and the labeling function
µ is defined so that, for all transitions (c1, c2) and (c1, c2) of M2, the integers µ(c1, c2) and
µ(c1, c2) are equal if and only if together:
 • the states of c1 and c1 are equal,
 • the symbols pointed by the read-write heads in c1 and c1 are equal,
 • the symbols pointed by the read-write heads in c2 and c2 are equal,
 • the directions in c2 and c2 are the same.

• The function Φ is defined, for all configuration of U2, with P2 = U2 by,
                   
                   current configuration corresponding to c, if c is not final for P2,
                   
                   
                   
                   
           Φ(c) = 
                  final configuration corresponding to c, if c is final for P .
                  
                                                                           2
                  



• After having computed the column vector B and the matrix A, using Theorem 2, we have
verified that U2 admits an introspect coefficient and computed its value: for = 2 and all words
x on Σ such that cost(P, x) = ∞,
                                 cost(U , code (U )n+1 ·x)
                             lim
                            n→∞ cost(U , code(U )n ·x)
                                                           = 3672.98

• This result also holds for = 1.
                                                                             61
                                                                              .




Universal pair (U3, code 3) for arithmetic machine with indirect adressing
Execution of P3                          Execution of U3                             62




• Current configuration                   • Current corresponding configuration
    R0 R1 R2                                 R0 R1 R2
    0 3 2                                    50               P         0 3 2

                                                                       
                 
                 
                 
                 
                 
                 
                  [0, plus, 2, 1],  
                                    
                                    
                                    
                                    
                                    
                                                        [0, cst, 8, 0],
                                                        
                                                        
                                                        
                                                        
                                                        
                                                        
                                                                          
                                                                          
                                                                          
                                                                          
                                                                          
                                                                          
                                                                       
                  [1, cst, 11, 1],                      [1, cst, 10, 2],
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                  [2, from, 5, 2],                      [2, cst, 11, 11],
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                  [3, ifzero, 5, 8],                    ...
                 
                                   
                                                       
                                                                         
                                                                          
                 
                                   
                                                       
                                                                         
                                                                          
                                                                       
           P3 = 
                 [4, sub, 5, 11], 
                                    
                                     
                                                   U =
                                                       [99, cst, 0, 49],
                                                                          
                                                                           
                                                                           
                
                                    
                                                     
                                                                          
                                                                           
                
                                    
                                                     
                                                                          
                                                                           
                 [5, to, 2, 5],                       [100, plus, 9, 1], 
                
                                    
                                                     
                                                                          
                                                                           
                                    
                                                                         
                
                                    
                                                     
                                                                          
                                                                           
                
                                    
                                                     
                                                                          
                                                                           
                 [6, plus, 2, 11],                   [101, from, 9, 9], 
                
                                    
                                                     
                                                                          
                                                                           
                                                                        
                
                                    
                                                     
                                                                          
                                                                           
                
                                    
                                                     
                                                                          
                                                                           
                                                                        
                 [7, cst, 0, 1]                       [102, plus, 1, 9]
                
                                    
                                                     
                                                                          
                                                                           
                                    
                                                                         
                                                                           




• Next current configuration              • Next current corresponding configuration
     R0 R1 R2                                R0 R1 R2
     1 3 5                                   50               P         1 3 5
Listing of program U3                                                                       63




  # INITIALISATION             # INCREASING THE              # CASE WHERE a=3
  # OF THE REGISTERS           # SOURCE POSITION R[1]        [34,ifzero,5,36],
  [0,cst,8,0],                 [16,plus,1,9],                [35,cst,0,40],
  [1,cst,10,2],                # CASE STUDY ACCORDING        [36,plus,2,9],
  [2,cst,11,11],               # TO THE VALUE a OF R[R[1]]   [37,sub,4,9],
  [3,cst,12,20],               [17,from,3,1],                [38,to,2,4],
  [4,cst,13,26],               [18,to,1,8],                  [39,cst,5,1],
  [5,cst,14,33],               [19,plus,3,11],               [40,cst,0,15],
  [6,cst,15,67],               [20,from,0,3],                # END
  [7,cst,16,68],               # CASE WHERE a=1              [41,to,1,8],
  [8,cst,17,70],               [21,ifzero,5,24],             [42,cst,4,1],
  [9,cst,18,76],               [22,cst,5,0],                 [43,plus,4,1],
  [10,cst,19,82],              [23,cst,4,0],                 [44,cst,6,25],
  [11,cst,20,88],              [24,plus,4,4],                [45,to,4,6],
  [12,cst,21,94],              [25,plus,4,9],
                               [26,cst,0,15],                # PROGRAM EMULATION
  # ENCODING OF THE            # CASE WHERE a=2              # SKIP INCREMENTATION
  # EMULATED PROGRAM           [27,ifzero,5,30],             # OF THE INSTRUCTION COUNTER
  # INITIALISATION OF THE      [28,cst,5,0],                 [46,cst,0,49],
  # SOURCE POSITION R[1] AND   [29,cst,4,0],                 # INCREASING
  # THE BOOLEEN VALUE c        [30,plus,4,4],                # THE INSTRUCTION COUNTER
  [13,cst,2,24],               [31,plus,4,9],                [47,from,6,1],
  [14,cst,5,1],                [32,plus,4,9],                [48,plus,6,9],
  [15,cst,0,16],               [33,cst,0,15],                [49,to,1,6],
Listing of program U3, next                                                             64




                                                             [84,from,5,5],
  # COMPUTING THE POSITION      [65,cst,6,15],
                                                             [85,plus,5,1],
  # OF INSTRUCTION NB ZERO      [66,plus,6,3],
                                                             [86,from,5,5],
  [50,from,7,1],                [67,from,0,6],
                                                             [87,to,4,5],
  [51,cst,6,25],                # NO INSTRUCTION
                                                             [88,cst,0,46],
  [52,plus,6,7],                [68,cst,0,99],
                                                             # TOINDIRECT INSTRUCTION
  [53,plus,6,7],                # CONSTANT INSTRUCTION
                                                             [89,from,4,4],
  [54,plus,6,7],                [69,to,4,5],
                                                             [90,plus,4,1],
  # HALTING TEST                [70,cst,0,46],
                                                             [91,plus,5,1],
  [55,cst,7,0],                 # PLUS INSTRUCTION
                                                             [92,from,5,5],
  [56,plus,7,1],                [72,plus,5,1],
                                                             [93,to,4,5],
  [57,sub,7,6],                 [73,from,5,5],
                                                             [94,cst,0,46],
  [58,ifzero,7,100],            [74,plus,6,5],
                                                             # IFZERO INSTRUCTION
  # COMPUTING a:=R[R[6]],       [75,to,4,6],
                                                             [95,from,4,4],
  [59,from,3,6],                [76,cst,0,46],
                                                             [96,ifzero,4,98],
  # COMPUTING b:=R[R[6]]+R[1]   # MINUS INSTRUCTION
                                                             [97,cst,0,46],
  [60,plus,6,9],                [77,from,6,4],
                                                             [98,to,1,5],
  [61,from,4,6],                [78,plus,5,1],
                                                             [99,cst,0,49],
  [62,plus,4,1],                [79,from,5,5],
                                                             # END
  # COMPUTING c:=R[R[4]+2];     [80,sub,6,5],
                                                             [100,plus,9,1],
  [63,plus,6,9],                [81,to,4,6],
                                                             [101,from,9,9],
  [64,from,5,6],                [82,cst,0,46],
                                                             [102,plus,1,9].
  # CASE STUDY ACCORDING        # FROMINDIRECT INSTRUCTION
  # TO THE VALUE OF a           [83,plus,5,1],
                                                                                              65
Complexity and introspection coefficient of (U3, code 3)
• Property There exists a positive number k such that, for all programs P3 and word x on Σ,
with cost(P3, x) = ∞,
                                      cost(U3 , code 3 (P3 )·x)             |code(P
                         λ(P3, x) =        cost(P3 , x)           ≤ 35 + k cost(P3, )|
                                                                                    x)

• On particular examples we have obtained the following results:
                cost( cost(U3,       cost(U3, code 3(U3)·          λ(U3,
              x                                           λ(P3, x)
                P3, x) code 3(P3)·x) code 3(P3)·x)                 code 3(P3)·x)
              ε   12       2 372            72 110         197.66     30.40
              o   16       2 473            74 758        154, 56     30.23
             oi   31       2 860            84 916         92.26      29.69
            oiz 35         2 961            87 564         84.60      29.57
           oizo 50         3 348            97 722         66.96      29.19
where P3 is a reversing program of 21 instructions such that, for all n ≥ 0
                              out(P3, a1a2 . . . an) = an . . . a2a1,
with the ai’s taken from {o, i, z}. For information, |code 3(P3)| = 216 and |code 3(U3)| = 1042.
• As introspection coefficient we have obtained:
                                     cost(U3 , code(U3 )n+1·x)
                              limn→∞ cost(U3, code(U3)n·x)            = 26, 27
Matrix A and vector B for U3                                                                                                     66



                                                                                                                          
          4    4   4     4    4   4   4    5   5     5    5   5    5    5    5   5     5    5   5    5    5          1967 
                                                                                                                          
          9   11   10   11   11   8   9   10   12   11   12   12   9   10   10   12   11   12   12   9   10          4085 
                                                                                                                          
                                                                                                                           
                                                                                                             
                                                                                                                          
          1    1   2     1    1   1   1    1   1     2    1   1    1    1    1   1     2    1   1    1    1          310 
                                                                                                                          
                                                                                                                           
                                                                                                             
                                                                                                                          
          6    8   8     8    8   6   7    7   9     9    9   9    7    8    7   9     9    9   9    7    8          2041 
                                                                                                                          
                                                                                                                           
                                                                                                             
                                                                                                                          
          
          2    2   2     2    2   1   1    2   2     2    2   2    1    1    2   2     2    2   2    1    1
                                                                                                             
                                                                                                                       1329 
                                                                                                                            
                                                                                                                           
                                                                                                             
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   1   0    0   0     0    0   0    1    0    0   0     0    0   0    1    0          708 
                                                                                                                           
                                                                                                             
                                                                                                                          
                                                                                                                          
          1    1   1     1    1   1   2    1   1     1    1   1    1    2    1   1     1    1   1    1    2          311 
                                                                                                                           
                                                                                                             
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                     
                                                                                                                           
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                     
                                                                                                                           
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                     
                                                                                                                           
                                                                                                                          

     A=   0                                                                                                     B=
          
                0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0
                                                                                                                     
                                                                                                                         0 
                                                                                                                             
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                      
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                     
                                                                                                                           
                                                                                                                          
          0    0   0     0    0   0   0    1   1     1    1   1    1    1    1   1     1    1   1    1    1            0 
                                                                                                                          
                                                                                                                     
                                                                                                                           
                                                                                                                          
          0
          
                0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0
                                                                                                                     
                                                                                                                         0 
                                                                                                                             
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                     
                                                                                                                           
                                                                                                                          
                                                                                                                          
          0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0            0 
                                                                                                                          
                                                                                                                      
                                                                                                                          
                                                                                                                          
           0    0   0     0    0   0   0    0   0     0    0   0    0    0    0   0     0    0   0    0    0             0
                                                                                                                          
             67
              .




Conclusion
                                                                                              68
Open problem



• Given a first universal pair (U, code) for a Turing machine M, by "cheating", it is possible to
construct a second universal pair (U , code ) for M with instrospection coefficient equal to 1.



• A first way of "cheating" consists of taking U = U and
                                            
                                            ε,
                                            
                                            
                                                     if P = U ,
                               code (P ) = 
                                           code(P ), if P = U .
                                           



Then
                          cost(U , code(U )n+1 · x) cost(U , x)
                                                      =             =1
                           cost(U , code(U )n · x)      cost(U , x)
and (U, code ) is a universal pair with introspection coefficient equal to 1.
                                                                                            69
Open problem, next

• A second way of "cheating" consists in keeping code = code and constructing a program U ,
which, after having erased as many times as possible a given word z occurring as prefix of the
input, behaves as U on the remaining input. According to the recursion theorem it is possible
to take z equal to code(U ) and thus to obtain a universal program U such that, for all y ∈ Σ
having not code(U ) as prefix,
                           cost(U , code(U )n · y) = nk1 + k2(y),                          (3)
where k1 and k2(y) are positive integers, with k1 not depending on y. Thus we have :
                cost(U , code(U )n+1 · y) cost(U, x) + (n + 1)k1 + k2(y)
                                  n      =                               =
                 cost(U , code(U ) · y)      cost(U, x) + nk1 + k2(y)
                                               k1
                                1+                          .
                                   cost(U, x) + k2(y) + nk1
By letting n tend toward infinity we obtain an introspection coefficient equal to 1 for the pair
(U , code ).

• Open problem How to express in the definition of the introspection coefficient that the func-
tion code and the program U should not distinguish the case P = U from the case P = U .
                                                                                              70
Final conclusion


• Given the fact that a Turing machine with a universal program models the way our brain
operates,



• given the fact that we should think about what we intend to say,



• given the fact that the introspection coefficient of our universal Turing program is 3673,



• do not think twice before you speak, but 3673 times.

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:32
posted:9/16/2012
language:English
pages:70