Chapter 6. Logic and Action. 6.1 Actions in General

Size: px
Start display at page:

Download "Chapter 6. Logic and Action. 6.1 Actions in General"

Transcription

1 Chpter 6 Logic nd Action Overview An ction is something tht tkes plce in the world, nd tht mkes difference to wht the world looks like. Thus, ctions re mps from sttes of the world to new sttes of the world. Actions cn be of vrious kinds. The ction of spilling coffee chnges the stte of your trousers. The ction of telling lie to your friend chnges your friend s stte of mind (nd mybe the stte of your soul). The ction of multiplying two numbers chnges the stte of certin registers in your computer. Despite the differences between these vrious kinds of ctions, we will see tht they cn ll be covered under the sme logicl umbrell. 6.1 Actions in Generl Sitting quietly, doing nothing, Spring comes, nd the grss grows by itself. From: Zenrin kushu, compiled by Eicho ( ) Action is chnge in the world. Chnge cn tke plce by itself (see the poem bove), or it cn involve n gent who cuses the chnge. You re n gent. Suppose you hve bd hbit nd you wnt to give it up. Then typiclly, you will go through vrious stges. At some point there is the ction stge: you do wht you hve to do to effect chnge. Following instructions for how to combine certin elementry culinry ctions (chopping n onion, firing up stove, stirring the contents of sucer) my mke you successful cook. Following instructions for how to combine communiction steps my mke you successful slesperson, or successful brrister. Lerning to combine elementry computtionl ctions in clever wys my mke you successful computer progrmmer. Actions cn often be chrcterized in terms of their results: stir in heted butter nd suté until soft, rinse until wter is cler. In this chpter you will lern how to use logic for 6-1

2 6-2 CHAPTER 6. LOGIC AND ACTION nlyzing the interply of ction nd sttic descriptions of the world before nd fter the ction. It turns out tht structured ctions cn be viewed s compositions of bsic ctions, with only few bsic composition recipes: conditionl execution, choice, sequence, nd repetition. In some cses it is lso possible to undo or reverse n ction. This gives further recipe: if you re editing file, you cn undo the lst delete word ction, but you cnnot undo the printing of your file. Conditionl or gurded execution ( remove from fire when cheese strts to melt ), sequence ( pour eggs in nd swirl; cook for bout three minutes; gently slide out of the pn ), nd repetition ( keep stirring until soft ) re wys in which cook combines his bsic ctions in prepring mel. But these re lso the strtegies for lwyer when plnning her defence ( only discuss the chrcter of the defendnt if the prosecution forces us, first convince the jury of the soundness of the libi, next cst doubt on the relibility of the witness for the prosecution ), or the bsic lyout strtegies for progrmmer in designing his code. In this chpter we will look t the logic of these wys of combining ctions. Action structure does not depend on the nture of the bsic ctions: it pplies to ctions in the world, such s prepring brekfst, clening dishes, or spilling coffee over your trousers. It lso pplies to communictive ctions, such s reding n English sentence nd updting one s stte of knowledge ccordingly, engging in converstion, sending n emil with cc s, telling your prtner secret. These ctions typiclly chnge the cognitive sttes of the gents involved. Finlly, it pplies to computtions, i.e., ctions performed by computers. Exmples re computing the fctoril function, computing squre roots, etc. Such ctions typiclly involve chnging the memory stte of mchine. Of course there re connections between these ctegories. A communictive ction will usully involve some computtion involving memory, nd the utternce of n impertive ( Shut the door! ) is communictive ction tht is directed towrds ction in the world. There is very generl wy to model ction nd chnge, wy tht we hve in fct seen lredy. The key is to view chnging world s set of situtions linked by lbeled rcs. In the context of epistemic logic we hve looked t specil cse of this, the cse where the rcs re epistemic ccessibility reltions: gent reltions tht re reflexive, symmetric, nd trnsitive. Here we drop this restriction. Consider n ction tht cn be performed in only one possible wy. Toggling switch for switching off your lrm clock is n exmple. This cn be pictured s trnsition from n initil sitution to new sitution: lrm on toggle lrm off Toggling the switch once more will put the lrm bck on:

3 6.1. ACTIONS IN GENERAL 6-3 toggle toggle lrm on lrm off lrm on Some ctions do not hve determinte effects. Asking your boss for promotion my get you promoted, but it my lso get you fired, so this ction cn be pictured like this: promoted employed sk for promotion fired Another exmple: opening window. This brings bout chnge in the world, s follows. open window The ction of window-opening chnges stte in which the window is closed into one in which it is open. This is more subtle thn toggling n lrm clock, for once the window is open different ction is needed to close it gin. Also, the ction of opening window cn only be pplied to closed windows, not to open ones. We sy: performing the ction hs precondition or presupposition. In fct, the public nnouncements from the previous chpter cn lso be viewed s (communictive) ctions covered by our generl frmework. A public nnouncement is n ction tht effects chnge in n informtion model. bc 0 : p bc 1 : p bc!p bc 0 : p

4 6-4 CHAPTER 6. LOGIC AND ACTION On the left is n epistemic sitution where p is in fct the cse (indicted by the grey shding), but b nd c cnnot distinguish between the two sttes of ffirs, for they do not know whether p. If in such sitution there is public nnouncement tht p is the cse, then the epistemic sitution chnges to wht is pictured on the right. In the new sitution, everyone knows tht p is the cse, nd everyone knows tht everyone knows, nd so on. In other words: p hs become common knowledge. Here is computtionl exmple. The sitution on the left in the picture below gives highly bstrct view of prt of the memory of computer, with the contents of three registers x, y nd z. The effect of the ssignment ction x := y on this sitution is tht the old contents of register x gets replced by the contents of register y. The result of the ction is the picture on the right. x 3 y 2 z 4 x := y x 2 y 2 z 4 The commnd to put the vlue of register y in register x mkes the contents of registers x nd y equl. The next exmple models trffic light tht cn turn from green to yellow to red nd gin to green. The trnsitions indicte which light is turned on (the light tht is currently on is switched off). The stte # is the stte with the green light on, the stte the stte with the yellow light on, nd the stte the stte with the red light on. yellow # green red These exmples illustrte tht it is possible to pproch wide vriety of kinds of ctions from unified perspective. In this chpter we will show tht this is not only possible, but lso fruitful. In fct, much of the resoning we do in everydy life is resoning bout chnge. If you reflect on n everydy life problem, one of the things you cn do is run through vrious scenrios in your mind, nd see how you would (re)ct if things turn out s you imgine. Amusing smples re in the Dutch Hndboek voor de Moderne Vrouw (The Modern Womn s Hndbook). See Here is smple question from Hndboek voor de Moderne Vrouw : I m longing for cosy Xms prty. Wht cn I do to mke our Xms event hppy nd joyful? Here is the recommendtion for how to reflect on this:

5 6.1. ACTIONS IN GENERAL 6-5 START guest your type? hostess become hostess? yes red tips pprecited? only by husbnd by no-one not relly only pssively pose s idel guest invite kids sk prticiption mke pizz Figure 6.1: Flow Digrm of Hppy Xms Procedure

6 6-6 CHAPTER 6. LOGIC AND ACTION Are you the type of guest or the type of hostess? If the nswer is guest : Would you like to become hostess? If the nswer is not relly then your best option is to profile s n idel guest nd hope for Xms prty invittion elsewhere. If the nswer is yes then here re some tips on how to become gret hostess:... If the nswer is hostess, then sk yourself: Are your efforts truly pprecited? If the nswer is Yes, but only by my own husbnd then probbly your kids re bored to deth. Invite friends with kids of the sme ge s yours. If the nswer is Yes, but nobody lifts finger to help out then Ask everyone to prepre one of the courses. If the nswer is No, I only gets mons nd sighs then put pizz in the microwve for your spouse nd kids nd get yourself invited by friends. Figure 6.1 gives so-clled flow digrm for the recommendtions from this exmple. Note tht the questions re put in boxes, tht the nswers re lbels of outgoing rrows of the boxes, nd tht the ctions re put in boxes. 6.2 Sequence, Choice, Repetition, Test In the logic of propositions, the nturl opertions re not, nd nd or. These opertions re used to mp truth vlues into other truth vlues. When we wnt to tlk bout ction, the repertoire of opertions gets extended. Wht re nturl things to do with ctions? When we wnt to tlk bout ction t very generl level, then we first hve to look t how ctions cn be structured. Let s ssume tht we hve set of bsic ctions. Cll these bsic ctions, b, c, nd so on. Right now we re not interested in the internl structure of bsic ctions. The ctions, b, c could be nything: ctions in the world, bsic cts of communiction, or bsic chnges in the memory stte of computer. Given such set of bsic ctions, we cn look t nturl wys to combine them. Sequence In the first plce we cn perform one ction fter nother: first et brekfst, then do the dishes. First execute ction, next execute ction b. First toggle switch. Then toggle it gin. Consider gin the lrm clock toggle ction. toggle toggle lrm on lrm off lrm on Writing the sequence of two ctions nd b s ; b, we get:

7 6.2. SEQUENCE, CHOICE, REPETITION, TEST 6-7 lrm on toggle; toggle lrm on Strting out from the sitution where the lrm is off, we would get: lrm off toggle; toggle lrm off Choice A complex ction cn lso consist of choice between simpler ctions: either drink te or drink coffee. Either mrry beggr or mrry millionnire. unmrried, poor -beggr mrried, poor unmrried, poor -millionnire mrried, rich mrried, poor unmrried, poor -beggr -millionnire mrried, rich Repetition Actions cn be repeted. The phrse lther, rinse, repet is used s joke t people who tke instructions too literlly: the stop condition until hir is clen is omitted. There is lso joke bout n dvertising executive who increses the sles of his client s shmpoo by dding the word repet to its instructions. If tken literlly, the compound ction lther, rinse, repet would look like this: lther ; rinse Repeted ctions usully hve stop condition: repet the lther rinse sequence until your hir is clen. This gives more sensible interprettion of the repetition instruction:

8 6-8 CHAPTER 6. LOGIC AND ACTION lther ; rinse hir clen? yes STOP no Looking t the picture, we see tht this procedure is mbiguous, for where do we strt? Here is one possibility: START lther ; rinse hir clen? yes STOP no And here is nother: START lther ; rinse hir clen? yes STOP no The difference between these two procedures is tht the first one strts with hir clen? check: if the nswer is yes, nothing hppens. The second procedure strts with lther; rinse sequence, no mtter the initil stte of your hir.

9 6.2. SEQUENCE, CHOICE, REPETITION, TEST 6-9 In mny progrmming lnguges, this sme distinction is mde by mens of choice between two different constructs for expressing condition controlled loops : while not hir clen do { lther; rinse } repet { lther ; rinse } until hir clen The first loop does not gurntee tht the lther ; rinse sequence gets performed t lest once; the second loop does. Test The condition in condition-controlled loop (the condition hir clen, for exmple) cn itself be viewed s n ction: test whether certin fct holds. A test to see whether some condition holds cn lso be viewed s bsic ction. Nottion for the ction tht tests condition ϕ is?ϕ. The question mrk turns formul (something tht cn be true or flse) into n ction (something tht cn succeed or fil). If we express tests s?ϕ, then we should specify the lnguge from which ϕ is tken. Depending on the context, this could be the lnguge of propositionl logic, the lnguge of predicte logic, the lnguge of epistemic logic, nd so on. Since we re tking n bstrct view, the bsic ctions cn be nything. Still, there re few cses of bsic ction tht re specil. The ction tht lwys succeeds is clled SKIP. The ction tht lwys fils is clled ABORT. If we hve tests, then clerly SKIP cn be expressed s? (the test tht lwys succeeds) nd ABORT s? (the test tht lwys fils). Using test, sequence nd choice we cn express the fmilir if then else from mny progrmming lnguges. if hir clen then skip else { lther ; rinse } This becomes choice between test for clen hir (if this test succeeds then nothing hppens) nd sequence consisting of test for not-clen-hir followed by lther nd rinse (if the hir is not clen then it is first lthered nd then rinsed).?hir clen {? hir clen ; lther ; rinse } The generl recipe for expressing if ϕ then α 1 else α 2 is given by:?ϕ; α 1? ϕ; α 2. Since exctly one of the two tests?ϕ nd? ϕ will succeed, exctly one of α 1 or α 2 will get executed. Using the opertion for turning formul into test, we cn first test for p nd next test for q by mens of?p;?q. Clerly, the order of testing does not mtter, so this is equivlent to?q;?p. And since the tests do not chnge the current stte, this cn lso be expressed s single test?(p q). Similrly, the choice between two tests?p nd?q cn be written s?p?q. Agin, this is equivlent to?q?p, nd it cn be turned into single test?(p q).

10 6-10 CHAPTER 6. LOGIC AND ACTION Converse Some ctions cn be undone by reversing them: the reverse of opening window is closing it. Other ctions re much hrder to undo: if you smsh piece of chin then it is sometimes hrd to mend it gin. So here we hve choice: do we ssume tht bsic ctions cn be undone? If we do, we need n opertion for this, for tking the converse of n ction. If, in some context, we ssume tht undoing n ction is generlly impossible we should omit the converse opertion in tht context. Exercise 6.1 Suppose ˇ is used for reversing bsic ctions. So ˇ is the converse of ction, nd bˇis the converse of ction b. Let ; b be the sequentil composition of nd b, i.e., the ction tht consists of first doing nd then doing b. Wht is the converse of ; b? 6.3 Viewing Actions s Reltions As n exercise in bstrction, we will now view ctions s binry reltions on set S of sttes. The intuition behind this is s follows. Suppose we re in some stte s in S. Then performing some ction will result in new stte tht is member of some set of new sttes {s 1,..., s n }. If this set is empty, this mens tht the ction hs borted in stte s. If the set hs single element s, this mens tht the ction is deterministic on stte s, nd if the set hs two or more elements, this mens tht ction is non-deterministic on stte s. The generl picture is: s 1 s 2 s s 3 s n Clerly, when we extend this picture to the whole set S, wht emerges is binry reltion on S, with n rrow from s to s (or equivlently, pir (s, s ) in the reltion) just in cse performing ction in stte s my hve s s result. Thus, we cn view binry reltions on S s the interprettions of bsic ction symbols. The set of ll pirs tken from S is clled S S, or S 2. A binry reltion on S is simply set of pirs tken from S, i.e., subset of S 2. Given this bstrct interprettion of bsic reltions, it mkes sense to sk wht corresponds to the opertions on ctions tht we encountered in Section 6.2. Let s consider them in turn.

11 6.3. VIEWING ACTIONS AS RELATIONS 6-11 Sequence Given tht ction symbol is interpreted s binry reltion R on S, nd tht ction symbol b is interpreted s binry reltion R b on S, wht should be the interprettion of the ction sequence ; b? Intuitively, one cn move from stte s to stte s just in cse there is some intermedite stte s 0 with the property tht gets you from s to s 0 nd b gets you from s 0 to s. This is well-known opertion on binry reltions, clled reltionl composition. If R nd R b re binry reltions on the sme set S, then R R b is the binry reltion on S given by: R R b = {(s, s ) there is some s 0 S : (s, s 0 ) R nd (s 0, s ) R b }. If bsic ction symbol is interpreted s reltion R, nd bsic ction symbol b is interpreted s reltion R b, then the sequence ction ; b is interpreted s R R b. Here is picture: s 11 s 12 s 1 s 13 s s 2 s 3 s 1m s n If the solid rrows interpret ction symbol nd the dshed rrows interpret ction symbol b, then the rrows consisting of solid prt followed by dshed prt interpret the sequence ; b. Choice Now suppose gin tht we re in stte s, nd tht performing ction will get us in one of the sttes in {s 1,..., s n }. And supposse tht in tht sme stte s, performing ction b will get us in one of the sttes in {s 1,..., s m}.

12 6-12 CHAPTER 6. LOGIC AND ACTION s 1 s 2 s 3 s n s s 1 s 2 s 3 s m Then performing ction b (the choice between nd b) in s will get you in one of the sttes in {s 1,..., s n } {s 1,..., s m}. More generlly, if ction symbol is interpreted s the reltion R, nd ction symbol b is interpreted s the reltion R b, then b will be interpreted s the reltion R R b (the union of the two reltions). Test A nottion tht is often used for the equlity reltion (or: identity reltion is I. The binry reltion I on S is by definition the set of pirs given by: I = {(s, s) s S}. A test?ϕ is interpreted s subset of the identity reltion, nmely s the following set of pirs: R?ϕ = {(s, s) s S, s = ϕ} From this we cn see tht test does not chnge the stte, but checks whether the stte stisfies condition. To see the result of combining test with nother ction:

13 6.4. OPERATIONS ON RELATIONS 6-13 s 1 s 2 s s 3 s n t 1 t 2 t t 3 t m The solid rrow interprets test?ϕ tht succeeds in stte s but fils in stte t. If the dshed rrows interpret bsic ction symbol, then, for instnce, (s, s 1 ) will be in the interprettion of?ϕ;, but (t, t 1 ) will not. Since is true in ny sitution, we hve tht? will get interpreted s I (the identity reltion on S). Therefore,? ; will lwys receive the sme interprettion s. Since is flse in ny sitution, we hve tht? will get interpreted s (the empty reltion on S). Therefore,? ; will lwys receive the sme interprettion s?. Before we hndle repetition, it is useful to switch to more gererl perspective. 6.4 Opertions on Reltions Reltions were introduced in Chpter 4 on predicte logic. In this chpter we view ctions s binry reltions on set S of situtions. Such binry reltion is subset of S S, the set of ll pirs (s, t) with s nd t tken from S. It mkes sense to develop the generl topic of opertions on binry reltions. Which opertions suggest themselves, nd wht re the corresponding opertions on ctions? In the first plce, there re the usul set-theoretic opertions. Binry reltions re sets of pirs, so tking unions, intersections nd complements mkes sense (lso see Appendix A). We hve lredy seen tht tking unions corresponds to choice between ctions. Exmple 6.2 The union of the reltions mother nd fther is the reltion prent. Exmple 6.3 The intersection of the reltions nd is the equlity reltion =.

14 6-14 CHAPTER 6. LOGIC AND ACTION In Section 6.3 we encountered the nottion I for the equlity (or: identity) reltion on set S. We hve seen tht tests get interpreted s subsets of I. We lso looked t composition of reltions. R 1 R 2 is the reltion tht performing n R 1 step followed by n R 2 step. To see tht order of composition mtters, consider the following exmple. Exmple 6.4 The reltionl composition of the reltions mother nd prent is the reltion grndmother, for x is grndmother of y mens tht there is z such tht x is mother of z, nd z is prent of y. The reltionl composition of the reltions prent nd mother is the reltion mternl grndprent, for x is mternl grndprent of y mens tht there is z such tht x is prent of z nd z is mother of y. Exercise 6.5 Wht is the reltionl composition of the reltions fther nd mother? Another importnt opertion is reltionl converse. The reltionl converse of binry reltion R, nottion Rˇ, is the reltion given by: Rˇ = {(y, x) S 2 (x, y) R}. Exmple 6.6 The reltionl converse of the prent reltion is the child reltion. Exercise 6.7 Wht is the reltionl converse of the reltion? The following lw describes the interply between composition nd converse: Converse of composition (R 1 R 2 )ˇ = R 2ˇ R 1ˇ. Exercise 6.8 Check from the definitions tht (R 1 R 2 )ˇ = R 2ˇ R 1ˇis vlid. There exists long list of logicl principles tht hold for binry reltions. To strt with, there re the usul Boolen principles tht hold for ll sets: Commuttivity R 1 R 2 = R 2 R 1, R 1 R 2 = R 2 R 1, Idempotence R R = R, R R = R. Lws of De Morgn R 1 R 2 = R 1 R 2, R 1 R 2 = R 1 R 2. Specificlly for reltionl composition we hve: Associtivity R 1 (R 2 R 3 ) = (R 1 R 2 ) R 3.

15 6.4. OPERATIONS ON RELATIONS 6-15 Distributivity R 1 (R 2 R3) = (R 1 R 2 ) (R 1 R 3 ) (R 1 R 2 ) R3) = (R 1 R 3 ) (R 2 R 3 ). There re lso mny principles tht seem plusible but tht re invlid. To see tht puttive principle is invlid one should look for counterexmple. Exmple 6.9 R R = R is invlid, for if R is the prent reltion, then the principle would stte tht grndprent equls prent, which is flse. Exercise 6.10 Show by mens of counterexmple tht R 1 (R 2 R 3 ) = (R 1 R 2 ) (R 1 R 3 ) is invlid. Exercise 6.11 Check from the definitions tht R 1 (R 2 R 3 ) = (R 1 R 2 ) (R 1 R 3 ) is vlid. Exercise 6.12 Check from the definition tht Rˇˇ = R is vlid. Exercise 6.13 Check from the definitions tht (R 1 R 2 )ˇ = R 1ˇ R 2ˇis vlid. Trnsitive Closure A reltion R is trnsitive if it holds tht if you cn get from x to y in two R-steps, then it is lso possible to get from x to y in single R-step (see pge 4-20 bove). This cn be redily expressed in terms of reltionl composition. R is trnsitive iff R R R. The trnsitive closure of reltion R is defined s the smllest trnsitive reltion S tht contins R. This mens: S is the trnsitive closure of R if (1) R S, (2) S S S, (3) if R T nd T T T then S T. Requirement (1) expresses tht R is contined in S, requirement (2) expresses tht S is trnsitive, nd requirement (3) expresses tht S is the smllest trnsitive reltion tht contins R: ny T tht stisfies the sme requirements must be t lest s lrge s S. The customry nottion for the trnsitive closure of R is R +. Here is n exmple. Exmple 6.14 The trnsitive closure of the prent reltion is the ncestor reltion. If x is prent of y then x is ncestor of y, so the prent reltion is contined in the ncestor reltion. If x is n ncestor of y nd y is n ncestor of z then surely x is n ncestor of z, so the ncestor reltion is trnsitive. Finlly, the ncestor reltion is the smllest trnsitive reltion tht contins the prent reltion.

16 6-16 CHAPTER 6. LOGIC AND ACTION You cn think of binry reltion R s recipe for tking R-steps. The recipe for tking double R-steps is now given by R R. The recipe for tking triple R-steps is given by R R R, nd so on. There is forml reson why the order of composition does not mtter: R 1 (R 2 R 3 ) denotes the sme reltion s (R 1 R 2 ) R 3. becuse of the bove-mentioned principle of ssocitivity. The n-fold composition of binry reltion R on S with itself cn be defined from R nd I (the identity reltion on S), by recursion (see Appendix, Section A.6), s follows: R 0 = I R n = R R n 1 for n > 0. Abbrevition for the n-fold composition of R is R n. This llows us to tlk bout tking specific number of R-steps. Notice tht R I = R. Thus, we get tht R 1 = R R 0 = R I = R. The trnsitive closure of reltion R cn be computed by mens of: R + = R R 2 R 3 This cn be expressed without the, s follows: R + = R n. n N,n>0 Thus, R + denotes the reltion of doing n rbitrry finite number of R-steps (t lest one). Closely relted to the trnsitive closure of R is the reflexive trnsitive closure of R. This is, by definition, the smllest reltion tht contins R nd tht is both reflexive nd trnsitive. The reflexive trnsitive closure of R cn be computed by: R = I R R 2 R 3 This cn be expressed without the, s follows: R = n N R n. Thus, R denotes the reltion of doing n rbitrry finite number of R-steps, including zero steps. Notice tht the following holds: R + = R R. Exercise 6.15 The following identity between reltions is not vlid: Explin why not by giving counter-exmple. (R S) = R S.

17 6.5. COMBINING PROPOSITIONAL LOGIC AND ACTIONS: PDL 6-17 Exercise 6.16 The following identity between reltions is not vlid: Explin why not by giving counter-exmple. (R S) = R S. For Loops In progrmming, repetition consisting of specified number of steps is clled for loop. Here is n exmple of loop for printing ten lines, in the progrmming lnguge Ruby: #!/usr/bin/ruby for i in puts "Vlue of locl vrible is #{i}" end If you hve system with Ruby instlled, you cn sve this s file nd execute it. While Loops, Repet Loops If R is the interprettion of ( doing once ), then R is the interprettion of doing n rbitrry finite number of times, nd R + is the interprettion of doing n rbitrry finite number of times but t lest once. These reltions cn be used to define the interprettion of while loops nd repet loops (the so-clled condition controlled loops), s follows. If is interpreted s R, then the condition-controlled loop while ϕ do is interpreted s: (R?ϕ R ) R? ϕ. First do number of steps consisting of?ϕ test followed by n ction, next check tht ϕ holds. Exercise 6.17 Supposing tht gets interpreted s the reltion R,?ϕ s R?ϕ nd? ϕ s R? ϕ, give reltionl interprettion for the condition controlled loop repet until ϕ. 6.5 Combining Propositionl Logic nd Actions: PDL The lnguge of propositionl logic over some set of bsic propositions P is given by: ϕ ::= p ϕ ϕ ϕ ϕ ϕ where p rnges over P. If we ssume tht set of bsic ction symbols A is given, then the lnguge of ctions tht we discussed in Sections 6.2 nd 6.3 bove cn be formlly defined s: α ::=?ϕ α; α α α α where rnges over A.

18 6-18 CHAPTER 6. LOGIC AND ACTION Note tht the test?ϕ in this definition refers to the definition of ϕ in the lnguge of propositionl logic. Thus, the lnguge of propositionl logic is embedded in the lnguge of ctions. Now here is new ide, for lso doing the converse: extend the lnguge of propositionl logic with construction tht describes the results of executing n ction α. If α is interpreted s binry reltion then in given stte s there my be severl sttes s for which (s, s ) is in the interprettion of α. Interpret α ϕ s follows: α ϕ is true in stte s if for some s with (s, s ) in the interprettion of α it holds tht ϕ is true in s. For instnce, if is the ction of sking for promotion, nd p is the proposition expressing tht one is promoted, then p expresses tht sking for promotion my result in ctully getting promoted. Another useful expression is [α]ϕ, with the following interprettion: [α]ϕ is true in stte s if for every s with (s, s ) in the interprettion of α it holds tht ϕ is true in s. For instnce, if gin expresses sking for promotion, nd p expresses tht one is promoted, then []p expresses tht, in the current stte, the ction of sking for promotion lwys results in getting promoted. Note tht p nd []p re not equivlent: think of sitution where sking for promotion my lso result in getting fired. In tht cse p my still hold, but []p does not hold. If one combines propositionl logic with ctions in this wy one gets bsic logic of chnge clled Propositionl Dynmic Logic or PDL. Here is the forml definition of the lnguge of PDL: Definition 6.18 (Lnguge of PDL propositionl dynmic logic) Let p rnge over the set of bsic propositions P, nd let rnge over set of bsic ctions A. Then the formuls ϕ nd ction sttements α of propositionl dynmic logic re given by: ϕ ::= p ϕ ϕ 1 ϕ 2 ϕ 1 ϕ 2 α ϕ [α]ϕ α ::=?ϕ α 1 ; α 2 α 1 α 2 α The definition does not hve or. But this does not mtter, for we cn introduce these opertors by mens of bbrevitions or shorthnds. is the formul tht is lwys true. From this, we cn define, s shorthnd for.

19 6.5. COMBINING PROPOSITIONAL LOGIC AND ACTIONS: PDL 6-19 Similrly, ϕ 1 ϕ 2 is shorthnd for ϕ 1 ϕ 2, ϕ 1 ϕ 2 is shorthnd for (ϕ 1 ϕ 2 ) (ϕ 2 ϕ 1 ). Propositionl dynmic logic bstrcts over the set of bsic ctions, in the sense tht bsic ctions cn be nything. In the lnguge of PDL they re toms. This mens tht the rnge of pplicbility of PDL is vst. The only thing tht mtters bout bsic ction is tht it is interpreted by some binry reltion on stte set. Propositionl dynmic logic hs two bsic syntctic ctegories: formuls nd ction sttements. Formuls re used for tlking bout sttes, ction sttements re used for clssifying trnsitions between sttes. The sme distinction between formuls nd ction sttements cn be found in ll impertive progrmming lnguges. The sttements of C or Jv or Ruby re the ction sttements. Bsic ctions in C re ssigning vlue to vrible. These re instructions to chnge the memory stte of the mchine. The so-clled Boolen expressions in C behve like formuls of propositionl logic. They pper s conditions or tests in conditionl expressions. Consider the following C sttement: if (y < z) x = y; else x = z; This is description of n ction. But the ingredient (y<z) is not sttement (description of n ction) but Boolen expression (description of stte) tht expresses test. Propositionl dynmic logic is n extension of propositionl logic with ction sttements, just like epistemic logic is n extension of propositionl logic with epistemic modlities. Let set of bsic propositions P be given. Then pproprite sttes will contin vlutions for these propositions. Let set of bsic ctions A be given. Then every bsic ction corresponds to binry reltion on the stte set. Together this gives lbeled trnsition system with vlutions on sttes s subsets from P nd lbels on rcs between sttes tken from A. Exercise 6.19 Suppose we lso wnt to introduce shorthnd α n, for sequence of n copies of ction sttement α. Show how this cn be defined by induction. (Hint: use α 0 :=? s the bse cse.) Let s get feel for the kind of things we cn express with PDL. For ny ction sttement α, α expresses tht the ction α hs t lest one successful execution. Similrly, [α] expresses tht the ction fils (cnnot be executed in the current stte).

20 6-20 CHAPTER 6. LOGIC AND ACTION The bsic ctions cn be nything, so let us focus on bsic ction tht is interpreted s the reltion R. Suppose we wnt to sy tht some execution of leds to p stte nd nother execution of leds to non-p stte. Then here is PDL formul for tht: p p. If this formul is true in stte s, then this mens tht R forks in tht stte: there re t lest two R rrows strting from s, one of them to stte s 1 stisfying p nd one of them to stte s 1 tht does not stisfy p. For the interprettion of P we need properties of sttes, for p is like one-plce predicte in predicte logic. If the bsic ctions re chnges in the world, such s spilling milk S or clening C, then [C; S]d expresses tht clening up followed by spilling milk lwys results in dirty stte, while [S; C] d expresses tht the occurrence of these events in the reverse order lwys results in clen stte. 6.6 Trnsition Systems In Section 6.7 we will define the semntics of PDL reltive to lbelled trnsition systems, or process grphs. Definition 6.20 (Lbelled trnsition system) Let P be set of bsic propositions nd A set of lbels for bsic ctions. Then lbelled trnsition system (or LTS) over toms P nd gents A is triple M = S, R, V where S is set of sttes, V : S P(P ) is vlution function, nd R = { S S A} is set of lbelled trnsitions, i.e., set of binry reltions on S, one for ech lbel. Another wy to look t lbelled trnsition system is s first order model predicte for lnguge with unry nd binry predictes. LTSs with designted node (clled the root node) re clled pointed LTSs or process grphs. The process of repetedly doing, followed by choice between b nd c cn be viewed s process grph, s follows: 0 b c 1

21 6.6. TRANSITION SYSTEMS 6-21 The root note 0 is indicted by. There re two sttes 0 nd 1. The process strt in stte 0 with the execution of ction. This gets us to stte 1, where there re two possible ctions b nd c, both of which get us bck to stte 0, nd there the process repets. This is n infinite process, just like n operting system of computer. Unless there is system crsh, the process goes on forever. Jumping out of process cn be done by creting n ction tht moves to n end stte. 0 b c 1 d 2 We cn think bout s proposition letter, nd then use PDL to tlk bout these process grphs. In stte 1 of the first model d is flse, in stte 1 of the second model d is true. This formul expresses tht d trnsition to stte is possible. In both models it is the cse in stte 0 tht fter ny number of sequences consisting of n step followed by either b or c step, further step is possible. This is expressed by the following PDL formul: [(; (b c)) ]. Exercise 6.21 Which of the following formuls re true in stte 0 of the two models given bove: (1) ; d. (2) [; d]. (3) []( b c ). (4) [] d. The following two pictures illustrte n importnt distinction:

22 6-22 CHAPTER 6. LOGIC AND ACTION b c b c In the picture on the left, it is possible to tke n ction from the root, nd next to mke choice between doing b or doing c. In the picture on the right, there re two wys of doing, one of them ends in stte where b is the only possible move nd the other one ending in stte where c is the only possible move. This difference cn be expressed in PDL formul, s follows. In the root stte of the picture on the left, []( b c ) is true, in the root stte of the picture on the right this formul is flse. Exercise 6.22 Find PDL formul tht cn distinguish between the root sttes of the following two process grphs: 0 0 b 1 1 b 2 The formul should be true in one grph, flse in the other.

23 6.7. SEMANTICS OF PDL 6-23 Exercise 6.23 Now consider the following two pictures of process grphs: 0 0 b b b 2 Is it still possible to find PDL formul tht is true in the root of one of the grphs nd flse in the root of the other? If your nswer is yes, then give such formul. If your nswer is no, then try to explin s clerly s you cn why you think this is impossible. 6.7 Semntics of PDL The formuls of PDL re interpreted in sttes of lbeled trnsition system (or: LTS, or: process grph), nd the ctions of PDL s binry reltions on the domin S of the LTS. We cn think of n LTS s given by its set of sttes S, its vlution V, nd its set of lbelled trnsitions R. We will give the interprettion of bsic ctions s. If n LTS M is given, we use S M to refer to its set of sttes, we use R M to indicte its set of lbelled trnsitions, nd we use V M for its vlution. Definition 6.24 (Semntics of PDL) Given is lbelled trnsition system M = S, V, R for P nd A. M, s = lwys M, s = p p V (s) M, s = ϕ M, s = ϕ M, s = ϕ ψ M, s = ϕ or M, s = ψ M, s = ϕ ψ M, s = ϕ nd M, s = ψ M, s = α ϕ for some t, (s, t) [α] M nd M, t = ϕ M, s = [α]ϕ for ll t with (s, t) [α] M it holds tht M, t = ϕ.

24 6-24 CHAPTER 6. LOGIC AND ACTION where the binry reltion [α] M interpreting the ction α in the model M is defined s [] M = M [?ϕ] M = {(s, s) S M S M M, s = ϕ} [α 1 ; α 2 ] M = [α 1 ] M [α 2 ] M [α 1 α 2 ] M = [α 1 ] M [α 2 ] M [α ] M = ([α] M ) Note tht the cluse for [α ] M uses the definition of reflexive trnsitive closure tht ws given on pge These cluses specify how formuls of PDL cn be used to mke ssertions bout PDL models. Exmple 6.25 The formul, when interpreted t some stte in PDL model, expresses tht tht stte hs successor in the reltion in tht model. A PDL formul ϕ is true in model if it holds t every stte in tht model, i.e., if [ϕ] M = S M. Exmple 6.26 Truth of the formul in model expresses tht is seril in tht model. (A binry reltion R is seril on domin S if it holds for ll s S tht there is some t S with srt.) A PDL formul ϕ is vlid if it holds for ll PDL models M tht ϕ is true in tht model, i.e., tht [ϕ] M = S M. Exercise 6.27 Show tht ; b b is n exmple of vlid formul. As ws note before,? is n opertion for mpping formuls to ction sttements. Action sttements of the form?ϕ re clled tests; they re interpreted s the identity reltion, restricted to the sttes stisfying the formul. Exercise 6.28 Let the following PDL model be given: b 1 : pq 2 : pq 3 : pq 4 : pq b

25 6.7. SEMANTICS OF PDL 6-25 Give the interprettions of?p, of?(p q), of ; b nd of b;. Exercise 6.29 Let the following PDL model be given: 1 : pq 2 : pq b 4 : pq b 3 : pq (1) List the sttes where the following formuls re true:. p b. b q c. [](p b q) (2) Give formul tht is true only t stte 4. (3) Give ll the elements of the reltions defined by the following ction expressions:. b; b b. b c. (4) Give PDL ction expression tht defines the reltion {(1, 3)} in the grph. (Hint: use one or more test ctions.) Let ˇ(converse) be n opertor on PDL progrms with the following interpre- Converse ttion: [αˇ] M = {(s, t) (t, s) [α] M }. Exercise 6.30 Show tht the following equlities hold: (α; β)ˇ = βˇ; αˇ (α β)ˇ = αˇ βˇ (α )ˇ = (αˇ) Exercise 6.31 Show how the equlities from the previous exercise, plus tomic converse ˇ, cn be used to define αˇ, for rbitrry α, by wy of bbrevition.

26 6-26 CHAPTER 6. LOGIC AND ACTION It follows from Exercises 6.30 nd 6.31 tht it is enough to dd converse to the PDL lnguge for tomic ctions only. To see tht dding converse in this wy increses expressive power, observe tht in root stte 0 in the following picture ˇ is true, while in root stte 2 in the picture ˇ is flse. On the ssumption tht 0 nd 2 hve the sme vlution, no PDL formul without converse cn distinguish the two sttes Axiomtistion The logic of PDL is xiomtised s follows. Axioms re ll propositionl tutologies, plus n xiom stting tht α behves s stndrd modl opertor, plus xioms describing the effects of the progrm opertors (we give box ([α])versions here, but every xiom hs n equivlent dimond ( α ) version), plus propositionl inference rule nd modl inference rule. The propositionl inference rule is the fmilir rule of Modus Ponens. (modus ponens) From ϕ 1 nd ϕ 1 ϕ 2, infer ϕ 2. The modl inference rule is the rule of modl generliztion (or: necessittion): (modl generlistion) From ϕ, infer [α]ϕ. Modl generliztion expresses tht theorems of the system hve to hold in every stte. Exmple 6.32 Tke the formul (ϕ ψ) ϕ. Becuse this is propositionl tutology, it is theorem of the system, so we hve (ϕ ψ) ϕ. And becuse it is theorem, it hs to hold everywhere, so we hve, for ny α: [α]((ϕ ψ) ϕ). Now let us turn to the xioms. The first xiom is the K xiom (fmilir from Chpter 5) tht expresses tht progrm modlities distribute over implictions: (K) [α](ϕ ψ) ([α]ϕ [α]ψ)

27 6.8. AXIOMATISATION 6-27 Exmple 6.33 As n exmple of how to ply with this, we derive the equivlent α version. By the K xiom, the following is theorem (just replce ψ by ψ everywhere in the xiom): [α](ϕ ψ) ([α]ϕ [α] ψ). From this, by the propositionl resoning principle of contrposition: From this, by propositionl resoning: ([α]ϕ [α] ψ) [α](ϕ ψ). [α]ϕ [α] ψ) [α](ϕ ψ). Now replce ll boxes by dimonds, using the bbrevition α ϕ for [α]ϕ: α ϕ α ψ) α (ϕ ψ). This cn be simplified by propositionl logic, nd we get: ( α ϕ α ψ) α (ϕ ψ). Exmple 6.34 This exmple is similr to Exmple 5.45 from Chpter 5. Above, we hve seen tht [α]((ϕ ψ) ϕ) is theorem. With the K xiom, we cn derive from this: [α](ϕ ψ) [α]ϕ. In similr wy, we cn derive: From these by propositionl resoning: [α](ϕ ψ) [α]ψ. [α](ϕ ψ) ([α]ϕ [α]ψ). (*) The impliction in the other direction is lso derivble, s follows: ϕ (ψ (ϕ ψ)), becuse ϕ (ψ (ϕ ψ)) is propositionl tutology. By modl generliztion (necessittion) from this: [α](ϕ (ψ (ϕ ψ))). By two pplictions of the K xiom nd propositionl resoning from this: [α]ϕ ([α]ψ [α](ϕ ψ)). Since ϕ (ψ χ) is propositionlly equivlent to (ϕ ψ) χ, we get from this by propositionl resoning: Putting the two principles ( ) nd ( ) together we get: ([α]ϕ [α]ψ) [α](ϕ ψ). (**) [α](ϕ ψ) ([α]ϕ [α]ψ). (***)

28 6-28 CHAPTER 6. LOGIC AND ACTION Let us turn to the next xiom, the xiom for test. This xiom sys tht [?ϕ 1 ]ϕ 2 expresses n impliction: The xioms for sequence nd for choice: (test) [?ϕ 1 ]ϕ 2 (ϕ 1 ϕ 2 ) (sequence) [α 1 ; α 2 ]ϕ [α 1 ][α 2 ]ϕ (choice) [α 1 α 2 ]ϕ [α 1 ]ϕ [α 2 ]ϕ Exmple 6.35 As n exmple ppliction, we derive Here is the derivtion: [α; (β γ)]ϕ [α][β]ϕ [α][γ]ϕ. [α; (β γ)]ϕ (sequence) [α][β γ]ϕ (choice) (***) [α]([β]ϕ [γ]ϕ) [α][β]ϕ [α][γ]ϕ. These xioms together reduce PDL formuls without to formuls of multi-modl logic (propositionl logic extended with simple modlities [] nd ). Exmple 6.36 We show how this reduction works for the formul [(; b) (?ϕ; c)]ψ: [(; b) (?ϕ; c)]ψ (choice) [; b]ψ [?ϕ; c]ψ For the opertion there re two xioms: (sequence) (test) (mix) [α ]ϕ ϕ [α][α ]ϕ [][b]ψ [?ϕ][c]ψ [][b]ψ (ϕ [c]ψ). (induction) (ϕ [α ](ϕ [α]ϕ)) [α ]ϕ The mix xiom expresses the fct tht α is reflexive nd trnsitive reltion contining α, nd the xiom of induction cptures the fct tht α is the lest reflexive nd trnsitive reltion contining α. As ws mentioned before, ll xioms hve dul forms in terms of α, derivble by propositionl resoning. For exmple, the dul form of the test xiom reds The dul form of the induction xiom reds?ϕ 1 ϕ 2 (ϕ 1 ϕ 2 ). α ϕ ϕ α ( ϕ α ϕ).

29 6.8. AXIOMATISATION 6-29 Exercise 6.37 Give the dul form of the mix xiom. We will now show tht in the presence of the other xioms, the induction xiom is equivlent to the so-clled loop invrince rule: Here is the theorem: ϕ [α]ϕ ϕ [α ]ϕ Theorem 6.38 In PDL without the induction xiom, the induction xiom nd the loop invrince rule re interderivble. Proof. For deriving the loop invrince rule from the induction xiom, ssume the induction xiom. Suppose ϕ [α]ϕ. Then by modl generlistion: [α ](ϕ [α]ϕ). By propositionl resoning we get from this: ϕ (ϕ [α ](ϕ [α]ϕ)). From this by the induction xiom nd propositionl resoning: ϕ [α ]ϕ. Now ssume the loop invrince rule. We hve to estblish the induction xiom. By the mix xiom nd propositionl resoning: (ϕ [α ](ϕ [α]ϕ)) [α]ϕ. Agin from the mix xiom nd propositionl resoning: (ϕ [α ](ϕ [α]ϕ)) [α][α ](ϕ [α]ϕ). From the two bove, with propositionl resoning using (***): (ϕ [α ](ϕ [α]ϕ)) [α](ϕ [α ](ϕ [α]ϕ)). Applying the loop invrince rule to this yields: (ϕ [α ](ϕ [α]ϕ)) [α ](ϕ [α ](ϕ [α]ϕ)). From this we get the induction xiom by propositionl resoning: (ϕ [α ](ϕ [α]ϕ)) [α ]ϕ. This ends the proof.

30 6-30 CHAPTER 6. LOGIC AND ACTION Axioms for Converse re the following: Suitble xioms to enforce tht ˇ behves s the converse of ϕ [] ˇ ϕ ϕ [ˇ] ϕ Exercise 6.39 Show tht the xioms for converse re sound, by showing tht they hold in ny stte in ny LTS. 6.9 Expressive power: defining progrmming constructs The lnguge of PDL is powerful enough to express conditionl sttements, fixed loop sttements, nd condition-controlled loop sttements s PDL progrms. More precisely, the conditionl sttement if ϕ then α 1 else α 2 cn be viewed s n bbrevition of the following PDL progrm: (?ϕ; α 1 ) (? ϕ; α 2 ). The fixed loop sttement cn be viewed s n bbrevition of do n times α The condition-controlled loop sttement cn be viewed s n bbrevition of α; ; α } {{ } n times while ϕ do α (?ϕ; α) ;? ϕ. This loop construction expressed in terms of reflexive trnsitive closure works for finite repetitions only, for note tht the interprettion of while do α in ny model is the empty reltion. Successful execution of every progrm we re considering here involves termintion of the progrm. The condition controlled loop sttement cn be viewed s n bbrevition of repet α until ϕ α; (? ϕ; α) ;?ϕ.

31 6.10. OUTLOOK PROGRAMS AND COMPUTATION 6-31 Note how these definitions mke the difference cler between the while nd repet sttements. A repet sttement lwys executes n ction t lest once, nd next keeps on performing the ction until the stop condition holds. A while sttement checks continue condition nd keeps on performing n ction until tht condition does not hold nymore. If while ϕ do α gets executed, it my be tht the α ction does not even get executed once. This will hppen if ϕ is flse in the strt stte. In impertive progrmming, we lso hve the skip progrm (the progrm tht does nothing) nd the bort progrm (the progrm tht lwys fils): skip cn be defined s? (this is test tht lwys succeeds) nd bort s (this is test tht lwys fils). Tking stock, we see tht with the PDL ction opertions we cn define the whole repertoire of impertive progrmming constructs: inside of PDL there is full fledged impertive progrmming lnguge. Moreover, given PDL progrm α, the progrm modlities α ϕ nd [α]ϕ cn be used to describe so-clled postconditions of execution for progrm α. The first of these expresses tht α hs successful exection tht ends in n ϕ stte; the second one expresses tht every successful execution of α ends in ϕ stte. We will sy more bout the use of this in Section 6.10 below Outlook Progrms nd Computtion If one wishes to interpret PDL s logic of computtion, then nturl choice for interpreting the bsic ctions sttements is s register ssignment sttements. If we do this, then we effectively turn the ction sttement prt of PDL into very expressive progrmming lnguge. Let v rnge over set of registers or memory loctions V. A V -memory is set of storge loctions for integer numbers, ech lbelled by member of V. Let V = {v 1,..., v n }. Then V -memory cn be pictured like this: v 1 v 2 v 3 v 4 v 5 v 6 v 7 A V -stte s is function V Z. We cn think of V -stte s V -memory together with its contents. In picture: v 1 v 2 v 3 v 4 v 5 v 6 v If s is V -stte, s(v) gives the contents of register v in tht stte. So if s is the stte bove, then s(v 2 ) = 3.

32 6-32 CHAPTER 6. LOGIC AND ACTION Let i rnge over integer nmes, such s 0, 234 or nd let v rnge over V. Then the following defines rithmeticl expressions: ::= i v It is cler tht we cn find out the vlue [] s of ech rithmeticl expression in given V -stte s. Exercise 6.40 Provide the forml detils, by giving recursive definition of [] s. Next, ssume tht bsic propositions hve the form 1 2, nd tht bsic ction sttements hve the form v :=. This gives us progrmming lnguge for computing with integers s ction sttement lnguge nd formul lnguge tht llows us to express properties of progrms. Determinism To sy tht progrm α is deterministic is to sy tht if α executes successfully, then the end stte is uniquely determined by the initil stte. In terms of PDL formuls, the following hs to hold for every ϕ: α ϕ [α]ϕ. Clerly, the bsic progrmming ctions v := re deterministic. Termintion To sy tht progrm α termintes (or: hlts) in given initil stte is to sy tht there is successful execution of α from the current stte. To sy tht α lwys termintes is to sy tht α hs successful execution from ny initil stte. Here is PDL version: α. Clerly, the bsic progrmming ctions v := lwys terminte. Non-termintion of progrms comes in with loop constructs. Here is n exmple of progrm tht never termintes: while do v := v + 1. One step through the loop increments the vlue of register v by 1. Since the loop condition will remin true, this will go on forever. In fct, mny more properties beside determinism nd termintion cn be expressed, nd in very systemtic wy. We will give some exmples of the style of resoning involved. Consider the following problem concerning the out- Hore Correctness Resoning come of pebble drwing ction.

33 6.10. OUTLOOK PROGRAMS AND COMPUTATION 6-33 A vse contins 35 white pebbles nd 35 blck pebbles. Proceed s follows to drw pebbles from the vse, s long s this is possible. Every round, drw two pebbles from the vse. If they hve the sme colour, then put blck pebble into the vse (you my ssume tht there re enough dditionl blck pebbles outside of the vse). If they hve different colours, then put the white pebble bck. In every round one pebble is removed from the vse, so fter 69 rounds there is single pebble left. Wht is the colour of this pebble? It my seem tht the problem does not provide enough informtion for definite nswer, but in fct it does. The key to the solution is to discover n pproprite loop invrint: property tht is initilly true, nd tht does not chnge during the procedure. Exercise 6.41 Consider the property: the number of white pebbles is odd. Obviously, this is initilly true. Show tht the property is loop invrint of the pebble drwing procedure. Wht follows bout the colour of the lst pebble? It is possible to formlize this kind of resoning bout progrms. This formliztion is clled Hore logic. One of the seminl ppers in computer science is Hore s [Ho69]. where the following nottion is introduced for specifying wht computer progrm written in n impertive lnguge (like C or Jv) does: {P } C {Q}. Here C is progrm from formlly defined progrmming lnguge for impertive progrmming, nd P nd Q re conditions on the progrmming vribles used in C. Sttement {P } C {Q} is true if whenever C is executed in stte stisfying P nd if the execution of C termintes, then the stte in which execution of C termintes stisfies Q. The Hore-triple {P } C {Q} is clled prtil correctness specifiction; P is clled its precondition nd Q its postcondition. Hore logic, s the logic of resoning with such correctness specifictions is clled, is the precursor of ll the dynmic logics known tody. Hore correctness ssertions re expressible in PDL, s follows. If ϕ, ψ re PDL formuls nd α is PDL progrm, then {ϕ} α {ψ} trnsltes into ϕ [α]ψ. Clerly, {ϕ} α {ψ} holds in stte in model iff ϕ [α]ψ is true in tht stte in tht model. The Hore inference rules cn now be derived in PDL. As n exmple we derive the rule for gurded itertion: {ϕ ψ} α {ψ} {ψ} while ϕ do α { ϕ ψ}

34 6-34 CHAPTER 6. LOGIC AND ACTION First n explntion of the rule. The correctness of while sttements is estblished by finding loop invrint. Consider the following C function: int squre (int n) { int x = 0; int k = 0; while (k < n) { x = x + 2*k + 1; k = k + 1; } return x; } How cn we see tht this progrm correctly computes squres? By estblishing loop invrint: {x = k 2 } x = x + 2*k + 1; k = k + 1; {x = k 2 }. Wht this sys is: if the stte before execution of the progrm is such tht x = k 2 holds, then in the new stte, fter execution of the progrm, with the new vlues of the registers x nd k, the reltion x = k 2 still holds. From this we get, with the Hore rule for while: {x = k 2 } while (k < n) { x = x + 2*k + 1; k = k + 1; } {x = k 2 k = n} Combining this with the initilistion: { } int x = 0 ; int k = 0; {x = k 2 } while (k < n) { x = x + 2*k + 1; k = k + 1; } {x = k 2 k = n} This estblishes tht the while loop correctly computes the squre of n in x. So how do we derive the Hore rule for while in PDL? Let the premise {ϕ ψ} α {ψ} be given, i.e., ssume (6.1). (ϕ ψ) [α]ψ. (6.1) We wish to derive the conclusion i.e., we wish to derive (6.2). {ψ} while ϕ do α { ϕ ψ}, ψ [(?ϕ; α) ;? ϕ]( ϕ ψ). (6.2)

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY MAT 0630 INTERNET RESOURCES, REVIEW OF CONCEPTS AND COMMON MISTAKES PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY Contents 1. ACT Compss Prctice Tests 1 2. Common Mistkes 2 3. Distributive

More information

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers. 2 Rtionl Numbers Integers such s 5 were importnt when solving the eqution x+5 = 0. In similr wy, frctions re importnt for solving equtions like 2x = 1. Wht bout equtions like 2x + 1 = 0? Equtions of this

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES DAVID WEBB CONTENTS Liner trnsformtions 2 The representing mtrix of liner trnsformtion 3 3 An ppliction: reflections in the plne 6 4 The lgebr of

More information

Regular Sets and Expressions

Regular Sets and Expressions Regulr Sets nd Expressions Finite utomt re importnt in science, mthemtics, nd engineering. Engineers like them ecuse they re super models for circuits (And, since the dvent of VLSI systems sometimes finite

More information

4.11 Inner Product Spaces

4.11 Inner Product Spaces 314 CHAPTER 4 Vector Spces 9. A mtrix of the form 0 0 b c 0 d 0 0 e 0 f g 0 h 0 cnnot be invertible. 10. A mtrix of the form bc d e f ghi such tht e bd = 0 cnnot be invertible. 4.11 Inner Product Spces

More information

Algebra Review. How well do you remember your algebra?

Algebra Review. How well do you remember your algebra? Algebr Review How well do you remember your lgebr? 1 The Order of Opertions Wht do we men when we write + 4? If we multiply we get 6 nd dding 4 gives 10. But, if we dd + 4 = 7 first, then multiply by then

More information

Experiment 6: Friction

Experiment 6: Friction Experiment 6: Friction In previous lbs we studied Newton s lws in n idel setting, tht is, one where friction nd ir resistnce were ignored. However, from our everydy experience with motion, we know tht

More information

Operations with Polynomials

Operations with Polynomials 38 Chpter P Prerequisites P.4 Opertions with Polynomils Wht you should lern: Write polynomils in stndrd form nd identify the leding coefficients nd degrees of polynomils Add nd subtrct polynomils Multiply

More information

9 CONTINUOUS DISTRIBUTIONS

9 CONTINUOUS DISTRIBUTIONS 9 CONTINUOUS DISTIBUTIONS A rndom vrible whose vlue my fll nywhere in rnge of vlues is continuous rndom vrible nd will be ssocited with some continuous distribution. Continuous distributions re to discrete

More information

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity Bbylonin Method of Computing the Squre Root: Justifictions Bsed on Fuzzy Techniques nd on Computtionl Complexity Olg Koshelev Deprtment of Mthemtics Eduction University of Texs t El Pso 500 W. University

More information

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( ) Polynomil Functions Polynomil functions in one vrible cn be written in expnded form s n n 1 n 2 2 f x = x + x + x + + x + x+ n n 1 n 2 2 1 0 Exmples of polynomils in expnded form re nd 3 8 7 4 = 5 4 +

More information

Factoring Polynomials

Factoring Polynomials Fctoring Polynomils Some definitions (not necessrily ll for secondry school mthemtics): A polynomil is the sum of one or more terms, in which ech term consists of product of constnt nd one or more vribles

More information

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions. Lerning Objectives Loci nd Conics Lesson 3: The Ellipse Level: Preclculus Time required: 120 minutes In this lesson, students will generlize their knowledge of the circle to the ellipse. The prmetric nd

More information

Integration by Substitution

Integration by Substitution Integrtion by Substitution Dr. Philippe B. Lvl Kennesw Stte University August, 8 Abstrct This hndout contins mteril on very importnt integrtion method clled integrtion by substitution. Substitution is

More information

Math 135 Circles and Completing the Square Examples

Math 135 Circles and Completing the Square Examples Mth 135 Circles nd Completing the Squre Exmples A perfect squre is number such tht = b 2 for some rel number b. Some exmples of perfect squres re 4 = 2 2, 16 = 4 2, 169 = 13 2. We wish to hve method for

More information

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes The Sclr Product 9.3 Introduction There re two kinds of multipliction involving vectors. The first is known s the sclr product or dot product. This is so-clled becuse when the sclr product of two vectors

More information

Reasoning to Solve Equations and Inequalities

Reasoning to Solve Equations and Inequalities Lesson4 Resoning to Solve Equtions nd Inequlities In erlier work in this unit, you modeled situtions with severl vriles nd equtions. For exmple, suppose you were given usiness plns for concert showing

More information

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

and thus, they are similar. If k = 3 then the Jordan form of both matrices is Homework ssignment 11 Section 7. pp. 249-25 Exercise 1. Let N 1 nd N 2 be nilpotent mtrices over the field F. Prove tht N 1 nd N 2 re similr if nd only if they hve the sme miniml polynomil. Solution: If

More information

Binary Representation of Numbers Autar Kaw

Binary Representation of Numbers Autar Kaw Binry Representtion of Numbers Autr Kw After reding this chpter, you should be ble to: 1. convert bse- rel number to its binry representtion,. convert binry number to n equivlent bse- number. In everydy

More information

Graphs on Logarithmic and Semilogarithmic Paper

Graphs on Logarithmic and Semilogarithmic Paper 0CH_PHClter_TMSETE_ 3//00 :3 PM Pge Grphs on Logrithmic nd Semilogrithmic Pper OBJECTIVES When ou hve completed this chpter, ou should be ble to: Mke grphs on logrithmic nd semilogrithmic pper. Grph empiricl

More information

2005-06 Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

2005-06 Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration Source: http://www.mth.cuhk.edu.hk/~mt26/mt26b/notes/notes3.pdf 25-6 Second Term MAT26B 1 Supplementry Notes 3 Interchnge of Differentition nd Integrtion The theme of this course is bout vrious limiting

More information

Object Semantics. 6.170 Lecture 2

Object Semantics. 6.170 Lecture 2 Object Semntics 6.170 Lecture 2 The objectives of this lecture re to: to help you become fmilir with the bsic runtime mechnism common to ll object-oriented lnguges (but with prticulr focus on Jv): vribles,

More information

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2011 - Final Exam

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2011 - Final Exam 1./1.1 Introduction to Computers nd Engineering Problem Solving Fll 211 - Finl Exm Nme: MIT Emil: TA: Section: You hve 3 hours to complete this exm. In ll questions, you should ssume tht ll necessry pckges

More information

Section 5-4 Trigonometric Functions

Section 5-4 Trigonometric Functions 5- Trigonometric Functions Section 5- Trigonometric Functions Definition of the Trigonometric Functions Clcultor Evlution of Trigonometric Functions Definition of the Trigonometric Functions Alternte Form

More information

Basic Analysis of Autarky and Free Trade Models

Basic Analysis of Autarky and Free Trade Models Bsic Anlysis of Autrky nd Free Trde Models AUTARKY Autrky condition in prticulr commodity mrket refers to sitution in which country does not engge in ny trde in tht commodity with other countries. Consequently

More information

One Minute To Learn Programming: Finite Automata

One Minute To Learn Programming: Finite Automata Gret Theoreticl Ides In Computer Science Steven Rudich CS 15-251 Spring 2005 Lecture 9 Fe 8 2005 Crnegie Mellon University One Minute To Lern Progrmming: Finite Automt Let me tech you progrmming lnguge

More information

SPECIAL PRODUCTS AND FACTORIZATION

SPECIAL PRODUCTS AND FACTORIZATION MODULE - Specil Products nd Fctoriztion 4 SPECIAL PRODUCTS AND FACTORIZATION In n erlier lesson you hve lernt multipliction of lgebric epressions, prticulrly polynomils. In the study of lgebr, we come

More information

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001 CS99S Lortory 2 Preprtion Copyright W. J. Dlly 2 Octoer, 2 Ojectives:. Understnd the principle of sttic CMOS gte circuits 2. Build simple logic gtes from MOS trnsistors 3. Evlute these gtes to oserve logic

More information

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation FUNCTIONS AND EQUATIONS. SETS AND SUBSETS.. Definition of set. A set is ny collection of objects which re clled its elements. If x is n element of the set S, we sy tht x belongs to S nd write If y does

More information

0.1 Basic Set Theory and Interval Notation

0.1 Basic Set Theory and Interval Notation 0.1 Bsic Set Theory nd Intervl Nottion 3 0.1 Bsic Set Theory nd Intervl Nottion 0.1.1 Some Bsic Set Theory Notions Like ll good Mth ooks, we egin with definition. Definition 0.1. A set is well-defined

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata N Lecture Notes on Regulr Lnguges nd Finite Automt for Prt IA of the Computer Science Tripos Mrcelo Fiore Cmbridge University Computer Lbortory First Edition 1998. Revised 1999, 2000, 2001, 2002, 2003,

More information

All pay auctions with certain and uncertain prizes a comment

All pay auctions with certain and uncertain prizes a comment CENTER FOR RESEARC IN ECONOMICS AND MANAGEMENT CREAM Publiction No. 1-2015 All py uctions with certin nd uncertin prizes comment Christin Riis All py uctions with certin nd uncertin prizes comment Christin

More information

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom Byesin Updting with Continuous Priors Clss 3, 8.05, Spring 04 Jeremy Orloff nd Jonthn Bloom Lerning Gols. Understnd prmeterized fmily of distriutions s representing continuous rnge of hypotheses for the

More information

Integration. 148 Chapter 7 Integration

Integration. 148 Chapter 7 Integration 48 Chpter 7 Integrtion 7 Integrtion t ech, by supposing tht during ech tenth of second the object is going t constnt speed Since the object initilly hs speed, we gin suppose it mintins this speed, but

More information

Treatment Spring Late Summer Fall 0.10 5.56 3.85 0.61 6.97 3.01 1.91 3.01 2.13 2.99 5.33 2.50 1.06 3.53 6.10 Mean = 1.33 Mean = 4.88 Mean = 3.

Treatment Spring Late Summer Fall 0.10 5.56 3.85 0.61 6.97 3.01 1.91 3.01 2.13 2.99 5.33 2.50 1.06 3.53 6.10 Mean = 1.33 Mean = 4.88 Mean = 3. The nlysis of vrince (ANOVA) Although the t-test is one of the most commonly used sttisticl hypothesis tests, it hs limittions. The mjor limittion is tht the t-test cn be used to compre the mens of only

More information

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one. 5.2. LINE INTEGRALS 265 5.2 Line Integrls 5.2.1 Introduction Let us quickly review the kind of integrls we hve studied so fr before we introduce new one. 1. Definite integrl. Given continuous rel-vlued

More information

Lecture 3 Gaussian Probability Distribution

Lecture 3 Gaussian Probability Distribution Lecture 3 Gussin Probbility Distribution Introduction l Gussin probbility distribution is perhps the most used distribution in ll of science. u lso clled bell shped curve or norml distribution l Unlike

More information

Protocol Analysis. 17-654/17-764 Analysis of Software Artifacts Kevin Bierhoff

Protocol Analysis. 17-654/17-764 Analysis of Software Artifacts Kevin Bierhoff Protocol Anlysis 17-654/17-764 Anlysis of Softwre Artifcts Kevin Bierhoff Tke-Awys Protocols define temporl ordering of events Cn often be cptured with stte mchines Protocol nlysis needs to py ttention

More information

6.2 Volumes of Revolution: The Disk Method

6.2 Volumes of Revolution: The Disk Method mth ppliction: volumes of revolution, prt ii Volumes of Revolution: The Disk Method One of the simplest pplictions of integrtion (Theorem ) nd the ccumultion process is to determine so-clled volumes of

More information

Words Symbols Diagram. abcde. a + b + c + d + e

Words Symbols Diagram. abcde. a + b + c + d + e Logi Gtes nd Properties We will e using logil opertions to uild mhines tht n do rithmeti lultions. It s useful to think of these opertions s si omponents tht n e hooked together into omplex networks. To

More information

Module Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials

Module Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials MEI Mthemtics in Ection nd Instry Topic : Proof MEI Structured Mthemtics Mole Summry Sheets C, Methods for Anced Mthemtics (Version B reference to new book) Topic : Nturl Logrithms nd Eponentils Topic

More information

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS Known for over 500 yers is the fct tht the sum of the squres of the legs of right tringle equls the squre of the hypotenuse. Tht is +b c. A simple proof is

More information

AntiSpyware Enterprise Module 8.5

AntiSpyware Enterprise Module 8.5 AntiSpywre Enterprise Module 8.5 Product Guide Aout the AntiSpywre Enterprise Module The McAfee AntiSpywre Enterprise Module 8.5 is n dd-on to the VirusScn Enterprise 8.5i product tht extends its ility

More information

A.7.1 Trigonometric interpretation of dot product... 324. A.7.2 Geometric interpretation of dot product... 324

A.7.1 Trigonometric interpretation of dot product... 324. A.7.2 Geometric interpretation of dot product... 324 A P P E N D I X A Vectors CONTENTS A.1 Scling vector................................................ 321 A.2 Unit or Direction vectors...................................... 321 A.3 Vector ddition.................................................

More information

Vectors 2. 1. Recap of vectors

Vectors 2. 1. Recap of vectors Vectors 2. Recp of vectors Vectors re directed line segments - they cn be represented in component form or by direction nd mgnitude. We cn use trigonometry nd Pythgors theorem to switch between the forms

More information

Econ 4721 Money and Banking Problem Set 2 Answer Key

Econ 4721 Money and Banking Problem Set 2 Answer Key Econ 472 Money nd Bnking Problem Set 2 Answer Key Problem (35 points) Consider n overlpping genertions model in which consumers live for two periods. The number of people born in ech genertion grows in

More information

Physics 6010, Fall 2010 Symmetries and Conservation Laws: Energy, Momentum and Angular Momentum Relevant Sections in Text: 2.6, 2.

Physics 6010, Fall 2010 Symmetries and Conservation Laws: Energy, Momentum and Angular Momentum Relevant Sections in Text: 2.6, 2. Physics 6010, Fll 2010 Symmetries nd Conservtion Lws: Energy, Momentum nd Angulr Momentum Relevnt Sections in Text: 2.6, 2.7 Symmetries nd Conservtion Lws By conservtion lw we men quntity constructed from

More information

1.2 The Integers and Rational Numbers

1.2 The Integers and Rational Numbers .2. THE INTEGERS AND RATIONAL NUMBERS.2 The Integers n Rtionl Numers The elements of the set of integers: consist of three types of numers: Z {..., 5, 4, 3, 2,, 0,, 2, 3, 4, 5,...} I. The (positive) nturl

More information

MODULE 3. 0, y = 0 for all y

MODULE 3. 0, y = 0 for all y Topics: Inner products MOULE 3 The inner product of two vectors: The inner product of two vectors x, y V, denoted by x, y is (in generl) complex vlued function which hs the following four properties: i)

More information

EQUATIONS OF LINES AND PLANES

EQUATIONS OF LINES AND PLANES EQUATIONS OF LINES AND PLANES MATH 195, SECTION 59 (VIPUL NAIK) Corresponding mteril in the ook: Section 12.5. Wht students should definitely get: Prmetric eqution of line given in point-direction nd twopoint

More information

3 The Utility Maximization Problem

3 The Utility Maximization Problem 3 The Utility Mxiiztion Proble We hve now discussed how to describe preferences in ters of utility functions nd how to forulte siple budget sets. The rtionl choice ssuption, tht consuers pick the best

More information

Helicopter Theme and Variations

Helicopter Theme and Variations Helicopter Theme nd Vritions Or, Some Experimentl Designs Employing Pper Helicopters Some possible explntory vribles re: Who drops the helicopter The length of the rotor bldes The height from which the

More information

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100 hsn.uk.net Higher Mthemtics UNIT 3 OUTCOME 1 Vectors Contents Vectors 18 1 Vectors nd Sclrs 18 Components 18 3 Mgnitude 130 4 Equl Vectors 131 5 Addition nd Subtrction of Vectors 13 6 Multipliction by

More information

Solving BAMO Problems

Solving BAMO Problems Solving BAMO Problems Tom Dvis tomrdvis@erthlink.net http://www.geometer.org/mthcircles Februry 20, 2000 Abstrct Strtegies for solving problems in the BAMO contest (the By Are Mthemticl Olympid). Only

More information

19. The Fermat-Euler Prime Number Theorem

19. The Fermat-Euler Prime Number Theorem 19. The Fermt-Euler Prime Number Theorem Every prime number of the form 4n 1 cn be written s sum of two squres in only one wy (side from the order of the summnds). This fmous theorem ws discovered bout

More information

Section 7-4 Translation of Axes

Section 7-4 Translation of Axes 62 7 ADDITIONAL TOPICS IN ANALYTIC GEOMETRY Section 7-4 Trnsltion of Aes Trnsltion of Aes Stndrd Equtions of Trnslted Conics Grphing Equtions of the Form A 2 C 2 D E F 0 Finding Equtions of Conics In the

More information

Physics 43 Homework Set 9 Chapter 40 Key

Physics 43 Homework Set 9 Chapter 40 Key Physics 43 Homework Set 9 Chpter 4 Key. The wve function for n electron tht is confined to x nm is. Find the normliztion constnt. b. Wht is the probbility of finding the electron in. nm-wide region t x

More information

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding 1 Exmple A rectngulr box without lid is to be mde from squre crdbord of sides 18 cm by cutting equl squres from ech corner nd then folding up the sides. 1 Exmple A rectngulr box without lid is to be mde

More information

Small Business Cloud Services

Small Business Cloud Services Smll Business Cloud Services Summry. We re thick in the midst of historic se-chnge in computing. Like the emergence of personl computers, grphicl user interfces, nd mobile devices, the cloud is lredy profoundly

More information

Lecture 5. Inner Product

Lecture 5. Inner Product Lecture 5 Inner Product Let us strt with the following problem. Given point P R nd line L R, how cn we find the point on the line closest to P? Answer: Drw line segment from P meeting the line in right

More information

How To Network A Smll Business

How To Network A Smll Business Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

The Definite Integral

The Definite Integral Chpter 4 The Definite Integrl 4. Determining distnce trveled from velocity Motivting Questions In this section, we strive to understnd the ides generted by the following importnt questions: If we know

More information

COMPONENTS: COMBINED LOADING

COMPONENTS: COMBINED LOADING LECTURE COMPONENTS: COMBINED LOADING Third Edition A. J. Clrk School of Engineering Deprtment of Civil nd Environmentl Engineering 24 Chpter 8.4 by Dr. Ibrhim A. Asskkf SPRING 2003 ENES 220 Mechnics of

More information

Corporate Compliance vs. Enterprise-Wide Risk Management

Corporate Compliance vs. Enterprise-Wide Risk Management Corporte Complince vs. Enterprise-Wide Risk Mngement Brent Sunders, Prtner (973) 236-4682 November 2002 Agend Corporte Complince Progrms? Wht is Enterprise-Wide Risk Mngement? Key Differences Why Will

More information

Exponential and Logarithmic Functions

Exponential and Logarithmic Functions Nme Chpter Eponentil nd Logrithmic Functions Section. Eponentil Functions nd Their Grphs Objective: In this lesson ou lerned how to recognize, evlute, nd grph eponentil functions. Importnt Vocbulr Define

More information

Or more simply put, when adding or subtracting quantities, their uncertainties add.

Or more simply put, when adding or subtracting quantities, their uncertainties add. Propgtion of Uncertint through Mthemticl Opertions Since the untit of interest in n eperiment is rrel otined mesuring tht untit directl, we must understnd how error propgtes when mthemticl opertions re

More information

www.mathsbox.org.uk e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

www.mathsbox.org.uk e.g. f(x) = x domain x 0 (cannot find the square root of negative values) www.mthsbo.org.uk CORE SUMMARY NOTES Functions A function is rule which genertes ectl ONE OUTPUT for EVERY INPUT. To be defined full the function hs RULE tells ou how to clculte the output from the input

More information

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered: Appendi D: Completing the Squre nd the Qudrtic Formul Fctoring qudrtic epressions such s: + 6 + 8 ws one of the topics introduced in Appendi C. Fctoring qudrtic epressions is useful skill tht cn help you

More information

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles. www.nand2tetris.org

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles. www.nand2tetris.org Virtul Mchine Prt II: Progrm Control Building Modern Computer From First Principles www.nnd2tetris.org Elements of Computing Systems, Nisn & Schocken, MIT Press, www.nnd2tetris.org, Chpter 8: Virtul Mchine,

More information

AA1H Calculus Notes Math1115, Honours 1 1998. John Hutchinson

AA1H Calculus Notes Math1115, Honours 1 1998. John Hutchinson AA1H Clculus Notes Mth1115, Honours 1 1998 John Hutchinson Author ddress: Deprtment of Mthemtics, School of Mthemticl Sciences, Austrlin Ntionl University E-mil ddress: John.Hutchinson@nu.edu.u Contents

More information

DlNBVRGH + Sickness Absence Monitoring Report. Executive of the Council. Purpose of report

DlNBVRGH + Sickness Absence Monitoring Report. Executive of the Council. Purpose of report DlNBVRGH + + THE CITY OF EDINBURGH COUNCIL Sickness Absence Monitoring Report Executive of the Council 8fh My 4 I.I...3 Purpose of report This report quntifies the mount of working time lost s result of

More information

Review guide for the final exam in Math 233

Review guide for the final exam in Math 233 Review guide for the finl exm in Mth 33 1 Bsic mteril. This review includes the reminder of the mteril for mth 33. The finl exm will be cumultive exm with mny of the problems coming from the mteril covered

More information

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS 3343 -- Spring 2009

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS 3343 -- Spring 2009 CS 4 -- Spring 2009 Sorting Crol Wenk Slides courtesy of Chrles Leiserson with smll chnges by Crol Wenk CS 4 Anlysis of Algorithms 1 How fst cn we sort? All the sorting lgorithms we hve seen so fr re comprison

More information

I calculate the unemployment rate as (In Labor Force Employed)/In Labor Force

I calculate the unemployment rate as (In Labor Force Employed)/In Labor Force Introduction to the Prctice of Sttistics Fifth Edition Moore, McCbe Section 4.5 Homework Answers to 98, 99, 100,102, 103,105, 107, 109,110, 111, 112, 113 Working. In the lnguge of government sttistics,

More information

CHAPTER 11 Numerical Differentiation and Integration

CHAPTER 11 Numerical Differentiation and Integration CHAPTER 11 Numericl Differentition nd Integrtion Differentition nd integrtion re bsic mthemticl opertions with wide rnge of pplictions in mny res of science. It is therefore importnt to hve good methods

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Hillsborough Township Public Schools Mathematics Department Computer Programming 1

Hillsborough Township Public Schools Mathematics Department Computer Programming 1 Essentil Unit 1 Introduction to Progrmming Pcing: 15 dys Common Unit Test Wht re the ethicl implictions for ming in tody s world? There re ethicl responsibilities to consider when writing computer s. Citizenship,

More information

Chapter 2 The Number System (Integers and Rational Numbers)

Chapter 2 The Number System (Integers and Rational Numbers) Chpter 2 The Number System (Integers nd Rtionl Numbers) In this second chpter, students extend nd formlize their understnding of the number system, including negtive rtionl numbers. Students first develop

More information

Lectures 8 and 9 1 Rectangular waveguides

Lectures 8 and 9 1 Rectangular waveguides 1 Lectures 8 nd 9 1 Rectngulr wveguides y b x z Consider rectngulr wveguide with 0 < x b. There re two types of wves in hollow wveguide with only one conductor; Trnsverse electric wves

More information

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010 /28/2 Lerning Outcomes At the end of this lecture you should: Computer Systems - Architecture Lecture 4 - Boolen Logic Eddie Edwrds eedwrds@doc.ic.c.uk http://www.doc.ic.c.uk/~eedwrds/compsys (Hevily sed

More information

Section 5.2, Commands for Configuring ISDN Protocols. Section 5.3, Configuring ISDN Signaling. Section 5.4, Configuring ISDN LAPD and Call Control

Section 5.2, Commands for Configuring ISDN Protocols. Section 5.3, Configuring ISDN Signaling. Section 5.4, Configuring ISDN LAPD and Call Control Chpter 5 Configurtion of ISDN Protocols This chpter provides instructions for configuring the ISDN protocols in the SP201 for signling conversion. Use the sections tht reflect the softwre you re configuring.

More information

Decision Rule Extraction from Trained Neural Networks Using Rough Sets

Decision Rule Extraction from Trained Neural Networks Using Rough Sets Decision Rule Extrction from Trined Neurl Networks Using Rough Sets Alin Lzr nd Ishwr K. Sethi Vision nd Neurl Networks Lbortory Deprtment of Computer Science Wyne Stte University Detroit, MI 48 ABSTRACT

More information

DATABASDESIGN FÖR INGENJÖRER - 1056F

DATABASDESIGN FÖR INGENJÖRER - 1056F DATABASDESIGN FÖR INGENJÖRER - 06F Sommr 00 En introuktionskurs i tssystem http://user.it.uu.se/~ul/t-sommr0/ lt. http://www.it.uu.se/eu/course/homepge/esign/st0/ Kjell Orsorn (Rusln Fomkin) Uppsl Dtse

More information

2 DIODE CLIPPING and CLAMPING CIRCUITS

2 DIODE CLIPPING and CLAMPING CIRCUITS 2 DIODE CLIPPING nd CLAMPING CIRCUITS 2.1 Ojectives Understnding the operting principle of diode clipping circuit Understnding the operting principle of clmping circuit Understnding the wveform chnge of

More information

Rotating DC Motors Part II

Rotating DC Motors Part II Rotting Motors rt II II.1 Motor Equivlent Circuit The next step in our consiertion of motors is to evelop n equivlent circuit which cn be use to better unerstn motor opertion. The rmtures in rel motors

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

According to Webster s, the

According to Webster s, the dt modeling Universl Dt Models nd P tterns By Len Silversn According Webster s, term universl cn be defined s generlly pplicble s well s pplying whole. There re some very common ptterns tht cn be generlly

More information

Drawing Diagrams From Labelled Graphs

Drawing Diagrams From Labelled Graphs Drwing Digrms From Lbelled Grphs Jérôme Thièvre 1 INA, 4, venue de l Europe, 94366 BRY SUR MARNE FRANCE Anne Verroust-Blondet 2 INRIA Rocquencourt, B.P. 105, 78153 LE CHESNAY Cedex FRANCE Mrie-Luce Viud

More information

Solution to Problem Set 1

Solution to Problem Set 1 CSE 5: Introduction to the Theory o Computtion, Winter A. Hevi nd J. Mo Solution to Prolem Set Jnury, Solution to Prolem Set.4 ). L = {w w egin with nd end with }. q q q q, d). L = {w w h length t let

More information

5 a LAN 6 a gateway 7 a modem

5 a LAN 6 a gateway 7 a modem STARTER With the help of this digrm, try to descrie the function of these components of typicl network system: 1 file server 2 ridge 3 router 4 ckone 5 LAN 6 gtewy 7 modem Another Novell LAN Router Internet

More information

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University SYSTEM FAULT AND Hrry G. Kwtny Deprtment of Mechnicl Engineering & Mechnics Drexel University OUTLINE SYSTEM RBD Definition RBDs nd Fult Trees System Structure Structure Functions Pths nd Cutsets Reliility

More information

Numeracy across the Curriculum in Key Stages 3 and 4. Helpful advice and suggested resources from the Leicestershire Secondary Mathematics Team

Numeracy across the Curriculum in Key Stages 3 and 4. Helpful advice and suggested resources from the Leicestershire Secondary Mathematics Team Numercy cross the Curriculum in Key Stges 3 nd 4 Helpful dvice nd suggested resources from the Leicestershire Secondry Mthemtics Tem 1 Contents pge The development of whole school policy 3 A definition

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

Lifestyles. 1 Warm-up. 2 Conversation. Talk about the pictures with a partner. Who are these people? Where are they? Listen and read.

Lifestyles. 1 Warm-up. 2 Conversation. Talk about the pictures with a partner. Who are these people? Where are they? Listen and read. 6 Lifestyles Focus Grmmr lifestyles Vocbulry common verbs djectives simple present I/you/we/they Yes/No questions 1 Wrm-up Tlk bout the pictures with prtner. Who re these people? Where re they? 2 Converstion

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

The Semantics of Graph Programs

The Semantics of Graph Programs The Semntics of Grph Progrms Detlef Plump Deprtment of Computer Science The University of York, UK Sndr Steinert Deprtment of Computer Science The University of York, UK GP (for Grph Progrms) is rule-bsed,

More information

ClearPeaks Customer Care Guide. Business as Usual (BaU) Services Peace of mind for your BI Investment

ClearPeaks Customer Care Guide. Business as Usual (BaU) Services Peace of mind for your BI Investment ClerPeks Customer Cre Guide Business s Usul (BU) Services Pece of mind for your BI Investment ClerPeks Customer Cre Business s Usul Services Tble of Contents 1. Overview...3 Benefits of Choosing ClerPeks

More information

Health insurance exchanges What to expect in 2014

Health insurance exchanges What to expect in 2014 Helth insurnce exchnges Wht to expect in 2014 33096CAEENABC 02/13 The bsics of exchnges As prt of the Affordble Cre Act (ACA or helth cre reform lw), strting in 2014 ALL Americns must hve minimum mount

More information