Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2426890.2426914acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
research-article

Automatic inference of specifications using matching logic

Published: 21 January 2013 Publication History

Abstract

Formal specifications can be used for various software engineering activities ranging from finding errors to documenting software and automatic test-case generation. Automatically discovering specifications for heap-manipulating programs is a challenging task. In this paper, we propose a technique for automatically inferring formal specifications from C code which is based on the symbolic execution and automated reasoning tandem "Matching Logic/K framework". We implemented our technique for a fragment of C called KernelC, in the automated tool KingSpec, which generates axioms that describe the precise input/output behavior of C routines that handle pointer-based structures, i.e., result values and state change. These specifications can be written either in Matching Logic itself, which is useful for further automated analysis within the K formal environment, or in sugared axiomatic form, which favors better human inspection. Since we rely on rewriting logic K semantics specification of programming languages, our approach can be easily extended to any language for which %that a formal semantics in K is given.

References

[1]
The Generic Data Structures Library GDSL. URL http://home.gna.org/gdsl/.
[2]
J. G. B. Liskov. Abstraction and specification in program development. MIT Press, 1986.
[3]
G. Bacci, M. Comini, M. A. Feliú, and A. Villanueva. Automatic Synthesis of Specifications for First Order Curry Programs. In Proc. of the 14th Intl. Symp. on ACM Principles and Practice of Declarative Programming (PPDP'12), volume to appear. ACM Press, 2012.
[4]
C. Barrett and C. Tinelli. CVC3. In W. Damm and H. Hermanns, editors, Proceedings of the 19th International Conference on Computer Aided Verification (CAV'07), volume 4590 of Lecture Notes in Computer Science, pages 298--302. Springer-Verlag, July 2007. Berlin, Germany.
[5]
M. Christodorescu, S. Jha, and C. Kruegel. Mining Specifications of Malicious Behavior. In Proc. of the 6th joint meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE 2007), pages 5--14. ACM, 2007.
[6]
K. Claessen, N. Smallbone, and J. Hughes. QuickSpec: Guessing Formal Specifications Using Testing. In Proc, 4th Int'l Conf. on Tests and Proofs (TAP 2010), volume 6143 of Lecture Notes in Computer Science, pages 6--21. Springer, 2010.
[7]
M. Clavel, F. Durán, S. Eker, P. Lincoln, N. Martí-Oliet, J. Meseguer, and C. Talcott. All About Maude: A High-Performance Logical Framework, volume 4350 of Lecture Notes in Computer Science. Springer- Verlag, 2007.
[8]
C. Csallner, N. Tillmann, and Y. Smaragdakis. DySy: Dynamic Symbolic Execution for Invariant Inference. In Proc. 30th International Conference on Software Engineering (ICSE 2008), pages 281--290. ACM, 2008.
[9]
V. D'Silva, D. Kroening, and G. Weissenbacher. A survey of automated techniques for formal software verification. IEEE Trans. on CAD of Integrated Circuits and Systems, 27(7):1165--1178, 2008.
[10]
C. Ellison and G. Roşu. An executable formal semantics of C with applications. In Proceedings of the 39th Symposium on Principles of Programming Languages (POPL'12), pages 533--544. ACM, 2012.
[11]
M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz, and C. Xiao. The Daikon System for Dynamic Detection of Likely Invariants. Sci. Comput. Program., 69(1-3):35--45, 2007.
[12]
C. Ghezzi, A. Mocci, and M. Monga. Synthesizing Intensional Behavior Models by Graph Transformation. In Proc. 3st Int'l Conf. on Software Engineering (ICSE 2009), pages 430--440. IEEE, 2009.
[13]
D. Giannakopoulou and C. S. Pasareanu. Interface Generation and Compositional Verification in JavaPathfinder. In Proc. 12th In'l Conf. on Fundamental Approaches to Software Engineering (FASE 2009), volume 5503 of Lecture Notes in Computer Science, pages 94--108. Springer, 2009.
[14]
M. Gordon and H. Collavizza. Forward with hoare. In A. Roscoe, C. B. Jones, and K. R.Wood, editors, Reflections on theWork of C.A.R. Hoare, History of Computing, pages 101--121. Springer London, 2010. ISBN 978-1-84882-911-4. URL http://dx.doi.org/10.1007/978-1-84882-912-1_5.
[15]
S. Hangal and M. S. Lam. Tracking down Software Bugs using Automatic Anomaly Detection. In Proc. 22rd International Conference on Software Engineering (ICSE 2002), pages 291--301. ACM, 2002.
[16]
J. Henkel and A. Diwan. Discovering Algebraic Specifications from Java Classes. In Proc. ECOOP, pages 431--456, 2003.
[17]
S. Khurshid, C. S. Pasareanu, andW. Visser. Generalized symbolic execution for model checking and testing. In H. Garavel and J. Hatcliff, editors, TACAS, volume 2619 of Lecture Notes in Computer Science, pages 553--568. Springer, 2003. ISBN 3-540-00898-5.
[18]
J. C. King. Symbolic execution and program testing. Commun. ACM, 19(7):385--394, July 1976. ISSN 0001-0782.
[19]
N.Tillmann, F. Chen, and W. Schulte. Discovering Likely Method Specifications. In Proc. 8th Int'l Conf. on Formal Engineering Methods (ICFEM 2006), volume 4260 of Lecture Notes in Computer Science, pages 717--736. Springer, 2006.
[20]
C. S. Pasareanu and W. Visser. A Survey of new Trends in Symbolic Execution for Software Testing and Analysis. STTT, 11(4):339--353, 2009.
[21]
J. C. Reynolds. Separation Logic: A Logic for Shared Mutable Data Structures. In 17th IEEE Symposium on Logic in Computer Science(LICS 2002), pages 55--74. IEEE Computer Society, 2002.
[22]
G. Roşu andW. Schulte. Matching logic-extended report. Technical Report Department of Computer Science UIUCDCS-R-2009-3026, University of Illinois at Urbana-Champaign, January 2009.
[23]
G. Roşu, C. Ellison, andW. Schulte. Matching logic: An alternative to Hoare/Floyd logic. In M. Johnson and D. Pavlovic, editors, Proceedings of the 13th International Conference on Algebraic Methodology And Software Technology (AMAST'10), volume 6486 of Lecture Notes in Computer Science, pages 142--162, 2010.
[24]
G. Rosu and T.-F. Serbanuta. An Overview of the K Semantic Framework. J. Log. Algebr. Program., 79(6):397--434, 2010.
[25]
G. Rosu and A. Stefanescu. Matching Logic: a new Program Verification Approach. In R. N. Taylor, H.Gall, and N. Medvidovic, editors, Proc. 33rd International Conference on Software Engineering (ICSE 2011), pages 868--871. ACM, 2011.
[26]
G. Rosu, W. Schulte, and T. F. Serbanuta. Runtime verification of C memory safety. In S. Bensalem and D. A. Peled, editors, Runtime Verification(RV'09), volume 5779 of Lecture Notes in Computer Science, pages 132--152, 2009.
[27]
M. Taghdiri and D.Jackson. Inferring Specifications to Detect Errors in Code. Autom. Softw. Eng., 14(1):87--121, 2007.
[28]
J. Whaley, M. C. Martin, and M. S. Lam. Automatic extraction of object-oriented component interfaces. In Proc. ISSTA 2002, pages 218--228, 2002.

Cited By

View all
  • (2023)Spectacular: Finding Laws from 25 Trillion Terms2023 IEEE Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST57152.2023.00035(293-304)Online publication date: Apr-2023
  • (2017)Automated specification inference in a combined domain via user-defined predicatesScience of Computer Programming10.1016/j.scico.2017.05.007148:C(189-212)Online publication date: 15-Nov-2017
  • (2017)Symbolic Abstract Contract Synthesis in a Rewriting FrameworkLogic-Based Program Synthesis and Transformation10.1007/978-3-319-63139-4_11(187-202)Online publication date: 25-Jul-2017
  • Show More Cited By

Index Terms

  1. Automatic inference of specifications using matching logic

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      PEPM '13: Proceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation
      January 2013
      162 pages
      ISBN:9781450318426
      DOI:10.1145/2426890
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Sponsors

      In-Cooperation

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 21 January 2013

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. matching logic
      2. specifications inference
      3. symbolic execution

      Qualifiers

      • Research-article

      Conference

      POPL '13
      Sponsor:

      Acceptance Rates

      PEPM '13 Paper Acceptance Rate 13 of 29 submissions, 45%;
      Overall Acceptance Rate 66 of 120 submissions, 55%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)10
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 26 Jan 2025

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Spectacular: Finding Laws from 25 Trillion Terms2023 IEEE Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST57152.2023.00035(293-304)Online publication date: Apr-2023
      • (2017)Automated specification inference in a combined domain via user-defined predicatesScience of Computer Programming10.1016/j.scico.2017.05.007148:C(189-212)Online publication date: 15-Nov-2017
      • (2017)Symbolic Abstract Contract Synthesis in a Rewriting FrameworkLogic-Based Program Synthesis and Transformation10.1007/978-3-319-63139-4_11(187-202)Online publication date: 25-Jul-2017
      • (2015)Automatic Inference of Specifications in the K FrameworkElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.200.1200(1-17)Online publication date: 19-Dec-2015
      • (2015)From Rewriting Logic, to Programming Language Semantics, to Program VerificationLogic, Rewriting, and Concurrency10.1007/978-3-319-23165-5_28(598-616)Online publication date: 27-Aug-2015
      • (2014)Synthesis of Infinite-State Abstractions and Their Use for Software ValidationSpecification, Algebra, and Software10.1007/978-3-642-54624-2_14(276-295)Online publication date: 2014
      • (2014)Shape Analysis via Second-Order Bi-AbductionProceedings of the 16th International Conference on Computer Aided Verification - Volume 855910.1007/978-3-319-08867-9_4(52-68)Online publication date: 18-Jul-2014

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Figures

      Tables

      Media

      Share

      Share

      Share this Publication link

      Share on social media