Skip to main content

Slicing Unconditional Jumps with Unnecessary Control Dependencies

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2020)

Abstract

Program slicing is an analysis technique that has a wide range of applications, ranging from compilers to clone detection software, and that has been applied to practically all programming languages. Most program slicing techniques are based on a widely extended program representation, the System Dependence Graph (SDG). However, in the presence of unconditional jumps, there exist some situations where most SDG-based slicing techniques are not as accurate as possible, including more code than strictly necessary. In this paper, we identify one of these scenarios, pointing out the cause of the inaccuracy, and describing the initial solution to the problem proposed in the literature, together with an extension, which solves the problem completely. These solutions modify both the SDG generation and the slicing algorithm. Additionally, we propose an alternative solution, that solves the problem by modifying only the SDG generation, leaving the slicing algorithm untouched.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    The target of the jump in a return statement is the End or Exit node of the procedure it’s in, from which control will be handed back to the previous procedure in the call stack.

  2. 2.

    Multiple languages allow chaining case statements.

References

  1. Sun, C.A., Ran, Y., Zheng, C., Liu, H., Towey, D., Zhang, X.: Fault localisation for WS-BPEL programs based on predicate switching and program slicing. J. Syst. Softw. 135, 191–204 (2018)

    Article  Google Scholar 

  2. Aung, M., Horwitz, S., Joiner, R., Reps, T.: Specialization slicing. ACM Trans. Program. Lang. Syst. 36(2), 5:1–5:67 (2014)

    Google Scholar 

  3. Ball, T., Horwitz, S.: Slicing programs with arbitrary control-flow. In: Fritzson, P.A. (ed.) AADEBUG 1993. LNCS, vol. 749, pp. 206–222. Springer, Heidelberg (1993). https://doi.org/10.1007/BFb0019410

    Chapter  Google Scholar 

  4. Binkley, D.: Precise executable interprocedural slices. ACM Lett. Program. Lang. Syst. 2(1–4), 31–45 (1993)

    Article  Google Scholar 

  5. Chen, Z., Xu, B.: Slicing concurrent java programs. SIGPLAN Not. 36(4), 41–47 (2001)

    Article  MathSciNet  Google Scholar 

  6. Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9(3), 319–349 (1987)

    Article  Google Scholar 

  7. Hajnal, A., Forgács, I.: A demand-driven approach to slicing legacy COBOL systems. J. Softw. Maint. 24(1), 67–82 (2012)

    Google Scholar 

  8. Horwitz, S., Reps, T., Binkley, D.:: Interprocedural slicing using dependence graphs. In: Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation, PLDI 1988, pp. 35–46. ACM, New York (1988)

    Google Scholar 

  9. Horwitz, S., Reps, T., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12(1), 26–60 (1990)

    Article  Google Scholar 

  10. Krinke, J.: Static slicing of threaded programs. SIGPLAN Not. 33(7), 35–42 (1998)

    Article  Google Scholar 

  11. Kumar, S., Horwitz, S.: Better slicing of programs with jumps and switches. In: Kutsche, R.-D., Weber, H. (eds.) FASE 2002. LNCS, vol. 2306, pp. 96–112. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45923-5_7

    Chapter  Google Scholar 

  12. Larsen, L., Harrold, M.J.: Slicing object-oriented software. In: Proceedings of the 18th International Conference on Software Engineering, ICSE 1996, pp. 495–505. IEEE Computer Society, Washington (1996)

    Google Scholar 

  13. Majumdar, A., Drape, S.J., Thomborson, C.D.: Slicing obfuscations: design, correctness, and evaluation. In: Proceedings of the 2007 ACM Workshop on Digital Rights Management, DRM 2007, pp. 70–81. ACM, New York (2007)

    Google Scholar 

  14. Ottenstein, K.J., Ottenstein, L.M.: The program dependence graph in a software development environment. SIGSOFT Softw. Eng. Notes 9(3), 177–184 (1984)

    Article  Google Scholar 

  15. Reps, T., Horwitz, S., Sagiv, M., Rosay, G.: Speeding up slicing. SIGSOFT Softw. Eng. Notes 19(5), 11–20 (1994)

    Article  Google Scholar 

  16. Reps, T., Rosay, G.: Precise interprocedural chopping. In: Proceedings of the 3rd ACM SIGSOFT Symposium on Foundations of Software Engineering, pp. 41–52. Association for Computing Machinery, New York (1995)

    Google Scholar 

  17. Sinha, S., Harrold, M.J., Rothermel, G.: System-dependence-graph-based slicing of programs with arbitrary interprocedural control flow. In: Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No. 99CB37002), pp. 432–441. IEEE, May 1999

    Google Scholar 

  18. Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3(3), 121–189 (1995)

    Google Scholar 

  19. Towle, R.A.: Control and data dependence for program transformations. Ph.D. thesis, USA (1976). AAI7624191

    Google Scholar 

  20. Weiser, M.: Program slicing. In: Proceedings of the 5th International Conference on Software Engineering (ICSE 1981), pp. 439–449. IEEE Press, Piscataway (1981)

    Google Scholar 

Download references

Acknowledgements

This work has been partially supported by the EU (FEDER) and the Spanish MCI/AEI under grants TIN2016-76843-C4-1-R and PID2019-104735RB-C41, by the Generalitat Valenciana under grant Prometeo/2019/098 (DeepTrust), and by TAILOR, a project funded by EU Horizon 2020 research and innovation programme under GA No 952215.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sergio Pérez .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Galindo, C., Pérez, S., Silva, J. (2021). Slicing Unconditional Jumps with Unnecessary Control Dependencies. In: Fernández, M. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2020. Lecture Notes in Computer Science(), vol 12561. Springer, Cham. https://doi.org/10.1007/978-3-030-68446-4_15

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-68446-4_15

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-68445-7

  • Online ISBN: 978-3-030-68446-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics