
1. PARTIALLY ORDERED SETS - SOLUTIONS 2. For two posets A and B: (a) Show that if f : A ! B is an order embedding, then f is one-to-one. Solution: We need to show that a 6= a0 ) f (a) 6= f (a0): Equivalently, we can show that f (a) = f (a0) ) a = a0: Note that f (a) = f (a0) ) f (a) ≤ f (a0) and f (a) = f (a0) ) f (a0) ≤ f (a): Since f is an order embedding, this implies that a ≤ a0 and a0 ≤ a, which together imply that a = a0. (b) Show that if f : A ! B is an order isomorphism, then there is an order isomorphism g: B ! A. Solution: Using the result from part (a), f is one-to-one and onto, so f −1 is a well-defined function and is also one-to-one and onto. Let g = f −1. We can show that g is an order embed- ding, and hence an order isomorphism. To show that, note that since f is an order embedding, f (a) ≤ f (a0) () a ≤ a0; which, letting b = f (a) and b0 = f (a0), implies that b ≤ b0 () g(b) ≤ g(b0): Thus, g is an order embedding. E. A. Lee, Concurrent Models of Computation 3 1. PARTIALLY ORDERED SETS - SOLUTIONS 3. Let w = f0/;f0/g;f0/;f0/gg;···g be the von Neumann numbers as defined on page ??. This problem explores the relationship between this set and N. (a) Let f : w ! N be defined by f (x) = jxj; 8 x 2 w : That is, f (x) is the size of the set x. Show that f is a bijection. Solution: f is onto because the set w contains at least one set with any size n 2 N. f is one-to-one because w contains no more than one set with any size n 2 N. Since f is onto and one-to-one, it is a bijection. (b) Let (w;⊆) and (N;≤) be posets, where ⊆ is the usual subset order and ≤ is the usual numeric order. Show that these posets are order isomorphic. Solution: The function f of part (a) is an order isomorphism because it is onto (shown in part (a)) and an order embedding. To show it is an order embedding, just note that for any x;x0 2 w, if x ⊆ x0, then f (x) ≤ f (x0) (obviously, because f is just set size). Moreover, since f is a bijection, it has an inverse, and we can similarly show that the inverse is onto and an order embedding. (c) The lifted version of the function f in part (a) is written fˆ. What is the value of fˆ(f0/;f0/gg)? What is the value of f (f0/;f0/gg)? Note that on page ?? it is noted that when there is no ambigu- ity, fˆ may be written simply f . For this function, is there such ambiguity? Solution: fˆ(f0/;f0/gg) = f0;1g. f (f0/;f0/gg) = 2. Hence, in this case, there is definitely ambiguity, and the shorthand notation should not be used. 4 E. A. Lee, Concurrent Models of Computation 1. PARTIALLY ORDERED SETS - SOLUTIONS 4. Classify each of the following as a partial order relation, a total order relation, or neither. State whether it is a CPO. (a) The set of words A∗ over a non-empty alphabet A with a relation v defined by x v y () 9 z 2 A∗ : x:z = y; where x:z denotes concatenation. Solution: This is an order relation. It has a least element, l. It is not a CPO. The chain fa, aa, aaa, aaaa, ··· g, for some a 2 A, has no upper bound in the set. (b) The set A = fseconds, grams, meters, pounds, yardsg of units and a relation R defined by (a;a0) 2 A if a can be converted to a0 by scaling by a unitless constant. Solution: This is neither because it does not satisfy the antisymmetric property. It is not a CPO because it is not an order relation. (c) The set D of all countable (including finite) subsets of R, ordered by the subset order. Hint: It may be easier to use Definition ?? for a CPO, rather than Definition ??. Solution: This is not a CPO. The following proof is due to Eleftherios Matsikoudis: The set D of all countable subsets of reals is a directed set. It is non-empty, and for every two countable subsets of reals, there is an upper bound in D of the two subsets, namely their union. But D does not have an upper bound in D. The sets in D can contain any real number, so the only upper bound of D with respect to subset inclusion is the set of all reals, which is uncountable and therefore not in D. Thus, D is not a CPO with respect to subset inclusion. The following proof, due to Ben Lickly, uses Definition ??. Any such proof appears to require the axiom of choice or some equivalent statement. One statement equivalent to the axiom of choice is Zorn’s lemma, which states that a poset (A;≤) for which every chain has an upper bound has a maximal element. A maximal element is an a 2 A where there is no a0 2 A such that a < a0. Lickly’s proof assumes that D is a CPO and then reaches a contradiction. If D is a CPO, then by Definition ??, every chain has an upper bound, so Zorn’s lemma applies. But D does not have a maximal element. Given any countable subset of the reals, one can always add one more real number to the set and the resulting set is still countable. So D has no maximal element, and hence D must not be a CPO. (d) The set f1=n j n 2 Ng [ f0g, ordered by the natural numeric order (where 1=0 is interpreted as ¥). Solution: This is a total order and a CPO. It clearly has a bottom element, and every chain has a LUB in the set. (e) The set f1=n j n 2 Ng, ordered by the reverse numeric order (where again 1=0 is interpreted as ¥). E. A. Lee, Concurrent Models of Computation 5 1. PARTIALLY ORDERED SETS - SOLUTIONS Solution: This is a total order, but not a CPO because the set itself has no least upper bound in the set. 6 E. A. Lee, Concurrent Models of Computation 5 Synchronous-Reactive Models Solutions 1. This exercise studies the use of absent events in SR. (a) As a warmup, use Sequence and When to construct an SR model that generates a sequence of values true interspersed with absent. For example, produce the sequence (true; absent; absent; true; absent; true; true; true; absent) : Make sure your model adequately displays the output. In particular, absent should be visible in the display.1 Solution: The following model will do the job: where the InstanceOfTickDisplay is the composite actor shown below, created to format the output: 1Note that you could use TrueGate to implement this more simply, but part of the goal of this exercise is to fully understand When. 17 5. SYNCHRONOUS-REACTIVE MODELS - SOLUTIONS The output is: Tick 0 : true Tick 1 : Tick 2 : Tick 3 : true Tick 4 : Tick 5 : true Tick 6 : true Tick 7 : true Tick 8 : (b) Use Default, When, and Const to create a composite actor IsAbsent that given any input se- quence, produces an output true at every tick when the input is absent, and otherwise produces the output absent.2 Solution: The following model will do the job: (c) Create a composite actor that can recognize the difference between single and double mouse clicks. Your actor should have an input port named click, and two output ports, singleClick and doubleClick. When a true input at click is followed by N absents, your actor should produce output true on singleClick, where N is a parameter of your actor. If instead a second true input occurs within N ticks of the first, then your actor should output a true on doubleClick. How does your model behave if given three values true within N ticks on input port click? Solution: The following model will do the job: 2Again, a simpler implementation is available using IsPresent, but the goal of this exercise is to fully under Default. 18 Ptolemaeus, System Design, Modeling, and Simulation: Solutions 5. SYNCHRONOUS-REACTIVE MODELS - SOLUTIONS (d) Extra credit: Redo (a)-(c) by writing a custom a Java actor for each of the three functions above. How does this design compare with the design implemented using primitive SR actors? Is it more or less understandable? Complex? http://Ptolemy.org/systems 19 2 Synchronous Systems Solutions 1. Suppose A = f?g [ N is a flat CPO with ? at the bottom and each element of N immediately above ?. Each element of N is incomparable with all other elements of N. Consider a function f : A2 ! A given by, for all a1;a2 2 A, 8 a a < ? if 1 = 2 = ? f (a1;a2) = a1 if a1 2 N : a2 + 1 otherwise (a) Is this function strict? Solution: The function is not strict. Even without knowing anything about the second argu- ment, if it knows the first, it may be able to assert the output. (b) Suppose this function is used in the following SR model: where d = 1 is produced on every tick by the left actor. Find all possible outputs of f . Is there a least fixed point? Solution: The output of f can be any n 2 N.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages11 Page
-
File Size-