1 / 80

Goals : To state an homogeneous background

Revisiting traditional time modeling and analysis techniques at the light of the “timing dimensions” (and not only). Goals : To state an homogeneous background To build an “ attitude ” in the evaluation of time models. Dynamical systems. Discrete systems Continuous systems

trent
Download Presentation

Goals : To state an homogeneous background

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Revisiting traditional time modeling and analysis techniques at the light of the “timing dimensions” (and not only) Goals: To state an homogeneous background To build an “attitude” in the evaluation of time models Revisiting traditional models

  2. Dynamical systems Discrete systems Continuoussystems The state-spacerepresentation Dynamicalsystemsas a model of computation From continuous to discrete (and back) Dynamical systems and the dimensions of temporal modeling Revisiting traditional models

  3. Discrete dynamical systems:the (well-known) Fibonacci’s rabbits (1) A rabbit’s pregnancy lasts exactly one month; A birth produces exactly two siblings, a male and a female; A newborn rabbit becomes fertile when it turns one-month old and it remains fertile for its whole life; A rabbit’s life is indefinitely long (within the time scales considered). Revisiting traditional models

  4. Discrete dynamical systems:the (well-known) Fibonacci’s rabbits (2) Rcounts the number of rabbit couples newR(t): newly borncouples R(t) = R(t 1) + newR(t). (*) newR(t) = R(t 1) newR(t 1) newR(t 1) = R(t 1) R(t 2) R(t)= R(t 1) + R(t 1) newR(t 1) = R(t 1) + R(t 1)  (R(t 1) R(t 2)) = R(t 1) + R(t 2). If R(0) = 1, … If R(0) = 0, … Incidentally: Revisiting traditional models

  5. i(t) V(t) iC(t) Continuous dynamical systems:the (well-known) capacitor Q = C.V i(t) = iR(t) + iC(t); V(t) = R·iR(t) V(0) = 1, i(t) = 0 Revisiting traditional models

  6. The state-space representation of dynamical systems x = x1x2 ... xn State u = u1u2 ... Um Input y = y1y2 ... yl, Output x(t + 1) = f(x(t), u(t), t) ($) (t) = f(x(t), u(t), t) ($$), y = g(x, [u]) Invariantversions: x(t + 1) = f(x(t), u(t)) ($-ti) (t) = f(x(t), u(t)) ($$-ti) Revisiting traditional models

  7. Dynamical systems as models of computation State  memory (register, array, …) Next state: x(t+1) = f(memory, read input) Output: write … Example: cellular automata next state of a cell depends only on the state of the neighborcells Rule 110: Have the computationalpower of Turingmachines Revisiting traditional models

  8. From continuous to discrete … and back (1) Discretization for numericalcomputation (of continuousmodels): Fixedpoint vs floatingpoint … Revisiting traditional models

  9. From continuous to discrete … and back (2) Computer-based controller Continuous process Revisiting traditional models

  10. Dynamical systems and the dimensions of temporal modeling Discrete and continuous (time) domains (already discussed) Next state vs. continuousevolution Zeno (and other“pathological”) behaviors x(t) = tang(t) x(t + 1) = rx(t) · (1 – x(t)), for constant r > 0, which defines highly irregular chaotic behavior difficult to predict Sometimes boundedness and/or continuity are required as a “guarantee” of regularity, but … b(t) = exp(–1 / t2)·sin(1 / t) if t0 and b(0)=0, … Revisiting traditional models

  11. Avoiding pathological behaviors Writing a differential/differenceequation in time is no guarantee of formalizing a “good”dynamicalsystem Avoidingpathologicalbehviors“a priori”: by means of suitable (sufficient) conditions: Analiticfunctionshavegoodregularityproperties Verifyinga posteriori whether the behaviorimplied by the givenequationsis“good”or not. Revisiting traditional models

  12. A real-time exercise … Consider the following types of irregular behavior: discontinuous, continuous with discontinuous derivative, Zeno, Berkeley, unbounded. For each of the following choices of state and time domain, which types of irregular behavior may occur? Continuous and unbounded state space and time (say, R); Continuous and bounded state space and time (say, the real interval [0,1]); Dense state space and time (say, Q); Continuous time (say, R) and discrete state space (say, Z); Discrete time (say, Z) and continuous state space (say, R); Discrete state space and time (say, Z). () Can you think of real systems where such irregular behaviors can arise? Revisiting traditional models

  13. ... and a non real-time one A dynamical system has chaotic behavior when its dynamics is difficult to predict because of certain characteristics, including in particular sensitivity to initial conditions. Informally, sensitivity to initial conditions is a form of instability, where a tiny change in the initial value of the state variables may result in a conspicuous change in the evolution of the state. In terms of predictability, this means that if the initial state is known only with finite precision, the state dynamics becomes completely unpredictable after some time. The logistic map above (x(t + 1) = rx(t) · (1 – x(t))) is an example of discrete-time system with chaotic behavior. Consider now the notion of undecidability applied to the dynamics of a class of discrete-time systems C: a property of C’s dynamics (e.g., “Does the state of every system in C ever become positive?”, “Does the state reach equilibrium?”) is undecidable if its yes/no answer cannot be computed by any algorithmic procedure. Is the dynamics of dynamical systems with chaotic behavior always undecidable? Conversely, are dynamical systems whose dynamics is undecidable always chaotic? Revisiting traditional models

  14. Determinism in dynamical systems Traditionaldynamicalsystems (thosestudied in classic control theory) are deterministic Stochasticsystemstoo are deeplystudied (e.g. in information and communicationtheory) No conceptualreasonsnot to exploit evennondeterministicones in modern control and automationtheory (Petri nets …, butwhynotnondeterministiccontinuousmodels?) Revisiting traditional models

  15. Implicit vs. explicit time reference Time invariantsystem: if the system reaches the same state at two different times t1, t2 (that is: x(t1) = x(t2)) and it is subject to the same input function in the future (that is: u(d + t1) = u(d + t2) for all positive d), then the future values of the state are the same at corresponding instants of time (x(d + t1) = x(d + t2) for all positive d). Time is still explicit in x(t) but is implicit in Revisiting traditional models

  16. Concurrency and composition Revisiting traditional models

  17. Notations and tools for dynamical system analysis Inspired by numerical methods: Matlab/Simulink Modelica … Towards models and tools that integrate equation-based formalisms with automata and logic-based ones: … next part of the course Revisiting traditional models

  18. Modeling time in hardware design(From continuous to discrete) From transistors to sequential logic circuits Raising the level of abstraction: finite state machines From asynchronous to synchronous logic circuits Raising again the level of abstraction: hardware description languages Methods and tools for hardware analysis Revisiting traditional models

  19. From transistors to sequential logic circuits (1) An NMOS transistor A transistor implementing a NOT logicaloperation A NAND circuit Revisiting traditional models A NOR circuit

  20. But the table: From transistors to sequential logic circuits (2) And the icon: are more abstract … From a functionalpoint of view Whatabout timing? Revisiting traditional models

  21. From transistors to sequential logic circuits (3) Whatabout timing? Two NOT gates in series An input-output graph, where t2 – t1 = 2 Time is still continuous but trajectories are “rectified” Combinatorial circuits are memoryless (stateless) devices with a delay between input and output Revisiting traditional models

  22. From transistors to sequential logic circuits (4) • From combinatorial to sequential logic circuits • Adding memory in logic circuitry by introducing feedback A NAND latch R, Q 1 0 Revisiting traditional models

  23. From two to many states: sequential machines • 1 bit: 2 states n bits: 2n states The general structure of a sequential machine Question: it is clearly an example of dynamical system: Time is discrete or continuous? What about the state? Revisiting traditional models

  24. Sequential machines a behavior of the machine: initial output O1 = O2 = 1 the two inputs R1 = R2 hold the value 1 while S1 switches to a value 0 for ε time units. ε greater than the switching delay of the latch Revisiting traditional models

  25. Abstracting the “ramps”: 0-time transitions The state Q of an latch set to 1 with zero-time transitions.( is the switching delay of the latch). But … what’s the state during the transition? Problems may arise … Revisiting traditional models

  26. Abstracting the logic circuitry: Finite state machines (FSM) (Well known) Graphical representation of the finite-state machine for an latch The state space is now obviously discrete; what about time? Revisiting traditional models

  27. FSMs with output: Moore and Mealy machines A Mealy machine modeling an latch with output ε (empty string) = no output Mealy: : Q I O Moore: : QO Revisiting traditional models

  28. From asynchronous to synchronous logic circuits:the clock The clock as a square wave (dotted line) or as a sequence of impulses (solid line). Revisiting traditional models

  29. The latch synchronized with the clock A synchronized reset transition of the flip-flop Now time too is discrete Revisiting traditional models

  30. The “same” FSM with discrete time: A FSM for a SR flip-flop with “no change” events: The model now has a metric on time: one transition = one time unit = one clock period Revisiting traditional models

  31. From few to manystates:Modular abstractions in hardware design The clock –and therefore the time- isagainimplicit: onetransition = one time unit However: as the abstractionlevelincreases … the clock tends to “disappear” … Towards the SW “purely functional” view. Revisiting traditional models

  32. Methods and tools for hardware analysis Testing Simulation Formal verification Synthesis SPICE VHDL … Revisiting traditional models

  33. Time in the analysis of algorithms Introductoryconcepts Computational complexity and automata models A brief but necessary digression on computability Back to (deterministic) automata-theoretic complexity The RAM (random access memory) machine and its complexity The complexity relations between different computational models The complexity of nondeterministiccomputations Complexityhierarchies Probabilisticcomputations and theircomplexity (hints) Revisiting traditional models

  34. The traditional way of modeling software The functionalabstraction: An algorithmcomputes a function f: I ---> O The computationprocessiscompletelyabstractedaway But the algorithmisexecuted by an (abstract or physical) machine (operational model) The abstract machine usesresources –memory and time- Complexityas a measure of costto achieve the desiredresult: typicallyseparated by functionalanalysis (unliketypicalanalysis of dynamicalsystems) Complexityanalysisbased on some (abstract) operational model: Given the abstractionintroduced by hardware: Discrete state and time domain Normallydeterministic. Revisiting traditional models

  35. Measures of computational complexity (Most general remarksapply to bothspace and time complexity, butwe are interested in the latterone) Given a computational model: one –abstract- clock tick (execution of an elementaryoperation) =one time unit Complexity = number of time unitselapsing from the beginning to the end of a computation Complexitydepends on input data x: f(x) A first basicabstraction: makeit a function of the size of input data: n = |x| But in general  ( |x1| = |x2|  f(x1) = f(x2) Worst case and average case analysis: For abstract machine A, worst case: Average case: Revisiting traditional models

  36. (The very simple) Complexity of FSMs Finite memory (doesnotdepend on input) For every input symbolonemove = one time unit: TA(n) = n (in suchcaseswesay the machine is a real-time machine) Revisiting traditional models

  37. Brief digression on computational power FSMs are ratherlimited in problemsolving E.g. problem = languagerecognition: L  I*; x  L ? FSMscannotrecognize {anbn | n > 0} (have a finite memory!) Ifwewant to formalize and analyzeanygenericcomputation (algorithm) weneedmuch more computationalpower Revisiting traditional models

  38. The famous and fundamental Turing machine (TM) The model can formalizelanguagerecognition (without output tape) aswellaslanguagetranslation ( functioncomputation): Anyformalization of the genericnotion of problem Revisiting traditional models

  39. A little example of TM A 1-tapeTuring machine Msucc that computes the successor of a binary number The notation is imported and extended from that of FSMs (not by chance) Revisiting traditional models

  40. The fundamental Church-Turingthesis: • “every implementable computational process can be computed by a Turing machine” • There are problems (languages, functions, …) that cannot be solved by any TM • Therefore they are not “algorithmically solvable” • The most classical and fundamental case: • The (computation) termination problem(the time complexity of a TM computation can be ) The computational power of TMs Revisiting traditional models

  41. Evenif a problem can be solved for any input datum(TM(x)   x), TM(x) (TM(n) ) can be a highlyvariable (and high) function:whataboutTM(n) = 2222n! ? • The linear speed-up theorem: • Given any Turing machine M solving a problem with time complexity TM(n) and any rational number c > 0, it is possible to build another Turing machine M’ that, after reading the whole input string, solves the same problem as M with time complexity c·TM(n), i.e., TM’(n) = max (n, c·TM(n)). • The theorem is general and does not really depend on the chosen model: it deals with the issue of spending more resources to solve problems. Let’s go back to complexity issues in the context of the general (?) and powerful TM Revisiting traditional models

  42. The linear speed-up theorem suggests to focus complexity analysis –at least at first approximation- on the order of magnitude of (complexity) function: • f is O(g) (“big oh of g”) if there exist positive constants c, k (k integer) such that:f(n) ≤ c·g(n) for all n > k; • f is Ω(g) (“big omega of g”) if there exist positive constants c, k (k integer) such that: f(n) ≥ c·g(n) for all n > k; • f is Θ(g) (“big theta of g”) if f is O(g) and Ω(g). • By changing algorithm to solve a problem we may change the order of magnitude of the complexity of problem solution; by changing machine (instance) we can only change complexity linearly, i.e., without affecting its order of magnitude: • A (n.log(n)) sorting algorithm will run on a modest PC faster than a (n2) running on a very expensive supercomputer (for high values of n). Revisiting traditional models

  43. Complexityclasses Itisquitenatural to classifyproblemsaccording to the complexity of theirsolution: The more effort I apply to solve problems, the more problems I will be able to solve TIME(f(n)): the class of problemsthat can be solved (with the “best algorithm” with time complexity O(f(n)) f O(g)  TIME(f(n))  TIME(g(n)) Also, normally, (f) >  (g)  TIME(f(n)) TIME(g(n)) E.g. sorting (through comparisons)  TIME(n) Complexity lower-bounds Revisiting traditional models

  44. However … The definition of computationalcomplexityisbound to the computationalmodel: Whatifwechange model? Church thesisguaranteesthatif a problem can be solved by any“machine”, it can be solved by a TM Does the samehold for complexityevaluation? Intuitively the set of “elementaryoperations” of a real computer is quite different from TM transitions Maybe every hw operation can be simulated by a bounded sequence of TM operations? (linear speed up)? Revisiting traditional models

  45. …as a matter of fact … Evenwithoutcomparing (the complexity of) TMs with that of realcomputers (to be donenext) Just moving from the k-tape TM to the (original) single tape one (not 1-tape!): … the “mirror” or palindrome language L = {wwR|w  I*}cannot be recognized by any single-tape TM in lessthan (n2) Control unit Revisiting traditional models

  46. It’s time to consider a more realistic (?) computational model: the RAM, clearlyinspired to the von Neumannarchitecture. Everycellcontains a characteror an integer Revisiting traditional models

  47. The RAM instructionrepertoir(1) Revisiting traditional models

  48. The RAM instructionrepertoir(2) Revisiting traditional models

  49. Then, complexityanalysisproceedsasusual: • Oneelementaryoperation = one time unit • Apparentlystrikingdifferences w.r.t. TM-basedanalysis: • ADD x in O(1) time vs. O(log(|x|) • Binarysearch in O(log(n)) time vs. O(n) –or O(n.log(n))- time if …?... For TM • … • BUT …. Revisiting traditional models

  50. x = 2 • for x = 1 to n • x = x*x • Computes 22nin O(n) • Isthisrealistic? • Itneeds 2n bits only to store the result Revisiting traditional models

More Related