Widening Sharing

  • Enea Zaffanella
  • Roberto Bagnara
  • Patricia M. Hill
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1702)


We study the problem of an efficient and precise sharing analysis of (constraint) logic programs. After recognizing that neither plain Sharing nor its non-redundant (but equivalent) abstraction scale well to real programs, we consider the domain proposed by C. Fecht [12,13]. This domain consists of a combination of Pos with a quite weak abstraction of Sharing. While verifying that this domain is truly remarkable, in terms of both precision and efficiency, we have revealed significant precision losses for several real programs. This loss concerns groundness, pair-sharing, linearity, but not freeness. (Indeed, we have proved that a wide family of abstractions of Sharing do not incur precision loss on freeness.) We define a simple domain for sharing analysis that supports the implementation of several widening techniques. In particular, with this domain it is straightforward to turn Fecht’s idea into a proper widening. More precise widenings are also considered. However, in spite of thorough experimentation we found that the first widening we propose is hard to improve on, provided Pos is included in the domain. We show that when Pos is not included, a widening based on cliques of sharing pairs is preferred.


Mode Analysis Sharing Analysis Widening 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bagnara, R.: Data-Flow Analysis for Constraint Logic-Based Languages. PhD thesis, Dipartimento di Informatica, Universitd̀ Pisa, Corso Italia 40, I-56125 Pisa, Italy, Printed as Report TD-1/97 (March 1997)Google Scholar
  2. 2.
    Bagnara, R.: Widening Pos: Simple, effective, and rarely needed. Unpublished short note (1998)Google Scholar
  3. 3.
    Bagnara, R., Hill, P.M., Zaffanella, E.: Set-sharing is redundant for pair-sharing. In: Van Hentenryck, P. (ed.) SAS 1997. LNCS, vol. 1302, pp. 53–67. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  4. 4.
    Bagnara, R., Hill, P.M., Zaffanella, E.: Set-sharing is redundant for pair-sharing. Theoretical Computer Science (1999) To appearGoogle Scholar
  5. 5.
    Bagnara, R., Schachte, P.: Factorizing equivalent variable pairs in ROBDDbased implementations of Pos. In: Haeberer, A.M. (ed.) AMAST 1998. LNCS, vol. 1548, Springer, Heidelberg (1998)Google Scholar
  6. 6.
    Bron, C., Kerbosch, J.: Finding all cliques of an undirected graph. Communications of the ACM 16(9), 575–577 (1973)zbMATHCrossRefGoogle Scholar
  7. 7.
    Bruynooghe, M., Codish, M., Mulkers, A.: Abstract unification for a composite domain deriving sharing and freeness properties of program variables. In: de Boer, F.S., Gabbrielli, M. (eds.) Verification and Analysis of Logic Languages, Proceedings of the W2 Post-Conference Workshop, International Conference on Logic Programming, Santa Margherita Ligure, Italy, pp. 213–230 (1994)Google Scholar
  8. 8.
    Codish, M., Sφndergaard, H., Stuckey, P.J.: Sharing and groundness dependencies in logic programs. Submitted for publicationGoogle Scholar
  9. 9.
    Cortesi, A., Filé, G.: Comparison and design of abstract domains for sharing analysis. In: Saccà, D. (ed.) Proceedings of the Eighth Italian Conference on Logic Programming (GULP 1993), Gizzeria, Italy, pp. 251–265. Mediterranean Press (1993)Google Scholar
  10. 10.
    Cortesi, A., Filé, G.: Sharing is optimal. Journal of Logic Programming 38(3), 371–386 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    Cousot, P., Cousot, R.: Comparing the Galois connection and widening/ narrowing approaches to abstract interpretation. In: Bruynooghe, M., Wirsing, M. (eds.) PLILP 1992. LNCS, vol. 631, Springer, Heidelberg (1992)CrossRefGoogle Scholar
  12. 12.
    Fecht, C.: An efficient and precise sharing domain for logic programs. In: Kuchen, H., Swierstra, S.D. (eds.) PLILP 1996. An efficient and precise sharing domain for logic programs, vol. 1140, pp. 469–470. Springer, Heidelberg (1996)Google Scholar
  13. 13.
    Fecht, C.: Efficient and precise sharing domains for logic programs. Technical Report A/04/96, Universität des Saarlandes, Fachbereich 14 Informatik, Saarbrücken, Germany (1996)Google Scholar
  14. 14.
    Hill, P.M., Bagnara, R., Zaffanella, E.: The correctness of set-sharing. In: Levi, G. (ed.) SAS 1998. LNCS, vol. 1503, pp. 99–114. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  15. 15.
    Jacobs, D., Langen, A.: Static analysis of logic programs for independent AND parallelism. Journal of Logic Programming 13(2&3), 291–314 (1992)zbMATHCrossRefGoogle Scholar
  16. 16.
    Langen, A.: Static Analysis for Independent And-Parallelism in Logic Programs. PhD thesis, Computer Science Department, University of Southern California, Printed as Report TR 91-05 (1990)Google Scholar
  17. 17.
    Muthukumar, K., Hermenegildo, M.: Compile-time derivation of variable dependency using abstract interpretation. Journal of Logic Programming 13(2&3), 315–347 (1992)zbMATHCrossRefGoogle Scholar
  18. 18.
    Sφndergaard, H.: An application of abstract interpretation of logic programs: Occur check reduction. In: Robinet, B., Wilhelm, R. (eds.) ESOP 1986. LNCS, vol. 213, pp. 327–338. Springer, Heidelberg (1986)Google Scholar
  19. 19.
    Zaffanella, E., Bagnara, R., Hill, P.M.: Widening Sharing. Submitted for publication (1999), Available at

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Enea Zaffanella
    • 1
  • Roberto Bagnara
    • 2
  • Patricia M. Hill
    • 3
  1. 1.Servizio IX AutomazioneUniversità degli Studi di ModenaItaly
  2. 2.Dipartimento di MatematicaUniversità degli Studi di ParmaItaly
  3. 3.School of Computer StudiesUniversity of LeedsLeedsU.K.

Personalised recommendations