Preview

Analyzing Alloy Constraints Using an Smt Solver: a Case Study

Good Essays
Open Document
Open Document
7422 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Analyzing Alloy Constraints Using an Smt Solver: a Case Study
Analyzing Alloy Constraints using an SMT Solver: A Case Study
Aboubakr Achraf El Ghazi
Karlsruhe Institute of Technology Karlsruhe, Germany

Mana Taghdiri
Karlsruhe Institute of Technology Karlsruhe, Germany

elghazi@kit.edu ABSTRACT
This paper describes how Yices, a SAT Modulo theories solver, can be used to analyze the address-book problem expressed in Alloy, a first-order relational logic with transitive closure. Current analysis of Alloy models – as performed by the Alloy Analyzer – is based on SAT solving and thus, is done only with respect to finitized types. Our analysis generalizes this approach by taking advantage of the background theories available in Yices, and avoiding type finitization when possible. Consequently, it is potentially capable of proving that an assertion is a tautology – a capability completely missing from the Alloy Analyzer. This paper also reports on our experimental results that compare the performance of our analysis to that of the Alloy Analyzer for various versions of the address book problem.

mana.taghdiri@kit.edu
SAT via bit blasting, they can be analyzed with respect to only a few bits. Consequently, Alloy offers limited support for arrays and numerical constraints. This motivated our project: to analyze Alloy models using an SMT solver rather than a SAT solver. SMT solvers are particularly attractive because they can efficiently prove a rich combination of decidable background theories without sacrificing completeness or full automation. Furthermore, their capability to generate satisfying instances as well as unsatisfiable cores[23] (offered only by some SMT solvers) supports Alloy’s lightweight and easy-to-use approach. This paper describes the first step of our project. It reports on a case study where an SMT solver, namely Yices[7], is used to analyze an Alloy model, namely the address book problem[16]. To our knowledge, this is the first attempt to analyze a rich relational logic using an SMT solver. We have checked



References: [1] The HOL Light theorem prover. http://www.cl.cam.ac.uk/ jrh13/hol-light/. [2] Isabelle. http://www.cl.cam.ac.uk/research/hvg/Isabelle/. [3] KeY project: Integrated deductive software design. http://www.key-project.org/. [4] Mondex case study with alloy. http://www.eleves.ens.fr/home/ramanana/work/mondex. [5] PVS specification and verification system. http://pvs.csl.sri.com/. [6] The satisfiability modulo theories library (smt-lib). http://goedel.cs.uiowa.edu/smtib. [7] Yices: An SMT solver. http://yices.csl.sri.com/. [8] A. Armando, J. Mantovani, and L. Platania. Bounded model checking of software using SMT solvers instead of SAT solvers. STTT, 11(1):69–83, 2009. [9] D. Barsotti, L. Nieto, and A. Tiu. Verification of clock synchronization algorithms experiment on combination of deductive tools. ENTCS, 145:63–78, 2006. [10] M. Botincan, M. Parkinson, and W. Schulte. Separation logic verification of c programs with an SMT solver. ENTCS, 254:5–23, 2009. [11] G. Dennis, F. Chang, and D. Jackson. Modular verification of code with SAT. In ISSTA, pages 109–120, 2006. [12] B. Dutertre and L. de Moura. The yices SMT solver. Available at yices.csl.sri.com/tool-paper.pdf, 2006. [13] L. Erk¨k and J. Matthews. Using yices as an o automated solver in Isabelle/HOL. In AFM, 2008. [14] S. Ghilardi and S. Ranise. Model checking modulo theory at work: the intergration of yices in MCMT. In AFM, 2009. [15] D. Jackson. Software Abstractions: Logic, Language, and Analysis. The MIT Press, 2006. [16] D. Jackson. Software Abstractions: Logic, Language, and Analysis. Pages 5-23, The MIT Press, 2006. [17] E. Kang and D. Jackson. Formal modeling and analysis of a flash filesystem in alloy. In ABZ, 2008. [18] S. Khurshid. Generating Structurally Complex Tests from Declarative Constraints. PhD thesis, MIT, 2003. [19] R. Leino and R. Monahan. Reasoning about comprehensions with first-order SMT solvers. In SAC, pages 615–622, 2009. [20] S. Narain, G. Levin, V. Kaul, and S. Malik. Declarative infrastructure configuration synthesis and debugging. In JNSM, 2008. [21] M. Taghdiri and D. Jackson. Inferring specifications to detect errors in code. JASE, 14(1):87–121, 2007. [22] M. Vaziri. Finding Bugs in Software with a Constraint Solver. PhD thesis, MIT, 2004. [23] L. Zhang and S. Malik. Validating SAT solvers using an independent resolution-based checker. In DATE, pages 10880–10886, 2003. 6. CONCLUSIONS We have described a case study in which the Alloy address book problem is analyzed using the Yices SMT solver. This case study is the first step of a bigger project in which the Alloy language will be translated to the Yices input language automatically, and thus, analyzed using an SMT solver rather than a SAT solver. The main advantage of this approach is to avoid finitization of types when possible, and thus to provide a stronger analysis than the one offered by the current Alloy Analyzer. Since the Alloy Analyzer translates all language constructs to propositional logic and uses a SAT solver, it performs the analysis only with respect to a finite scope. It can never prove that an assertion is a tautology, even for the simplest models. Unlike SAT solvers, SMT solvers support a number of theories and can prove or refute the constraints within those theories without sacrificing completeness. Our case study was a witness to feasibility of this project. Out of a total of 9 assertions that were checked in 3 models, 5 were proven to be tautologies. That is, all Alloy constraints could be translated to the Yices without having to finitize any type. In the other 4, finitization was required, but only for a subset of the types; the others were left infinite. The Alloy logic is undecidable. Therefore, finitization is inevitable. Our case study, however, showed that the finitization can be done on-demand; only for those types to which certain language constructs are applied (e.g. universal quantifiers and transitive closure). During this case study, we realized that many of the Alloy constructs can be translated to Yices in more than one way. So far, we have picked the ones that work reasonably well for the address book problem. More experiments are needed until we can fix a particular translation rule for each Alloy construct. In fact, our current experiments show that our translation of transitive closure is too difficult to analyze when it is applied to different relations and then checked for equality. We are currently investigating other translation techniques to mitigate this problem. Although, in our experiments, any time that Alloy did not find a counterexample, Yices did not either, this is not always the case. Some Alloy models for which the analyzer cannot find a counterexample, actually have counterexamples, but in higher scopes than the one that the analyzer can check. Investigating whether Yices can analyze such models in a high-enough scope to find the counterexample, will be

You May Also Find These Documents Helpful

  • Satisfactory Essays

    cis3730_Exam1_Studyguide

    • 512 Words
    • 2 Pages

    Relationships: is a collection of data organized based on a model derived from 1st order predicate logic…

    • 512 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    List the relational operators and logical operators that can be used to form a validation rule.…

    • 636 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    The journals kept by Meriwether Lewis and William Clark during their expedition were an extremely important part of the United States of America’s history specifically in the scientific field. Lewis and Clark explored North America to discover many new things in nature, find new possible trade routes, see potential threats to westward expansion, look at the possibility to invent new natural resources, and the list goes on and on. They also worked together with people of vast races and/or backgrounds which only increased their interest with the West. They were tremendously essential to this nation’s history because they were the first white men to undertake such a journey, make such a detailed map of their travels, and detail the wildlife…

    • 284 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    IST223 Crib sheet

    • 3425 Words
    • 7 Pages

    rectangles, and relationships are shown by lines between the rectangles. Attributes are generally listed within the rectangle. The many side of many relationships is represented by a crows footentity-relationship (E-R) modelA set of constructs and conventions used to create data models. The things in the users world are represented by entities, and the associations among those things are represented by relationships. The results are usually documented in an entity-relationship (E-R) diagramID-dependent entityan entity whose identifier includes the identifier of another entityidentifierwhich are attributes that name, or identify, entity instancesidentifying relationshipIn such relationships, the parent is always required, but the child (the ID-dependent entity) may or may not be required, depending on application requirements. Identifying relationships are shown with solid lines in E-R diagrams.is-aRelationships among supertype/subtype entitiesmandatoryat least one entity instance must participate in the relationshipmaximum cardinalityThe maximum cardinality is the maximum number of entity instances that can participate in a relationship instance.minimum cardinalityThe minimum cardinality is the minimum number of entity instances that must participate in a relationship instance.nonidentifying relationshiprelationship drawn with a dashed line (refer to Figure 5-7) is used between strong entities and is called a nonidentifying relationship because there are no ID-dependent entities in the relationship.null valueare a problem because they are ambiguous. They can mean that a value is inappropriate, unknown, or known, but not yet been entered into the databaseparentAn entity or row on the one side of a one-to-many relationshiprecursive relationshipoccurs when an entity type has a relationship to itself.relationship classAssociations among entity classesrelationship instanceassociations among entity instances.strong entityan entity that represents something that can exist…

    • 3425 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Entity-relationship Model

    • 411 Words
    • 2 Pages

    1. Logic Design -The entity relation design without regard to what RDBMS or system it will be on.…

    • 411 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    infs2603

    • 1000 Words
    • 4 Pages

    3. If an association is found to have attributes or operations, describe how these can…

    • 1000 Words
    • 4 Pages
    Powerful Essays
  • Good Essays

    Compter Science

    • 819 Words
    • 4 Pages

    truth table construction, subexpression construction using AND and NOT gates, subexpression combination using OR gates, circuit diagram production…

    • 819 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Assign1

    • 1387 Words
    • 16 Pages

    Note: See §3.4 for explanations and examples of relational algebra operations. (For instance, see Table 3.8.)…

    • 1387 Words
    • 16 Pages
    Satisfactory Essays
  • Good Essays

    Cis 111

    • 790 Words
    • 4 Pages

    “The benefits of using the relational model would result in an easy to use, flexible, high performance database at a low cost.” (Anita, 2010) Therefore, allowing them to participate in the entire design process of the logical construction. The relational model provides an easy and flexible way of manipulating data with a system that offers:…

    • 790 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    In this assignment, you will apply key concepts covered in the module readings. You will identify the component parts of arguments and differentiate between various types of arguments such as strict, loose, inductive, and deductive. You will then construct specific, original arguments.…

    • 1297 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    A retrospective understanding of an author’s context, allows us to identify and contrast between the social values apparent in their respective literature. This is evident in both Shakespeare’s 16th century play ‘Othello’ and Geoffrey Sax’s 2001 variation. Both texts explore the differences in human nature; such as revenge and discrimination in the form of gender inequality and racial prejudice and this can be seen as a reflection it its context. Since these ideas are constant throughout both texts a comparative analysis would indicate the differing values of the society of each text. Shakespeare’s Othello has been crafted for an Elizabethan audience, thus he’s given importance to a higher supernatural figure as that was the belief of their time. In comparison Sax portrays a more modern ideology such as science…

    • 926 Words
    • 4 Pages
    Good Essays
  • Best Essays

    If u need anything from the list, do contact us anytime, we provide competitive prices and fast delivery after payment done. We are assisting students by providing them quality services regarding Solutions and Test Bank for courses. We hope that you people will like our service and get better grades.…

    • 19238 Words
    • 77 Pages
    Best Essays
  • Powerful Essays

    Logical Database Design

    • 1722 Words
    • 7 Pages

    CIT 214 – Assignment 1 – Logical Database Design, The Big Boys and Girls Gym Database…

    • 1722 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    5. How back patching can be used to generate code for Boolean expressions and flow of control…

    • 351 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    crypyography

    • 2299 Words
    • 10 Pages

    Each value in a tuple is an atomic value; that is, it is not divisible into components within the framework of the basic relational model. Hence, composite and multivalued attributes are not allowed. This model is sometimes called the flat relational model. Much of the theory behind the relational model was developed with this assumption in mind, which is called the first normal form assumption. Hence, multivalued attributes must be represented by separate relations, and composite attributes are represented only by their simple component attributes in the basic relational model.…

    • 2299 Words
    • 10 Pages
    Powerful Essays

Related Topics