Alloy Analyzer のこと

5,971 views
5,760 views

Published on

Alloy Analyzer について社内セミナーで発表した資料です。

実際の模様→ http://www.ustream.tv/recorded/17430540

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,971
On SlideShare
0
From Embeds
0
Number of Embeds
1,419
Actions
Shares
0
Downloads
19
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Alloy Analyzer のこと

  1. 1. Alloy Analyzer2011 9 23
  2. 2. • (id:mr_konn / @mr_konn) • • • Haskell Lover • 2010 Summer Intern PFI2011 9 23
  3. 3. • Alloy • • Alloy Analyzer http://alloy.mit.edu/alloy4/2011 9 23
  4. 4. Alloy Analyzer • • → / • •“ ”2011 9 23
  5. 5. • …… • • •2011 9 23
  6. 6. “ ” • Alloy SAT • • (10 ) • • •2011 9 23
  7. 7. 2011 9 23
  8. 8. • • , •2011 9 23
  9. 9. • • • • •2011 9 23
  10. 10. Alloy enum { , } enum { , } abstract sig { : one } abstract sig { : lone , : } { some => ( = <=> . = ) } • •2011 9 23
  11. 11. Alloy (2) one sig extends {} { in } one sig extends {} { no } one sig extends {} { = <=> ( . = => . = ) } pred show {} run show • • run : pred2011 9 23
  12. 12. • •2011 9 23
  13. 13. • • • Yes/No2011 9 23
  14. 14. Alloy (1) module marsandvenus abstract sig { : , enum { , } : , enum { , } : -> one enum { , } } { all q : | sig { (( = and = ) ! : -> one or ( = and = )) } <=> [q] = q. [this] } • • /2011 9 23
  15. 15. Alloy (2) • …… one sig extends {} { in and in } • • ……2011 9 23
  16. 16. pred ( : ) { all : | . in <=> ( . [ ] = ) } fact { one } run • Yes • run2011 9 23
  17. 17. • •2011 9 23
  18. 18. ○ No ○ Yes × No × Yes • YES2011 9 23
  19. 19. 2011 9 23
  20. 20. • • …… • • • or2011 9 23
  21. 21. module tour/filesystem abstract sig Object {} sig Directory extends Object { contents: set Object } one sig Root extends Directory {} sig File extends Object {} sig Alias extends File {to: Object} pred show {} run show2011 9 23
  22. 22. …… • 1. (File) 2. 3.2011 9 23
  23. 23. fact FileBelongsSomewhere { all f : File | one d : Directory | f in d.contents } fact NoRecursiveDirs { ! no d : Directory | d in d.contents } fact RootHasNoSuperDir { no d: Directory | Root in d.contents } • fact : • • ( )2011 9 23
  24. 24. • Directory • FileBelongsSomewhere fact ObjBelongsSomewhere { all o : Object | one d : Directory | o in d.contents }2011 9 23
  25. 25. …… • • RootHasNoSuperDir ObjBelongsSomewhere • all o : Object all o : Object - Root2011 9 23
  26. 26. • • • ……2011 9 23
  27. 27. Alloy • Alloy • Object = Directory ⊔ File, Alias ⊆ File • • ( ) • Root one • contents : Directory Object • n n • 12011 9 23
  28. 28. • A+B:A B • A&B:A B • A-B:A B • A in B : A B (A ⊆ B) • (A∈B) • A = B :A B2011 9 23
  29. 29. • P→Q: P, Q • A.B : • A B • {(1)} . {1→A, 1→B, 3→B} = {(A), (B)} {1→A, 1→B, 3→B} . {(B)} = {(1), (3)} •2011 9 23
  30. 30. • A[B] : B. A • a.b [c] = c.(a.b) • • ~a : a • ^a, *a : • ^{1→2, 2→3} = {1→2, 2→3, 1→3} • *{1→2, 2→3} = {1→2, 2→3, 1→3, 1→1, 2→2, 3→3}2011 9 23
  31. 31. • none : • • univ : • • iden : • a.iden = a , iden.a = a (forall a)2011 9 23
  32. 32. • all x : e | F = e x F • some x : e | F = x F • no x : e | F = x F • lone x : e | F = x F • one x : e | F = x F •2011 9 23
  33. 33. … • / •2011 9 23
  34. 34. fact NoRecursiveDirs { ! no d : Directory | d in d.^contents } fact NoRecursiveAliases { ! no a : Alias | a in a.^to } • •2011 9 23
  35. 35. •2011 9 23
  36. 36. run pred show {} run show • run hoge : hoge • show • ( )2011 9 23
  37. 37. pred show {} for 4 run show • for n n • n=3 • • for 4 but 2 Alias, exactly 1 Directory • 4 2 Alias, 1 Dir •2011 9 23
  38. 38. • Object Root • … •2011 9 23
  39. 39. assert assert TrackableFromRoot { all o : Object | o in Root.^contents } check TrackableFromRoot • ( ) • check hoge hoge • run (default: 3)2011 9 23
  40. 40. • …… • Root Root • Object - Root Root.*contents2011 9 23
  41. 41. assert TrackableFromRoot { all o : Object | o in Root.*contents } check TrackableFromRoot • •2011 9 23
  42. 42. Alloy • fact NoRecursiveDirsOrAlias { ! no iden & (^contents + ^to) } fact RootHasNoSuperDir {no contents.Root} fact AllObjBelongSomewhere { all o : Object - Root | some contents.o } assert TrackableFromRoot { Object in Root.*contents }2011 9 23
  43. 43. • Alloy • • • Alloy •2011 9 23
  44. 44. Any Questions?2011 9 23
  45. 45. 2011 9 23

×