Download presentation

Presentation is loading. Please wait.

Published byTimothy Templeton Modified over 3 years ago

1
Cognitive Computing 2012 Consciousness and Computation: computing machinery and intelligence 2. ON NORMA AND nCODING Mark Bishop

2
01/04/2014(c) Bishop: Consciousness and Computations2 The register machine NORMA: - definition - Registers: Norma has 25 registers [A..Y]. Each register can store an arbitrary length cardinal value. Operations: INC (reg);A := A + 1;for any register (A..Y)... DEC (reg);B := B - 1;there are no addressing modes. Unconditional Branching: GOTO n;n is a program label Conditional Branching: IF (A=0) THEN GOTO n;for any register (A..Y).

3
01/04/2014(c) Bishop: Consciousness and Computations3 NORMA startup and termination The NORMA startup procedure: A NORMA program starts with the register X initialised to contain all input data. All other registers are cleared to zero. NORMA program execution starts at label 1 and continues sequentially and implicitly. The NORMA termination procedure: A NORMA program terminates with a jump to label 0, whereupon the Y register contains the result of the computation.

4
01/04/2014(c) Bishop: Consciousness and Computations4 On the coding of Norma programs In the theory of computation we need to have programs that can operate on programs. eg.Q ( f (p)) The program Q performs the function, f, upon the program, p. However Norma programs can only accept input as an integer in the X register, hence we need to be able to code any possible program as a unique integer. But how to code a NORMA program as a unique integer? Recall, NORMA programs can be of any size. Hence GOTO can be to an integer value of arbitrary length …

5
01/04/2014(c) Bishop: Consciousness and Computations5 Godel numbering In formal number theory a Gödel numbering is a function which assigns to each symbol and formula of some formal language a unique natural number called a Gödel number (GN). The concept was first used by Kurt Gödel for the proof of his incompleteness theorem.

6
01/04/2014(c) Bishop: Consciousness and Computations6 On coding mathematical functions Hence a Gödel numbering can be interpreted as an encoding where a number is assigned to each symbol of a mathematical notation. In this way a stream of natural [Gödel] numbers can represent any mathematical statement, form or function. Thus any effective procedure [computable function] can be represented by a stream of natural numbers …... and a numbering of the set of all computable functions can be represented by a stream of streams-of Gödel numbers; enumerating a stream of effective numbers.

7
01/04/2014(c) Bishop: Consciousness and Computations7 On Prime Decomposition Theorem: Every positive integer is uniquely decomposable into a product of primes. Consider the integer 45. 45 is uniquely decomposable as the product of: 45 = 2 0 x 3 2 x 5 1 ie. 45 is not divisible by 2; divisible by 3 twice; divisible by 5 once. Converse: The product of any set of primes (raised to cardinal powers) is a unique integer. Hence we can code the n-tuple {a, b, c,... n} as the unique integer: 2 a x 3 b x 5 c x P n n... where P n is the n th prime.

8
01/04/2014(c) Bishop: Consciousness and Computations8 The Standard coding of Norma programs CodeOperationVariableLabel 0.Jump on zeroNo varNo label/terminating 1.IncrementRegister Xn = Label number n 2.DecrementRegister Y 3.Jump alwaysRegister A 4.n/aRegister B Hence the statement: 1: X = X – 1=>2 2 x 3 1 x 5 0 = 12= l 1 Given all NORMA programs have instructions labelled [1..n], then the above shows how the j th statement can be represented by a unique integer (l j ).

9
01/04/2014(c) Bishop: Consciousness and Computations9 An example 1: X := X - 1;=> (2, 1, 0) = 12 2: Y := Y + 1;=> (1, 2, 0) = 18 3: IF (X = 0) THEN GOTO 5;=> (0, 1, 5) = 3125 4: GOTO 1;=> (3, 0, 1) = 40 Now we code the above NORMA program (P) as: 2 l1 x 3 l2 x 5 l3 … So the above program would be coded as: 2 12 x 3 18 x 5 3125 x 7 40

10
01/04/2014(c) Bishop: Consciousness and Computations10 nCoding Standard coding is not enough, as it does not guarantee that every integer represents a correct NORMA program. Hence need to use nCoding: Consider the set of integers: {P 0, P 1, P 2... P N }, formed by arranging the set of coded programs in order of magnitude. If the code of Program, P, appears as the cardinal P M on the list, then we define the nCode (P) = M. Henceforth Code (P) means nCode (P).

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google