using definite knowledge axiomatizing the natural numbers n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Using Definite Knowledge: Axiomatizing the Natural Numbers PowerPoint Presentation
Download Presentation
Using Definite Knowledge: Axiomatizing the Natural Numbers

Loading in 2 Seconds...

play fullscreen
1 / 14

Using Definite Knowledge: Axiomatizing the Natural Numbers - PowerPoint PPT Presentation


  • 113 Views
  • Uploaded on

Using Definite Knowledge: Axiomatizing the Natural Numbers. Notes for Ch.3 of Poole et al. CSCE 580 Marco Valtorta. Constants, function, intended interpretation. The domain: the natural numbers and a special symbol S Two constants: one and zero One function one --- denotes the number 1

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Using Definite Knowledge: Axiomatizing the Natural Numbers' - bradley-summers


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
using definite knowledge axiomatizing the natural numbers

Using Definite Knowledge:Axiomatizing the Natural Numbers

Notes for Ch.3 of Poole et al.

CSCE 580

Marco Valtorta

constants function intended interpretation
Constants, function, intended interpretation
  • The domain: the natural numbers and a special symbol S
  • Two constants: one and zero
  • One function
  • one --- denotes the number 1
  • zero---denotes S; it does not denote a number!
  • b(N,zero)
    • denotes 2 x N’, where N denotes the number N’
  • b(N,one)
    • denotes 2 x N’ + 1
mnemonic
Mnemonic
  • A number represented in b notation can be read as a binary number by replacing one with 1 and zero with 0. Example:
  • b(b(b(one, zero),one), one)

1 0 1 1 (decimal 11)

  • b(b(b(one, one), one), one)

1 1 1 1 (decimal 15)

  • B(b(b(b(one,one),zero),one),zero)

1 1 0 1 0 (decimal 26)

number
number
  • numb(N) is true if N denotes (“has the form of”) a number.
      • For short, we may say, “if N is a number.”
      • Use numb, because number/1 is predefined in CILOG
  • numb(one).
  • numb(b(N,zero))  numb(N).
  • numb(b(N,one))  numb(N).
successor
successor
  • succ(N,M) is true if M denotes the successor of (the “number after”) N
  • succ(one, b(one, zero)).
  • succ(b(N, zero), b(N, one)) numb(N) & numb(M).
  • succ(b(N,one), b(M,zero)) <- succ(N,M).
    • Adding 1 to 1 results in 0 with a carry of 1. The carry may propagate.
    • Check it!
slide6
Plus
  • plus(X,Y,Z) is true if the number denoted by Z is the sum of the numbers denoted by X and Y (i.e., Z’ = X’ + Y’, or simply Z = X + Y).
  • plus(one, Y, Z) <- succ(Y, Z).

plus(X, Y, Z) <- succ(XMinus1, X) & succ(Y, YPlus1) & plus(XMinus1, YPlus1, Z).

  • X + Y = Z iff (X-1) + (Y+1) = Z
times
Times
  • X * Y = Z iff (X-1) * Y + Y = Z
  • times(one, Y, Y).
  • times(X,Y,Z) <- succ(XMinus1, X) & times(XMinus1,Y,Z1) & plus(Z1,Y,Z).
slide8
is
  • Is does expression evaluation
      • We use is1 because “is” is predefined in CILOG.
  • is1(E,E) <- numb(E).
  • is1(V, X+Y) <- is1(V1,X) & is1(V2,Y) & plus(V1,V2,V).
  • is1(V, X*Y) <- is1(V1,X) & is1(V2,Y) & times(V1,V2,V).
  • is1(V, X-Y) <- is1(V1,X) & is1(V2,Y) & plus(V2,V,V1).
less than
Less than
  • lt(one, b(N,zero)) <- numb(N).
  • lt(one, b(N,one)) <- numb(N).
  • lt(N,M) <- succ(NMinus1,N) & succ(MMinus1,M) & lt(NMinus1, MMinus1).
not equal
Not Equal
  • neq(N,M) <- lt(N,M).
  • neq(N,M) <- lt(M,N).
complexity of plus
Complexity of plus
  • Each time the second clause of plus is applied, the first argument is decremented by one:
      • plus takes linear time in the value of the first argument.
      • This is exponential time in the size of the binary representation of a number!
  • A more efficient plus (linear in the size of the representation) can be obtained by simulating addition by hand (with carry). We call it bplus.
efficient plus
Efficient plus
  • bplus(one, X, S)  succ(X,S).
  • bplus(b(N,D),one,S)  succ(b(N,D),S).
  • bplus(b(R,zero),b(S,zero),b(RS,zero))  bplus(R,S,RS).
  • bplus(b(R,zero),b(S,one),b(RS,one))  bplus(R,S,RS).
  • bplus(b(R,one),b(S,zero),b(RS,one))  bplus(R,S,RS).
  • bplus(b(R,one),b(S,zero),b(SRS,zero))  bplus(R,S,RS) & succ(RS,SRS).
complexity of times
Complexity of times
  • Each time the second clause of times is applied, the first argument is decremented by one and plus is called:
      • Plus takes quadratic time in the value of the first argument.
      • This is doubly exponential in the size of the binary representation!
  • A more efficient (quadratic in the size of the representation) solution is obtained by simulating hand multiplication. We call this btimes.
efficient times
Efficient times
  • btimes(one,X,X).
  • btimes(b(R,zero), S, b(RS,zero)  btimes(R,S,RS).
  • btimes(b(R,one), S, RSS)  btimes(R,S,RS) & bplus(S,b(RS,zero), RSS).
  • When the third clause is applied, one number is “stripped” at the end of the multiplicand. This appears to be linear-time, but it is not, because the addend in bplus grows in size.