skip to main content
10.1145/1985793.1985863acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Unifying execution of imperative and declarative code

Published: 21 May 2011 Publication History

Abstract

We present a unified environment for running declarative specifications in the context of an imperative object-Oriented programming language. Specifications are Alloy-like, written in first-order relational logic with transitive closure, and the imperative language is Java. By being able to mix imperative code with executable declarative specifications, the user can easily express constraint problems in place, i.e., in terms of the existing data structures and objects on the heap. After a solution is found, the heap is updated to reflect the solution, so the user can continue to manipulate the program heap in the usual imperative way. We show that this approach is not only convenient, but, for certain problems can also outperform a standard imperative implementation. We also present an optimization technique that allowed us to run our tool on heaps with almost 2000 objects.

References

[1]
Hamiltonian Path Algorithm. http://moodle.cornellcollege.edu/0809/mod/resource/view.php?id=8993. CSC213-8 Course.
[2]
Squander Home Page. http://people.csail.mit.edu/aleks/squander.
[3]
K. Beck. Extreme Programming Explained. 1999.
[4]
C. Boyapati, S. Khurshid, and D. Marinov. Korat: Automated Testing Based on Java Predicates. In ISSTA'02.
[5]
L. Burdy, Y. Cheon, D. Cok, M. D. Ernst, J. R. Kiniry, G. T. Leavens, K. R. M. Leino, and E. Poll. An Overview of JML Tools and Applications. Software Tools for Technology Transfer, 7(3):212--232, 2005.
[6]
N. Cata no and T. Wahls. Executing JML specifications of Java card applications: a case study. In SAC'09, pages 404--408, 2009.
[7]
O. J. Dahl, E. Dijkstra, and C. A. R. Hoare, editors. Structured programming. Academic Press, 1972.
[8]
N. E. Fuchs. Specifications are (preferably) executable. Software Engineering Journal, 7(5):323--334, 1992.
[9]
I. Hayes and C. B. Jones. Specifications are not (necessarily) executable. Software Engineering Journal, 4(6):330--338, 1989.
[10]
C. A. R. Hoare. An Overview of Some Formal Methods for Program Design. IEEE Computer, 20(9):85--91, 1987.
[11]
D. Jackson. Software Abstractions: Logic, Language, and Analysis. MIT Press, Apr. 2006.
[12]
B. Krause and T. Wahls. jmle: A tool for executing JML specifications via constraint programming. In FMICS'06, Aug. 2006.
[13]
D. Marinov and S. Khurshid. TestEra: A Novel Framework for Automated Testing of Java Programs. In ASE'01, 2001.
[14]
A. Milicevic. Executable Specifications for Java Programs. Master's thesis, MIT, Sept. 2010.
[15]
C. Morgan. The Specification Statement. ACM Trans. Prog. Lang. Syst., 10(3), 1988.
[16]
C. Morgan. Programming from Specifications. Prentice-Hall, 2nd edition, 1998.
[17]
D. Rayside, A. Milicevic, K. Yessenov, G. Dennis, and D. Jackson. Agile specifications. In Onward'09, 2009.
[18]
H. Samimi, E. D. Aung, and T. D. Millstein. Falling Back on Executable Specifications. In ECOOP'10.
[19]
C. Schulte, G. Smolka, and J. Würtz. Encapsulated Search and Constraint Programming in Oz. In PPCP, pages 134--150. Springer-Verlag, 1994.
[20]
R. Sosic and J. Gu. A polynomial time algorithm for the N-Queens problem. SIGART B., 1(3):7--11, 1990.
[21]
E. Torlak. A Constraint Solver for Software Engineering: Finding Models and Cores of Large Relational Specifications. PhD thesis, MIT, 2008.
[22]
J. Yang. Specification-Enhanced Execution. Master's thesis, MIT, May 2010.
[23]
K. Yessenov. A Light-weight Specification Language for Bounded Program Verification. Master's thesis, MIT, 2009.
[24]
V. S. Yeung. Declarative Configuration Applied to Course Scheduling . Master's thesis, MIT, 2006.

Cited By

View all
  • (2024)Leveraging Machine Learning for Optimal Object-Relational Database Mapping in Software SystemsProceedings of the 1st ACM International Conference on AI-Powered Software10.1145/3664646.3664769(94-102)Online publication date: 10-Jul-2024
  • (2024)Scalable Relational Analysis via Relational Bound PropagationProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639171(1-12)Online publication date: 20-May-2024
  • (2023)A Study of the Electrum and DynAlloy Dynamic Behavior NotationsIEEE Transactions on Software Engineering10.1109/TSE.2023.332062549:11(4946-4963)Online publication date: 1-Nov-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '11: Proceedings of the 33rd International Conference on Software Engineering
May 2011
1258 pages
ISBN:9781450304450
DOI:10.1145/1985793
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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 May 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. constraint-based languages
  2. declarative programming
  3. executable specifications
  4. formal methods

Qualifiers

  • Research-article

Conference

ICSE11
Sponsor:
ICSE11: International Conference on Software Engineering
May 21 - 28, 2011
HI, Waikiki, Honolulu, USA

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)11
  • Downloads (Last 6 weeks)0
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Leveraging Machine Learning for Optimal Object-Relational Database Mapping in Software SystemsProceedings of the 1st ACM International Conference on AI-Powered Software10.1145/3664646.3664769(94-102)Online publication date: 10-Jul-2024
  • (2024)Scalable Relational Analysis via Relational Bound PropagationProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3639171(1-12)Online publication date: 20-May-2024
  • (2023)A Study of the Electrum and DynAlloy Dynamic Behavior NotationsIEEE Transactions on Software Engineering10.1109/TSE.2023.332062549:11(4946-4963)Online publication date: 1-Nov-2023
  • (2022)Combining solution reuse and bound tightening for efficient analysis of evolving systemsProceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis10.1145/3533767.3534399(89-100)Online publication date: 18-Jul-2022
  • (2021)Free Objects in Constraint-logic Object-oriented ProgrammingProceedings of the 23rd International Symposium on Principles and Practice of Declarative Programming10.1145/3479394.3479409(1-13)Online publication date: 6-Sep-2021
  • (2017)The power of "why" and "why not": enriching scenario exploration with provenanceProceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering10.1145/3106237.3106272(106-116)Online publication date: 21-Aug-2017
  • (2017)Alloy*: a general-purpose higher-order relational constraint solverFormal Methods in System Design10.1007/s10703-016-0267-2Online publication date: 27-Jan-2017
  • (2016)Declaring Constraints on Object-oriented CollectionsJournal of Information Processing10.2197/ipsjjip.24.91724:6(917-927)Online publication date: 2016
  • (2016)Automatically selecting and optimizing constraint solver procedures for object-constraint languagesCompanion Proceedings of the 15th International Conference on Modularity10.1145/2892664.2892671(65-72)Online publication date: 14-Mar-2016
  • (2016)Lowering the Learning Curve for Declarative Programming: A Python API for the IDP SystemPractical Aspects of Declarative Languages10.1007/978-3-319-51676-9_6(86-102)Online publication date: 17-Dec-2016
  • Show More Cited By

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