Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Alloy Analyzer2011   9   23
•          (id:mr_konn / @mr_konn)                •                    •                • Haskell Lover                • 2...
•   Alloy                •                •   Alloy Analyzer                    http://alloy.mit.edu/alloy4/2011   9   23
Alloy Analyzer                •                    •        →   /                    •                    •“   ”2011   9  ...
•       ……                •                    •                    •2011   9   23
“             ”                •   Alloy           SAT                    •                        •                     (...
2011   9   23
•                    •   ,                •2011   9   23
•                    •                    •                •                •2011   9   23
Alloy                    enum        {   ,       }                    enum            {           ,         }             ...
Alloy                                      (2)                     one sig     extends            {} {                    ...
•                •2011   9   23
•                •                    •   Yes/No2011   9   23
Alloy                                 (1)           module marsandvenus                    abstract sig             {     ...
Alloy                        (2)                •                                   ……                         one sig    ...
pred              (        :   ) {                    all       :        |                          .       in       <=> (...
•                •2011   9   23
○   No                          ○   Yes                          ×   No                          ×   Yes                • ...
2011   9   23
•                    •   ……                    •                    •                •            or2011   9   23
module tour/filesystem                abstract sig Object {}                sig Directory extends Object {                ...
……                •                    1.   (File)                    2.                    3.2011   9   23
fact FileBelongsSomewhere {                  all f : File | one d : Directory |                    f in d.contents        ...
•                                   Directory                • FileBelongsSomewhere                fact ObjBelongsSomewher...
……                •                • RootHasNoSuperDir                  ObjBelongsSomewhere                • all o : Objec...
•                •                •   ……2011   9   23
Alloy                •   Alloy                •   Object = Directory ⊔ File, Alias ⊆ File                    •            ...
•   A+B:A        B                •   A&B:A        B                •   A-B:A        B                •   A in B : A   B  ...
•   P→Q:              P, Q                •   A.B :                    •   A         B                    •       {(1)} . ...
•   A[B] : B. A                    •               a.b [c] = c.(a.b)                    •                •   ~a :       a ...
•   none :                    •                •   univ :                    •                •   iden :                  ...
•   all x : e | F =    e               x       F                •   some x : e | F =       x       F                •   no...
…                •   /                •2011   9   23
fact NoRecursiveDirs {                ! no d : Directory | d in d.^contents                }                fact NoRecursi...
•2011   9   23
run                               pred show {}                               run show                • run hoge :      hog...
pred show {} for 4                                run show                •   for n          n                    •       ...
•       Object   Root                    •                   …                •2011   9   23
assert                assert TrackableFromRoot {                  all o : Object | o in Root.^contents                }   ...
•           ……                • Root Root                • Object - Root                          Root.*contents2011   9  ...
assert TrackableFromRoot {                  all o : Object | o in Root.*contents                }                check Tra...
Alloy                •                    fact NoRecursiveDirsOrAlias {                    ! no iden & (^contents + ^to)  ...
• Alloy                •                  •                  • Alloy                •2011   9   23
Any Questions?2011   9   23
2011   9   23
Upcoming SlideShare
Loading in …5
×

Alloy Analyzer のこと

6,895 views

Published on

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

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

Published in: Technology

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

×