Skip to main content

Logics for Software Engineering

  • Chapter
  • First Online:
Formal Methods for Software Engineering

Abstract

Logic is the basis for almost all formal methods in computer science. In this chapter, we introduce some of the most commonly used logics by examples. It serves as a reference for subsequent chapters. We start with propositional logic, introduce its syntax, semantics, and calculus. Then we extend our view of propositional logic as a so-called institution, discuss model transformations and modular specifications. Subsequently, we turn to first- and second-order logic and show how these can be obtained as natural extensions of propositional logic. Finally, we discuss non-classical logics: multimodal and deontic logics to deal with alternative and subjective viewpoints, respectively, and dynamic and temporal logics for reasoning about time. The chapter concludes with an elaborate example of how to transform an informal natural language description into a formal specification in linear temporal logic.

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 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 84.99
Price excludes VAT (USA)
  • Durable hardcover 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

Change history

  • 20 December 2022

    .

Notes

  1. 1.

    Here, we use the symbol \(\Vdash \) for the semantic consequence relation between formulae, which is different from the symbol \(\models \) for the satisfaction relation between a model and a formula. For universal validity, the notions coincide: \(\models \varphi \) if and only if \(\{\}\Vdash \varphi \).

  2. 2.

    In this book, the words “sort” and “type” are mutually exchangeable. Historically, logicians prefer the word “type”, whereas computer scientists prefer to use the word “sort”.

  3. 3.

    In Casl, the word “predicate” is used instead of the word “relation”. Thus, in algebraic specifications we will use the words “relation” and “predicate” interchangeably.

  4. 4.

    Due to this axiom, the logic sometimes is called “modal logic K".

  5. 5.

    Some authors and most tools use F and G as a notation instead of \(\Diamond \) and \(\square \). In some papers, F and G are used in addition to \(\Diamond \) and \(\square \), which then have a different meaning.

  6. 6.

    Some authors write \(\textbf{X}\varphi \) instead of \(\bigcirc \varphi \).

References

  • Samson Abramsky, Dov M. Gabbay, and T. S. E. Maibaum, editors. Handbook of Logic in Computer Science (Vol. 3): Semantic Structures. Oxford University Press, Inc., 1995.

    Google Scholar 

  • A. Biere, A. Biere, M. Heule, H. van Maaren, and T. Walsh. Handbook of Satisfiability: Volume 185 Frontiers in Artificial Intelligence and Applications. IOS Press, NLD, 2009.

    Google Scholar 

  • Patrick Blackburn, Maarten de Rijke, and Yde Venema. Modal Logic, volume 53 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 2001.

    Google Scholar 

  • Christel Baier and Joost-Pieter Katoen. Principles of model checking. MIT Press, 2008.

    Google Scholar 

  • Michel Bidoit and Peter D. Mosses. CASL User Manual – Introduction to Using the Common Algebraic Specification Language. Springer, 2004.

    Google Scholar 

  • George Boole. The Mathematical Analysis of Logic: Being an Essay Towards a Calculus of Deductive Reasoning. Cambridge Library Collection - Mathematics. Cambridge University Press, 1847.

    MATH  Google Scholar 

  • J.A. Bergstra and J.V. Tucker. Algebraic specifications of computable and semicomputable data types. Theoretical Computer Science, 50(2):137–181, 1987.

    Google Scholar 

  • Patrick Blackburn, J. F. A. K. van Benthem, and Frank Wolter, editors. Handbook of Modal Logic, volume 3 of Studies in logic and practical reasoning. North-Holland, 2007.

    Google Scholar 

  • Edmund M. Clarke, Orna Grumberg, and Doron A. Peled. Model checking. MIT Press, 2001.

    Google Scholar 

  • Roderick M. Chisholm. Contrary-to-duty imperatives and deontic logic. Analysis, 24:33–36, 1963.

    Article  Google Scholar 

  • A. Church. Introduction to Mathematical Logic. Annals of Mathematics Studies. Princeton University Press, reprint, revised edition, 1996.

    Google Scholar 

  • Edmund M. Clarke, Thomas A. Henzinger, Helmut Veith, and Roderick Bloem, editors. Handbook of Model Checking. Springer, 2018.

    Google Scholar 

  • Edsger W. Dijkstra. Hierarchical ordering of sequential processes. Acta Informatica, 1:115–138, 1971.

    Article  MathSciNet  Google Scholar 

  • José Luiz Fiadeiro. Categories for software engineering. Springer, 2005.

    Google Scholar 

  • Peter Forrest. The Identity of Indiscernibles. In Edward N. Zalta, editor, The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, Stanford University, winter 2016 edition, 2016.

    Google Scholar 

  • J.A. Goguen and R.M. Burstall. Institutions: Abstract model theory for specification and programming. Journal of the ACM, 39:95–146, 1992.

    Article  MathSciNet  MATH  Google Scholar 

  • Dov M. Gabbay and Franz Guenthner, editors. Handbook of Philosophical Logic, volume 11. Springer, 2004.

    Google Scholar 

  • Dov M. Gabbay and John Woods, editors. Handbook of the History of Logic, volume 5. Elsevier, 2009.

    Google Scholar 

  • David Harel, Jerzy Tiuryn, and Dexter Kozen. Dynamic Logic. MIT Press, Cambridge, MA, USA, 2000.

    Book  MATH  Google Scholar 

  • Johan Anthony Willem Kamp. Tense logic and the theory of linear order, 1968. PhD Thesis.

    Google Scholar 

  • Fred Kröger and Stephan Merz. Temporal Logic and State Systems. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2008.

    Google Scholar 

  • Saul Kripke. A completeness theorem in modal logic. J. Symb. Log., 24(1):1–14, 1959.

    Article  MathSciNet  MATH  Google Scholar 

  • Fred Kröger. Logical rules of natural reasoning about programs. In Third International Colloquium on Automata, Languages and Programming, pages 87–98. Edinburgh University Press, 1976.

    Google Scholar 

  • Peter D. Mosses. CoFI: The common framework initiative for algebraic specification and development. In TAPSOFT’97, LNCS 1214, pages 115–137. Springer, 1997.

    Google Scholar 

  • Peter D. Mosses. CASL Reference Manual: The Complete Documentation Of The Common Algebraic Specification Language. Springer, 2004.

    Google Scholar 

  • Zohar Manna and Amir Pnueli. Temporal Logic of Reactive and Concurrent Systems: Specification, The. Springer-Verlag New York, Inc., 1992.

    Book  MATH  Google Scholar 

  • Till Mossakowski, Lutz Schröder, Markus Roggenbach, and Horst Reichel. Algebraic-coalgebraic specification in CoCasl. J. Log. Algebraic Methods Program., 67(1-2):146–197, 2006.

    Article  MathSciNet  MATH  Google Scholar 

  • Process analysis toolkit (PAT) 3.5 user manual, 2012. https://www.comp.nus.edu.sg/~pat/OnlineHelp/index.htm.

  • Process analysis toolkit (PAT) 3.5 user manual, 2020. https://pat.comp.nus.edu.sge.

  • Doron A. Peled, David Gries, and Fred B. Schneider. Software Reliability Methods. Springer-Verlag, 2001.

    Google Scholar 

  • Amir Pnueli. The temporal logic of programs. In FOCS’77, pages 46–57. IEEE Computer Society Press, 1977.

    Google Scholar 

  • Raymond R. Smullyan. First-Order Logic, volume 43 of Ergebnisse der Mathematik und ihrer Grenzgebiete. 2. Folge. Springer, 1968.

    Google Scholar 

  • Volkswagen, https://www.volkswagen.co.uk/en/configurator.html, Last accessed: August 2021.

  • Georg Henrik Von Wright. Deontic logic. Mind, 60:1–15, 1951.

    Article  Google Scholar 

  • Georg Henrik Von Wright. Deontic logic: A personal view. Ratio Juris, 12(1):26–38, 1999.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Markus Roggenbach .

Rights and permissions

Reprints and permissions

Copyright information

© 2022 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Schlingloff, BH., Roggenbach, M., Schneider, G., Cerone, A. (2022). Logics for Software Engineering. In: Formal Methods for Software Engineering. Texts in Theoretical Computer Science. An EATCS Series. Springer, Cham. https://doi.org/10.1007/978-3-030-38800-3_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-38800-3_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-38799-0

  • Online ISBN: 978-3-030-38800-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics