s2_language - Alloy Analyzer 4 Tutorial Session 2 Language...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Alloy Analyzer 4 Tutorial Session 2: Language and Analysis Greg Dennis and Rob Seater Software Design Group, MIT
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
alloy language & analysis language = syntax for structuring specifications in logic shorthands, puns, sugar analysis = tool for finding solutions to logical formulas searches for and visualizes counterexamples
Image of page 2
“I'm My Own Grandpa” Song popular radio skit originally written in the 1930's expanded into hit song by “Lonzo and Oscar” in 1948
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
module  grandpa abstract sig  Person {   father:  lone  Man,   mother:  lone  Woman } sig  Man  extends  Person {   wife:  lone  Woman } sig  Woman  extends  Person {   husband:  lone  Man } fact  {   no  p: Person |     p  in p.^(mother + father)   wife = ~husband } assert  noSelfFather {  no  m: Man | m = m.father } check  noSelfFather fun  grandpas[p: Person] :  set  Person {  p.(mother + father).father } pred  ownGrandpa[p: Person] {  p  in  grandpas[p] } run  ownGrandpa  for  4 Person “I'm My Own Grandpa” in Alloy
Image of page 4
language: module header module  grandpa first non-comment of an Alloy model
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
language: signatures sig  A {} set of atoms A sig  A {} sig  B {} disjoint sets A and B (no A & B) sig  A, B {} same as above sig  B  extends  A {} set B is a subset of A (B in A) sig  B  extends  A {} sig  C  extends  A {} B and C are disjoint subsets of A (B in A && C in A && no B & C) sig  B, C  extends  A {} same as above abstract sig  A {} sig  B  extends  A {} sig  C  extends  A {} A partitioned by disjoint subsets B and C (no B & C && A = (B + C)) sig  B  in  A {} B is a subset of A – not necessarily disjoint from any other set sig  C  in  A + B {} C is a subset of the union of A and B one sig  A {} lone sig  B {} some sig  C {} A is a singleton set B is a singleton or empty C is a non-empty set
Image of page 6
grandpa: signatures all men and women are persons no person is both a man and a woman all persons are either men or women abstract sig  Person {   . . .
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern