1 / 13

Formal Specification with Alloy - Introduction and Tutorial

Learn about formal specification, why it is important, and how to use the Alloy modeling language for precise and automated analysis. Follow a step-by-step tutorial to understand the basics of Alloy specification and checking assertions with the Alloy Analyzer.

fairbanks
Download Presentation

Formal Specification with Alloy - Introduction and Tutorial

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. Formal Specification with Alloy http://flic.kr/p/8W2C1k

  2. What are you goingto learn about today? • Formal specification • What? • Why? • Alloy modeling language http://flic.kr/p/8JpkTg

  3. What is formal specification? • Mathematical description (or model) • Extremely precise Z notation

  4. Why formal specification? • Overcomes problems with natural language • NL imprecise • NL ambiguous (has multiple interpretations) • Formal models amenable to • Automated analysis • Proofs

  5. Recall: Iterative development process Formal specification can be used during a variety of tasksHowever, it’s probably most often used in… http://en.wikipedia.org/wiki/File:Iterative_development_model_V2.jpg

  6. Alloy specification language • Model entities and relationships using sets/relations • Model constraints/assertions using first-order logic • Alloy analyzer • Input: Properties of the model • Output: Confirmation or counterexample

  7. Activity: Stepping throughan Alloy tutorial • Tell me what each segment of Alloy spec means • I will draw names at random http://flic.kr/p/5dfuqL

  8. Step 1 sig FSObject { parent: lone Dir } sig Dir extends FSObject { contents: set FSObject } sig File extends FSObject { }

  9. Step 2 sig FSObject { parent: lone Dir } sig Dir extends FSObject { contents: set FSObject } sig File extends FSObject { } fact { all d: Dir, o: d.contents | o.parent = d } fact { File + Dir = FSObject }

  10. Step 3 sig FSObject { parent: lone Dir } sig Dir extends FSObject { contents: set FSObject } sig File extends FSObject { } fact { all d: Dir, o: d.contents | o.parent = d } fact { File + Dir = FSObject } one sig Root extends Dir { } { no parent } fact { FSObject in Root.*contents }

  11. Step 4 sig FSObject { parent: lone Dir } sig Dir extends FSObject { contents: set FSObject } sig File extends FSObject { } fact { all d: Dir, o: d.contents | o.parent = d } fact { File + Dir = FSObject } one sig Root extends Dir { } { no parent } fact { FSObject in Root.*contents } assert acyclic { no d: Dir | d in d.^contents } check acyclic for 5

  12. Step 5 sig FSObject { parent: lone Dir } sig Dir extends FSObject { contents: set FSObject } sig File extends FSObject { } fact { all d: Dir, o: d.contents | o.parent = d } fact { File + Dir = FSObject } one sig Root extends Dir { } { no parent } fact { FSObject in Root.*contents } assert acyclic { no d: Dir | d in d.^contents } check acyclic for 5 assert oneRoot { one d: Dir | no d.parent } check oneRoot for 5 assert oneLocation { all o: FSObject | lone d: Dir | o in d.contents } check oneLocation for 5

  13. Summary • Formal specification with Alloy • Specifying signatures and facts • Checking assertions with the Alloy Analyzer http://flic.kr/p/YSY3X

More Related