Unifying execution of imperative and declarative code

  • Milicevic A
  • Rayside D
  • Yessenov K
 et al. 
  • 48


    Mendeley users who have this article in their library.
  • Citations

    Citations of this article.


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.

Author-supplied keywords

  • constraint-based languages
  • declarative programming
  • executable specifications
  • formal methods

Get free article suggestions today

Mendeley saves you time finding and organizing research

Sign up here
Already have an account ?Sign in

Find this document

Get full text


  • Aleksandar Milicevic

  • Derek Rayside

  • Kuat Yessenov

  • Daniel Jackson

Cite this document

Choose a citation style from the tabs below

Save time finding and organizing research with Mendeley

Sign up for free