1 / 20

Chapter 28 Formal Methods

Chapter 28 Formal Methods. Formal Methods. The purpose of formal methods are to assist with project specification. These are not widely used in the industry. Definition. A method is formal if it has a sound mathematical basis , typically given by a formal specification of language.

ila-love
Download Presentation

Chapter 28 Formal Methods

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. Chapter 28Formal Methods Developed by Robert Olson

  2. Formal Methods The purpose of formal methods are to assist with project specification. These are not widely used in the industry. Developed by Robert Olson

  3. Definition A method is formal if it has a sound mathematical basis, typically given by a formal specification of language. Developed by Robert Olson

  4. Desired Properties • Consistency • Completeness • Lack of amiguity Developed by Robert Olson

  5. Problems of Informal Methods • Contradictions • Ambiguities • Vagueness • Incompleteness • Mixed levels of abstraction Developed by Robert Olson

  6. Formal Method Concepts • Symbol Table • Block Handler Developed by Robert Olson

  7. Symbol Table • Data invariant • State • Operation Developed by Robert Olson

  8. Block Handler • All sets of blocks held in the queue will be subsets of the collection of currently used blocks • No elements of the queue will contain the same block numbers • The collection of used and unused blocks will be the total collection of blocks that make up files • The collection of unused blocks will have no duplicate block numbers • The collection of used blocks will have no duplicate block numbers Developed by Robert Olson

  9. Set Operators • # operator returns cardinality: #(a, b, c) = 3 • ε operator signals membership: x ε X • c operator signals set membership: A c B • ∩ operator signals intersection: A ∩ B • U operator signals union: A U B • X operator signals Cartesian Product: A x B • P operator signals power set: P{1,2,3} Developed by Robert Olson

  10. Logic Operators • ^ = and • V = or • ~, `, ‘, ⌐ = not • => = implies Hardware failure Developed by Robert Olson

  11. Sequences A sequence is a mathematical structure that models the fact that its elements are ordered. Sequences differ from sets since duplication is allowed. Developed by Robert Olson

  12. Huh? Block Handler Example • Define set A as all the blocks in the system • #A = number of blocks in the system • Define set B as all the unused blocks in the system and set C as all the used blocks • A = {B, C} • #B < #A • B c A Developed by Robert Olson

  13. OCL: Object Constraint Language • x,y Obtain property y of object x • c->f() Apply built in function f to collection c itself. • and/or/=/</> Standard meanings • p implies q If p then q. Always true if q is true or p is false Developed by Robert Olson

  14. Sample OCL Operations C = {1, 2, 3, 4, 5} C1 = {1, 3, 5} C2 = {0, 6, 7} • c -> size() = 5 • c -> isEmpty() = false • c -> includesAll(C1) = true • c -> excludesAll(C2) = true Developed by Robert Olson

  15. Sample OCL Operations cont. • C1 -> intersection(C2) = θ • C1 -> union(C2) = {0,1,3,5,6,7} • C -> first() = 1 • C -> last() = 5 • C -> find(x:x ε C and x<4)= {1, 2, 3} Developed by Robert Olson

  16. Z Specification Language • S : P X S is declared as a set of Xs • x εS x is a member of S. • S c T S is a subset of T • S U T The union of S and T • P ^ Q P and Q • P => Q P implies Q Developed by Robert Olson

  17. Z Specification Language • F:X >+> Y f is declared as a partial injection from X to Y • dom F The domain of f • ran F The range of f • {x} ∆ F A function like f, except that x is removed from its domain Developed by Robert Olson

  18. Problems with Formal Methods • Complicated & Confusing • Special Training • Expensive • Difficult to understand for those who aren’t trained Developed by Robert Olson

  19. Ten Commandments • Thou shalt choose the appropriate notation. • Thou shalt formalize, but not overformalize. • Thou shalt estimate costs. • Thou shalt have a formal methods guru on call. • Thou shalt not abandon thy traditional developmental methods. Developed by Robert Olson

  20. Ten Commandments cont. • Thou shalt document sufficiently. • Thou shalt not compromise thy quality standards. • Thou shalt not be dogmatic. • Thou shalt test, test, and test again. • Thou shalt reuse. Developed by Robert Olson

More Related