• Nenhum resultado encontrado

Reversible languages SRL and ESRL – FAQ

N/A
N/A
Protected

Academic year: 2023

Share "Reversible languages SRL and ESRL – FAQ"

Copied!
6
0
0

Texto

(1)

Reversible languages SRL and ESRL – FAQ

Armando B. Matos email: armandobcm@yahoo.com

January 16, 2012

Whenever we talk about “the language SRL” we mean “the language or the language ERSL”.

1. What is the language SRL?

– SRL, “Simple Reversible Language”, is a register language where each register may contain an arbitrary (possibly negative) integer.

A program P is a sequence of zero or more instructions, and each instruction can have the following forms: “x+” (“increment” in- struction, the value inx is incremented by 1), “x−”, (“decrement”

instruction, the value inx is decremented by 1), and “(Q)x” (“for”

instruction, the programQis executedxtimes1). In the last instruc- tion, the program Q can not modify x, that is, it can not contain neither “x+” nor “x−”. The ESRL also has the additional instruc- tion “x↔y” (swaps the values contained in the registers x and y).

In an (P)x instruction, the program P can not contain instructions of the forms “x+”, “x−’, “x↔y”, or “y↔x”.

2. What is the meaning of (P)x when x contains a negative

– If x has a non-negative value, it means P;P;. . . P, where “P” oc- curs x times; that is, execute x times the program P. If x < 0 it is defined as P−1;P−1;. . . P−1, that is, execute the inverse pro- gram−xtimes. This definition has a number of nice properties, such as (P)m; (P)n≡(P)r, where r has the valuem+n.

3. What is the inverse of a programP? integer?

– It is defined inductively as follows: (P;Q)−1 =Q−1;P−1, (x+)−1= x−, (x−)−1 = x+, (x ↔ y)−1 = x ↔ y, ((P)m)−1 = (P−1)m.

1In some languages this instruction is written “for(x)P;”

(2)

For any program P, the program P;P−1 is equivalent to the null program.

4. Why is the language SRL important?

– It is very simple (in fact, as simple as possible, without being trivial), reversible, and total (every program halts). In a sense, it corresponds to the reversible version of the “loop language” [13]. So, we argue, the transformations that can be implemented with the SRL language correspond to the primitive recursive functions; they may be called the “primitive recursive reversible transformations”.

Another characteristic of SRL programs is that it does not need an ad-hoc mechanism (for instance, auxiliary memory) to ensure re- versibility, as it has been done, for instance, for the Turing machines in [1]); it is “naturally reversible”.

5. Transformations of what?

– Of tuples of Zninto tuples of Zn. See the examples in [11].

6. What is a linear SRL program and what transformations can it imple- ment?

– It is a program where there are no nested “for” instructions. Apart from possible constants, the input and output values of the registers are related by a positive modular matrix (SRL language) or by a modular matrix (ESRL language).

More generally, a program in which the maximum nesting of “for”

instructions isL is called a level Lprogram.

7. Does a program of level 2 implement a quadratic transformation?

– Not necessarily; it may even be an exponential transformation, see the Example 8 in [11].

8. What is the “equivalence problem”?

– The equivalence problem is the following: given the programs P andQ, isP equivalent toQ? That is, is the bijection induced inZ the same?

It is unknown whether this problem is decidable. (it is decidable for certain restricted classes of programs, for instance for programs of level at most 1). On the other hand, it can be shown that the de-

(3)

are the same: if one of them is decidable, the other is also decidable.

Clearly, both problems belong t the class Σ1. 9. What is the “commutativity problem”?

– Given the programs P and Q, is “P;Q” equivalent to “Q;P”?

10. Can the increment instruction “x+” be implemented with a program that, at the outer most level has only “for” instructions?

– No (easy). If all the loop variables of the outer most “for” instruc- tions (which, in particular, may bex) have the initial value 0, thenx does not change when the program is executed.

11. What can you tell about the execution time of a program?

– The execution time can be defined as the number of individual in- struction executions. As in [13], we ignore “for” instructions, and count only “increment”, “decrement” and “swap” instructions.

12. Is there any relation between the execution time and the final values of the registers?

– Denote by x and x0 the initial and final values of the register x.

Clearly,|x−x0| ≤T where T is the execution time, because, when an increment or decrement instruction is executed, the absolute value of the register changes by 1. Thus (for SRL), maxi|xi−x0i| ≤T.

13. For linear programs is the execution time linear (on the input values)?

– Yes (easy).

14. For programs of level 2 is the execution time quadratic (on the input values)?

– Not necessarily, it may even be exponential, see the Example 8 in [11].

15. What is the reduced normal form (or simply “normal form”) of a program?

– It is a concept borrowed from Group Theory. In a program, and while possible, replace a sequence I;I−1 by 1 (the empty word);

here, I−1 is the (unique) formal synctatic inverse of I. It may be proved that, no matter how this rule is applied, the final program is

(4)

the same; it is called the normal form ofP. For instance, the normal form of

x+; y+; x−; (y+)x; (y−)x; isx+; y+;x−; .

16. Given a program P in reduced normal form, is there a shorter program which is equivalent toP?

– Possibly yes; for instance, the program x+; y+;x−; is in normal form and it is equivalent toy+.

17. A reduced normal form of a program is faster than the program itself?

– It never is slower. The only reduction that does not reduce the execution time is (1)n; (1)n→ 1 (the inverse of the empty program is the empty program).

18. Let us call “optimization” of P to a transformation which results in an equivalent program which is not slower thanP. Also call trivial optimiza- tion to a reduction (of the kind used to obtain a normal form, “I;I−1

→1). Are there non trivial optimizations? In other words, is the normal form optimal?

– Certainly there are non trivial optimizations – in general the normal form program is not optimum. For instance, “x+; y+; x−”→“y+”.

19. Is there any general procedure to obtain the shortest program equivalent to a given program? (a kind of Kolmogorov complexity)

– Unknown answer. An algorithmic answer to this problem would imply the decidability of the equivalence problem, because “P is equivalent toQ” iff “P;Q−1is equivalent to 1 (the empty program)”

iff “the shortest program equivalent toP;Q−1 is 1”.

20. If P is equivalent toQ but|P|<|Q|isQ faster thanP? – Unknown answer, but probably it is not slower.

References

[1] Charles H. Bennett,Logical reversibility of computation, IBM Journal of Research and Development,6, pp 525–532, 1973.

(5)

[2] Charles H. Bennett,Notes on Landauers principle, reversible computa- tion, and Maxwells demon, IBM Research Division, Yorktown Heights, NY 10598, USA, 2007.

[3] E. Fredkin and T. Toffoli,Conservative logic, International Journal of Theoretical Physics, 21, pp 219–253, 1982.

[4] Y. Lecerf,Machines de Turing reversibles. Recursive insolubilit enn∈ N de l’quation u = θn ou θ est un isomorphisme de codes, Comptes Rendus,257, pp 2597–2600, 1963.

[5] Pierre De La Harpe,Topics in Geometric Group Theory, Chicago Lec- tures in Mathematics, 2000.

[6] Hans Hermes, Enumerability, Decidability, Computability, Springer- Verlag, 1969.

[7] Roger Lyndon and Paul Schupp, Combinatorial Group Theory, Springer, 1977.

[8] Wilhelm Magnus, Abraham Karrass, and Donald Solitar,Combinato- rial Group Theory, Presentations of Groups in Terms of Generators and Relations, second revised edition, Dover, 1976.

[9] Armando B. Matos, A Turing machine model suitable for the charac- terisation of determinism and reversibility, LIACC & Departamento de Ciˆencia de Computadores, Faculdade de Ciˆencias da Universidade do Porto, 1999.

[10] Armando B. Matos,Analysis of a simple reversible language, Theoret- ical Computer Science,290, 3, pp 2063–2074, 2003.

[11] Armando B. Matos, Register reversible languages: commutativity, equivalence and open questions (work in progress) Technical Report, 2011.

[12] Armando B. Matos and Ant´onio Porto, Ackermann and the super- powers, DCC-Faculdade de Ciˆencias da Universidade do Porto, 2011 version. First version in: ACM SIGACT Volume 12 Issue 3, Fall 1980.

[13] A. R. Meyer and D. M. Ritchie, The complexity of loop programs, Proceedings of 22nd National Conference of the ACM, pp 465–469, 1967.

(6)

[14] Michael Sipser, Introduction to the Theory of Computation, PWS, 1997.

[15] D. Tsichritzis, The equivalence problem of simple programs, Journal of the ACM, 17(4), pp 729–738, 1970.

Referências

Documentos relacionados

according to their MS 2 fragmentation as different isomers of p-coumaroyl quinic acid. Identities were assigned based on the patterns reported for the caffeoylquinic acid

Este dispositivo tem como zona de aplicação a retificadora presente na linha produtiva das coroas, mais propriamente a calha de carregamento das mesmas para o seu processamento, e

Nesse sentido, em Vício as relações estabelecidas são, antes de mais, e de forma muito clara, com O Primo Basílio, mas também com a obra poética do primeiro. Vítor Manuel Aguiar

A condensação da formação de base em design num 1º ciclo mais curto, o aligeiramento dos 2ºs ciclos, a ausência de referenciais partilhados para o ensino do projeto, ou

No entanto, as obras de teoria musical portuguesas aqui analisadas, escritas entre os séculos xvi e xix , não apresentam transposições tão claras do sistema da poética ou

Entretanto, por força de lei, no Brasil, entende-se cerveja como uma bebida obtida pela fermentação alcoólica do mosto cervejeiro, oriundo este do malte de cevada e água potável,

Sendo bem receptiva, a Diretora administrativa do IPHAEP foi bastante atenciosa e me citou as formas necessárias de procedimento - em contrapartida contei a ela sobre o projeto,

O trabalho artístico realizado em contextos prisionais - os atores sociais em interação sobre o seu território (a instituição total) - as relações entre os grupos de reclusos e