NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1...

29
NKS’06 - Washington DC - June 2006 T. Bolognesi - Randomness in Process algebraic computations 1 Detecting and measuring randomness in process-algebraic computations Tommaso Bolognesi CNR - ISTI - Pisa

Transcript of NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1...

Page 1: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

1

Detecting and measuring randomnessin process-algebraic computations

Tommaso BolognesiCNR - ISTI - Pisa

Page 2: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

2

Abstract

A technique is introduced for visually characterizing, by 2-D plots, the complexity of process-algebraic computations -- an area that has not been directly invested, so far, by NKS research.

An extension of the familiar notion of functional derivation is proposed, that reveals some interesting properties of this class of plots. Pseudo-random features seem to emerge even for simple subsets of process algebra that are regarded as uncapable of universal computations, at least w.r.t. the standard notion of Turing universality.

This apparently surprising result suggests to complement the visual inspection of process-algebraic diagrams with refined, numeric techniques for measuring their degree of randomness. In particular we explore the application of a density-dependent compressibility measure, based on pointer-encoding. We have tested this technique by applying it also to the family of elementary cellular automata, where it does indeed prove useful for discriminating between computations, most notably within Class 3.

Page 3: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

3

Contents

• Process Algebra (PA) as a citizen of the ‘World of Simple Programs’

• A set of universal PA operators and a useful 2D visual indicator

• Emergent features from PA subclasses– particles - derivatives - exponential and fibonacci -

emulation by compression - emergence of randomness

• How much random? How much universal?– PEncode compression values for PA computations– Non universality of a PA class with randomness-capability

• Next

Page 4: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

4

Process Algebra(‘s)

• Formal methods for Software Engineering• Models/languages for the specification and verification of

concurrent systems (‘interaction’, ‘communication’)– CCS, ACP, CSP, LOTOS, …

behavior expression:an algebraic term built by operators

P := a; [b; stop [+] c; P]

A process definition … …its standard interpretationas a Labeled Transition System (LTS)

a

a

b

b

a

c

c

“SOS”rules

syntax semantics

Page 5: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

5

Seven PA operators and their SOS rules…

…yielding a special multiway, symbolic, non-local rewrite system easily coded in Mathematica:

B ===[SOS rules]===> {(a1, B1), …, (an, Bn)}

Page 6: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

6

PA under NKS light

• Not a typical citizen of the ‘World of Simple Programs’– Syntax:

• more parameters than average NKS citizen • ==> huge spaces, hard to structure and to explore

– Semantics:• several options (operational, denotational, axiomatic -- LTS, true concurrency, refusal sets…)

• reactivity (interactive systems)/concurrency/nondeterminism• event-based and state-based

• Some universality results available

• Objectives:– find good 2D visual indicators– spot emergent features for different PA sub-classes– spot randomness before universality ?

Page 7: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

7

Non standard interpretation of deterministic specs

(no branching)

a

a

a

a

P := (a; a; P) |[a]| (a; P)

behavior expression withparallel composition op.

operators in prefix form

PA ‘plots’:different grey levels for different operators

Page 8: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

8

Proof:PA spec using all 7 operators for emulating ECA 110

Theorem 1 - The chosen operator set is universal

compression

Page 9: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

9

Regular plots: costant or linear growth

Page 10: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

10

Exponential growth - derivatives

an = an-1 + an-1 (* Base 2 *)an = an-1 + an-2 (* Fibonacci *)

analogy with (parallel) substitution systems [NKS, p. 82]

Page 11: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

11

Emulation by compression

(3) P := a[a[par[P, {a}, P]]]

(4) P := a[a[par[a[a[P]], {a}, P]]]

Page 12: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

12

first and second derivative

(5) P := a[a[par[P, {a}, a[P]]]]

Page 13: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

13

Quadratic growth

derivatives

(6) P := a[par[P, {a}, choice[Q, stop]]] Q := a[hideB[choice[choice[Q, Q], Q]]]

(7) P := a[par[P, {a}, choice[Q, stop]]] Q := a[par[par[stop, {}, Q], {}, stop]]

(8) P := par[a[Q], {b}, b[P]] Q := b[choice[stop, hideA[Q]]]

(9) P := a[par[choice[Q, Q], {a}, P]] Q := a[par[stop, {}, Q]]

(10) P := a[par[par[stop, {}, Q], {a}, P]] Q := par[a[par[stop, {}, Q]], {}, stop]

Page 14: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

14

Emergence of randomness (?)

(11) P := a[hideB[par[Q, {a}, hideB[Q]]]] Q := a[par[P, {}, stop]]

(12) P := a[hideB[par[Q, {a}, Q]]] Q := a[par[P, {}, stop]]

Page 15: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

15

(13) P := c[hideA[par[Q,{a,b,c,d},choice[Q,P]]]] Q := d[swap1[choice[P,stop]]] R := a[hideC[choice[c[P],P]]]

(14) P := b[par[b[swap2[choice[stop,R]]],{a,b,d},P]] Q := b[hideA[choice[stop,P]]] R := d[swap2[par[hideC[P],{a,b,c,d},P]]],

Page 16: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

16

(15) P := a[swap1[par[stop,{a,c},swap1[R]]]] Q := a[par[c[stop],{b},R]] R := a[par[P,{a},Q]]

swap1 is a particular instance of the relabeling operator

Page 17: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

17

How much random? How much universal?

• Measure randomness via Pencode-compressibility (thanks to S. Wolfram!)

• Find simplest PA subclass exhibiting maximum randomness (*), and

• …question its universality

--------------------------(*) relative to selected measure and sample size

Page 18: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

18

Pencode compression of spec (15) - 1st derivative - 23 rows

row length

compress. value for equivalent (*) random row of

reference

compression value for actual row

(*) of same length, alphabet, and distribution

… rows are bad

Page 19: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

19

= actual compression values= compression values of one equivalent random tuple of reference

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

compress rows and columns of a square region of spec (15)

… columns are ‘good’

Page 20: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

20

Pencode compression of a fragment of spec (5) - 1st derivative

= column lengths= actual compression values= averaged compression values of equivalent random tuple of reference

… these columns are ‘good’ too…

Page 21: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

21

• spec(5) is based on a PA subset with only– action prefix a[…]– parallel par[{a},…,…]– instantiation P

• Theorem 2: the above PA operator subset is not universal – even if we add the inaction operator (stop)

• Proof– by induction on the structure of behavior expressions– shows that any such PA specification is equivalent to a

context-free rewrite system, which cannot be universal []

How much random? How much universal?

Page 22: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

22

Conclusions

• Useful 2D visual indicators for PA identified– similarity with NKS symbolic system / combinator diagrams [p.

103]– original notion of derivative

• Emergence of randomness – spotted visually– measured by Pencode compressibility - for limited size data sets

• Elements collected for questioning class 3 universality conjecture– but: is randomness-capability a clear cut property?

• Next:– Other measures of randomness degree– Random-like features in derivative plots of context-free rewrite

systems– Other notions of universality, e.g. intermediate degrees (Davis,

Sutner - thanks to M. Szudzik!)– Maximize non-universal operator set in th. 2

Page 23: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

23

References

• Bolognesi, T.: Process Algebra under the light of Wolfram’s NKS. In: A. Gordon and L. Aceto (editors) - Proceed. of APC 2005 - Electronic Notes in Theoretical Computer Science, Elsevier, 2005.

• Davis, M.: The definition of universal Turing machines, Proc. of the American Mathematical Society, 8: 1125-1126, 1957.

• Sutner, K.: Universality and cellular automata. In Proceedings of MCU 2005 - LNCS 3354, pp. 50-59, Springer-Verlag, 2005.

• Wolfram, S.: A New Kind of Science, Wolfram Media, Inc., 2002.

Page 24: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

24

rows rows

rows

C[row]D[row]

C[Rand[Length[row], D[row]]] ± StDev

•D[row] = (num. of 1’s in row)/Length[row] Density•C[row] = Length[PEncode[row]] Compression value•Rand[length, prob1] = random bit tuple of given length and probability of ‘1’

Pencode compressibility in ECAs

Page 25: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

25

18,183 105 *

22,151 106,120,169,225 *

30,86,135,149 * 122,161

45,101,75,89 * 126,129

60,102,195,153 * 146,182

90,165 * 150 *

ECA Class 3 - 12 symmetry families - 30 members

Bold: density = 1/2; Italics: Pencode-ottimale <===> * = family multiple of 15

Page 26: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

26

Class 3 - 18,22,30, 45,60,90…

Page 27: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

27

Class 3 - …105,106,122, 126,146,150

Page 28: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

28

remarks

• ECA is pencode-optimal ===> ECA keeps = 1/2

• The converse is false (122, 126)

• ECA is Pencode-optimal ===> the family includes a multiple of 15

• Overall, there are 66 Pencode-optimal ECAs, that include all 18 multiples of 15

Page 29: NKS06 - Washington DC - June 2006T. Bolognesi - Randomness in Process algebraic computations1 Detecting and measuring randomness in process-algebraic computations.

NKS’06 - Washington DC - June 2006

T. Bolognesi - Randomness in Process algebraic computations

29

Class 4 - (54,147), (110,124,137,193)