Abstract
We describe Chisel, a tool that synthesizes a program slicer directly from a given algebraic specification of a programming language operational semantics \(\mathcal {S}\). \(\mathcal {S}\) is assumed to be a rewriting logic specification, given in Maude, while the program is a ground term of this specification. Chisel takes \(\mathcal {S}\) and synthesizes language constructs, i.e., instructions, that produce features relevant for slicing, e.g., data dependency. We implement syntheses adjusted to each feature as model checking properties over an abstract representation of \(\mathcal {S}\). The syntheses results are used by a traditional interprocedural slicing algorithm that we parameterize by the synthesized language features. We present the tool on two language paradigms: high-level, imperative and low-level, assembly languages. Computing program slices for these languages allows for extracting traceability properties in standard compilation chains and makes our tool fitting for the validation of embedded system designs. Chisel’s slicing benchmark evaluation is based on benchmarks used in avionics.
Similar content being viewed by others
Notes
Note that these programs are defined to illustrate Chisel features, so they do not produce any relevant output when executed.
Actually, Chisel works without an explicit distinction between syntax and memory modules, because it operates at the sort level. We present this scenario to simplify the description.
The instruction skip is introduced to mark the end of the evaluation of each instruction and stands for a fully evaluated program.
Note that s denotes a sort while w denotes a list of sorts.
It is unlikely to find one of these sorts only in the co-arity, except for constructors.
References
Alpuente, M., Ballis, D., Frechina, F., Sapina, J.: Combining runtime checking and slicing to improve Maude error diagnosis. In: Martí-Oliet, N., Ölveczky, P., Talcott, C. (eds.) Logic, Rewriting, and Concurrency. LNCS, vol. 9200, pp. 72–96. Springer, Cham (2015)
Arinc. ARINC Specification 653-2: avionics application software standard interface: part 1—required services. Technical report, Avionics Electronic Engineering Committee (ARINC), March (2006)
Asavoae, I.M., Asavoae, M., Riesco, A.: Towards a formal semantics-based technique for interprocedural slicing. In: iFM 2014. LNCS, vol. 8739, pp. 291–306. Springer (2014)
Asavoae, I.M., Asavoae, M., Riesco, A.: Context-updates analysis and refinement in Chisel. CoRR abs/1709.06897 (2017)
Asavoae, M.: K semantics for assembly languages: a case study. Electr. Notes Theor. Comput. Sci. 304, 111–125 (2014)
Balakrishnan, G., Gruian, R., Reps, T.W., Teitelbaum, T.: CodeSurfer/x86-a platform for analyzing x86 executables. In: CC. LNCS, vol. 3443, pp. 250–254. Springer (2005)
Benveniste, A., Borgne, M.L., Guernic, P.L.: SIGNAL as a model for real-time and hybrid systems. In: ESOP ’92 Proceedings, pp. 20–38 (1992)
Benveniste, A., Caspi, P., Edwards, S.A., Halbwachs, N., Guernic, P.L., de Simone, R.: The synchronous languages 12 years later. Proc. IEEE 91(1), 64–83 (2003)
Berry, G., Gonthier, G.: The Esterel synchronous programming language: design, semantics, implementation. Sci. Comput. Program. 19(2), 87–152 (1992)
Binkley, D., Gold, N., Harman, M., Islam, S., Krinke, J., Yoo, S.: ORBS: Language-independent program slicing. In: FSE14, pp. 109–120 (2014)
Bouhoula, A., Jouannaud, J.P., Meseguer, J.: Specification and proof in membership equational logic. Theor. Comput. Sci. 236, 35–132 (2000)
Boulanger, J.L., Fornari, F.X., Camus, J.L., Dion, B.: SCADE: Language and Applications, 1st edn. Wiley-IEEE Press, Hoboken (2015)
Calcagno, C., Distefano, D.: Infer: an automatic program verifier for memory safety of C programs. In: Proceedings of the 3rd International Conference on NASA Formal Methods, NFM’11, pp. 459–465 (2011)
Caspi, P., Pilaud, D., Halbwachs, N., Plaice, J.: Lustre: a declarative language for programming synchronous systems. In: Symposium on Principles of Programming Languages, vol. 1987, pp. 178–188 (1987)
Clarke, E.M., Grumberg, O., Peled, D.A.: Model Checking. MIT Press, Cambridge (2001)
Clarke, E.M., Schlingloff, B.: Model checking. In: Robinson, J.A., Voronkov, A. (eds.) Handbook of Automated Reasoning (in 2 Volumes), pp. 1635–1790. Elsevier and MIT Press, New York, Cambridge (2001)
Clavel, M., Duran, F., Eker, S., Lincoln, P., Marti-Oliet, N., Meseguer, J., Talcott, C.: All About Maude. LNCS, vol. 4350. Springer, Berlin (2007)
Danicic, S., Harman, M.: Espresso: a slicer generator. In: SAC, pp. 831–839 (2000)
Dershowitz, N., Plaisted, D.A.: Rewriting. In: Robinson, J.A., Voronkov, A. (eds.) Handbook of Automated Reasoning (in 2 Volumes), pp. 535–610. Elsevier and MIT Press, New York and Cambridge (2001)
Field, J., Ramalingam, G., Tip, F.: Parametric program slicing. In: POPL, pp. 379–392. ACM Press (1995)
Fink, S.J., Yahav, E., Dor, N., Ramalingam, G., Geay, E.: Effective typestate verification in the presence of aliasing. In: ISSTA, pp. 133–144. ACM (2006)
Gamatié, A., Gautier, T., Besnard, L.: Modeling of avionics applications and performance evaluation techniques using the synchronous language SIGNAL. Electr. Notes Theor. Comput. Sci. 88, 87–103 (2004)
Hennessy, J.L., Patterson, D.A.: Computer Architecture, Fifth Edition: A Quantitative Approach, 5th edn. Morgan Kaufmann Publishers Inc., Burlington (2011)
Hoffmann, J., Ussath, M., Holz, T., Spreitzenbarth, M.: Slicing droids: program slicing for smali code. In: SAC, pp. 1844–1851. ACM (2013)
Horwitz, S., Reps, T., Binkley, D.: Interprocedural slicing using dependence graphs. In: Conference on Programming Language Design and Implementation, PLDI ’88, pp. 35–46 (1988)
Kirchner, F., Kosmatov, N., Prevosto, V., Signoles, J., Yakobowski, B.: Frama-C: a software analysis perspective. Form. Asp. Comput. 27(3), 573–609 (2015)
Langdon, W.B., Yoo, S., Harman, M.: Inferring automatic test oracles. In: ICSE, pp. 5–6 (2017)
Meseguer, J.: Conditional rewriting logic as a unified model of concurrency. Theor. Comput. Sci. 96(1), 73–155 (1992)
Meseguer, J., Rosu, G.: The rewriting logic semantics project. Theor. Comput. Sci. 373(3), 213–237 (2007)
Meseguer, J., Roşu, G.: The rewriting logic semantics project: a progress report. Inf. Comput. 231, 38–69 (2013)
Nemer, F., Casse, H., Sainrat, P., Bahsoun, J.P., Michiel, M.D.: PapaBench: a free real-time benchmark. In: WCET (2006)
Riesco, A., Asavoae, I.M., Asavoae, M.: A generic program slicing technique based on language definitions. In: WADT 2012. LNCS, vol. 7841, pp. 248–264 (2013)
Riesco, A., Asavoae, I.M., Asavoae, M.: Memory policy analysis for semantics specifications in Maude. In: LOPSTR. LNCS, vol. 9527, pp. 293–310. Springer (2015)
Riesco, A., Asavoae, I.M., Asavoae, M.: Slicing from formal semantics: Chisel. In: FASE, pp. 374–378 (2017)
Roşu, G.: Matching logic. Logical Methods in Computer Science to appear (2017)
Rosu, G.: K—a semantic framework for programming languages and formal analysis tools. In: Peled, D., Pretschner, A. (eds.) Dependable Software Systems Engineering. NATO Science for Peace and Security. IOS Press, Amsterdam (2017)
Sahoo, S.K., Criswell, J., Geigle, C., Adve, V.S.: Using likely invariants for automated software fault localization. In: ASPLOS, pp. 139–152. ACM (2013)
Schüle, T., Schneider, K.: Abstraction of assembler programs for symbolic worst case execution time analysis. DAC 2004, 107–112 (2004)
Srinivasan, V., Reps, T.W.: An improved algorithm for slicing machine code. In: OOPSLA, pp. 378–393 (2016)
Teitelbaum, T.: CodeSurfer. ACM SIGSOFT Softw. Eng. Notes 25(1), 99 (2000)
Tip, F.: A survey of program slicing techniques. J. Program. Lang. 3(3), 121–189 (1995)
Verdejo, A., Marti-Oliet, N.: Executable structural operational semantics in Maude. J. Log. Algebr. Program. 67, 226–293 (2006)
Weiser, M.: Program slicing. In: ICSE, pp. 439–449. IEEE Press (1981)
Author information
Authors and Affiliations
Corresponding author
Additional information
This research has been partially supported by the MINECO Spanish project TRACES (TIN2015-67522-C3-3-R) and by the Comunidad de Madrid project N-Greens Software-CM (S2013/ICE-2731).
Rights and permissions
About this article
Cite this article
Asăvoae, I.M., Asăvoae, M. & Riesco, A. Slicing from formal semantics: Chisel—a tool for generic program slicing. Int J Softw Tools Technol Transfer 20, 739–769 (2018). https://doi.org/10.1007/s10009-018-0500-y
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10009-018-0500-y