Skip to main content

SAT Encodings of the At-Most-k Constraint

A Case Study on Configuring University Courses

  • Conference paper
  • First Online:
Software Engineering and Formal Methods (SEFM 2019)

Abstract

At universities, some fields of study offer multiple branches to graduate in. These branches are defined by mandatory and optional courses. Configuring a branch manually can be a difficult task, especially if some courses have already been attended. Hence, a tool providing guidance on choosing courses is desired. Feature models enable modelling such behaviour, as they are designed to define valid configurations from a set of features. Unfortunately, the branches contain constraints instructing to choose at least k out of n courses in essence. Encoding some of these constraints naïvely in propositional calculus is practically infeasible. We develop a new encoding by combining existing approaches. Furthermore, we report on our experience of encoding the constraints of the computer science master at TU Braunschweig and discuss the impact for research on configurability.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://www.tu-braunschweig.de/informatik-msc/struktur/studienrichtungen.

  2. 2.

    https://github.com/PaulAtTUBS/BroT.

  3. 3.

    https://github.com/DevBoost/EMFText.

  4. 4.

    https://github.com/PaulAtTUBS/BroT/tree/master/Evaluation/Encodings.

References

  1. Apel, S., Batory, D., Kästner, C., Saake, G.: Feature-Oriented Software Product Lines (2013)

    Google Scholar 

  2. Bailleux, O., Boufkhad, Y.: Efficient CNF encoding of boolean cardinality constraints. In: Rossi, F. (ed.) CP 2003. LNCS, vol. 2833, pp. 108–122. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45193-8_8

    Chapter  MATH  Google Scholar 

  3. Batory, D.: Feature models, grammars, and propositional formulas. In: Obbink, H., Pohl, K. (eds.) SPLC 2005. LNCS, vol. 3714, pp. 7–20. Springer, Heidelberg (2005). https://doi.org/10.1007/11554844_3

    Chapter  Google Scholar 

  4. Benavides, D., Segura, S., Ruiz-Cortés, A.: Automated analysis of feature models 20 years later: a literature review. Inf. Syst. 35(6), 615–708 (2010)

    Article  Google Scholar 

  5. Chen, J.: A new SAT encoding of the at-most-one constraint. In: Proceedings of the Constraint Modelling and Reformulation (2010)

    Google Scholar 

  6. Czarnecki, K., Helsen, S., Eisenecker, U.: Formalizing cardinality-based feature models and their specialization. Softw. Process: Improv. Pract. 10, 7–29 (2005)

    Article  Google Scholar 

  7. Czarnecki, K., Kim, C.H.P.: Cardinality-based feature modeling and constraints: a progress report, pp. 16–20 (2005)

    Google Scholar 

  8. Frisch, A.M., Giannaros, P.A.: SAT encodings of the at-most-k constraint. some old, some new, some fast, some slow. In: Proceedings of the Ninth International Workshop of Constraint Modelling and Reformulation (2010)

    Google Scholar 

  9. Frisch, A.M., Peugniez, T.J.: Solving non-boolean satisfiability problems with stochastic local search. In: IJCAI, vol. 2001, pp. 282–290 (2001)

    Google Scholar 

  10. Frisch, A.M., Peugniez, T.J., Doggett, A.J., Nightingale, P.W.: Solving non-boolean satisfiability problems with stochastic local search: a comparison of encodings. J. Autom. Reason. 35(1–3), 143–179 (2005). https://doi.org/10.1007/s10817-005-9011-0

    Article  MathSciNet  MATH  Google Scholar 

  11. Günther, T.: Explaining satisfiability queries for software product lines. Master’s thesis, Braunschweig (2017). https://doi.org/10.24355/dbbs.084-201711171100. https://publikationsserver.tu-braunschweig.de/receive/dbbs_mods_00065308

  12. Klieber, W., Kwon, G.: Efficient CNF encoding for selecting 1 from n objects. In: Proceedings of the International Workshop on Constraints in Formal Verification (2007)

    Google Scholar 

  13. Krieter, S., et al.: FeatureIDE: empowering third-party developers, pp. 42–45 (2017). https://doi.org/10.1145/3109729.3109751

  14. Krieter, S., Thüm, T., Schulze, S., Schröter, R., Saake, G.: Propagating configuration decisions with modal implication graphs, pp. 898–909, May 2018. https://doi.org/10.1145/3180155.3180159

  15. Kučera, P., Savický, P., Vorel, V.: A lower bound on CNF encodings of the at-most-one constraint. In: Gaspers, S., Walsh, T. (eds.) SAT 2017. LNCS, vol. 10491, pp. 412–428. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66263-3_26

    Chapter  MATH  Google Scholar 

  16. Mannion, M.: Using first-order logic for product line model validation, pp. 176–187 (2002)

    Google Scholar 

  17. Meinicke, J., Thüm, T., Schröter, R., Benduhn, F., Leich, T., Saake, G.: Mastering Software Variability with FeatureIDE. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-61443-4

    Book  Google Scholar 

  18. Mendonça, M.: Efficient reasoning techniques for large scale feature models. Ph.D. thesis, University of Waterloo, Canada (2009)

    Google Scholar 

  19. Sinz, C.: Towards an optimal CNF encoding of boolean cardinality constraints. In: van Beek, P. (ed.) CP 2005. LNCS, vol. 3709, pp. 827–831. Springer, Heidelberg (2005). https://doi.org/10.1007/11564751_73

    Chapter  MATH  Google Scholar 

  20. Thüm, T., Apel, S., Kästner, C., Schaefer, I., Saake, G.: Analysis strategies for software product lines: a classification and survey, pp. 57–58, Gesellschaft für Informatik (GI), Bonn, Germany, March 2015

    Google Scholar 

  21. Wiegand, J., et al.: Eclipse: a platform for integrating development tools. IBM Syst. J. 43(2), 371–383 (2004)

    Article  Google Scholar 

Download references

Acknowledgements

We thank Moritz Kappel, Chico Sundermann, Timo Günther, Marc Kassubeck, Jan-Philipp Tauscher, and Moritz Mühlhausen for reviewing our paper in the earlier stages. Additional thanks go to the SEFM reviewers for giving very detailed and constructive remarks.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paul Maximilian Bittner .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bittner, P.M., Thüm, T., Schaefer, I. (2019). SAT Encodings of the At-Most-k Constraint. In: Ölveczky, P., Salaün, G. (eds) Software Engineering and Formal Methods. SEFM 2019. Lecture Notes in Computer Science(), vol 11724. Springer, Cham. https://doi.org/10.1007/978-3-030-30446-1_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-30446-1_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-30445-4

  • Online ISBN: 978-3-030-30446-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics