{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

A+Practical+Theory+of+Programming+03

A+Practical+Theory+of+Programming+03 - boolean expressions...

This preview shows pages 1–6. Sign up to view the full content.

boolean expressions: represent anything that comes in two kinds represent statements about the world (natural or constructed, real or imaginary) represent digital circuits represent human behavior theorems: represent one kind represent true statements represent circuits with high voltage output represent innocent behavior antitheorems: represent the other kind represent false statements represent circuits with low voltage output represent guilty behavior 1/23

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
0 operands T 1 operand ¬ x 2 operands x y x y x y x y x = y x y 3 operands if x then y else z precedence and parentheses associative operators: = x y z means either ( x y ) z or x ( y z ) x y z means either ( x y ) z or x ( y z ) continuing operators: = x = y = z means x = y y = z x y z means ( x y ) ( y z ) big operators: = same as = but later precedence x = y z means ( x = y ) ( y z ) 2/23
truth tables T ¬ T T T T T T T T T T T T T T T = T T T T T T T T T T T T T T T T if then else T T T T 3/23

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
variables are for substitution (instantiation) add parentheses to maintain precedence in x y replace x by and y by T result: ( T ) every occurrence of a variable must be replaced by the same expression in x x replace x by result: different variables can be replaced by the same expression or different expressions in x y replace x by and y by result: in x y replace x by T and y by result: T 4/23
new boolean expressions (the grass is green) (the sky is green) (there is life elsewhere in the universe) (intelligent messages are coming from space) 1 + 1 = 2 0 / 0 = 5 ——————————————————————————— consistent :

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 23

A+Practical+Theory+of+Programming+03 - boolean expressions...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online