Startseite › Forschung › ProjekteLog4KR


Log4KR is a Java library providing algorithms and data structures for logic-based knowledge representation. Even though most data types are quite general and can be used for different frameworks, the main focus of Log4KR is on probabilistic (conditional) logics.

You can use Log4KR's parsers and data types to design propositional and relational probabilistic knowledge bases as considered, for instance, in [Nilsson, 1986],[Paris, 1994],[Kern-Isberner, 2001],[Kern-Isberner and Thimm, 2010],[Beierle et al., 2011],[Fisseler, 2012]. Given a knowledge base you can perform different reasoning operations. You can test consistency, perform probabilistic entailment [Nilsson, 1986],[Hansen and Jaumard, 2000] or reason with best models like the one maximizing entropy [Paris, 1994] or minimizing relative entropy to a given prior [Kern-Isberner, 2001]. All implementations work for the whole family of linearly structured logics [Potyka, 2012],[Potyka et al., 2015], which basically means that the semantics of probabilistic rules in these logics can be expressed by linear constraint functions that have a simple logical structure.

To analyze inconsistent knowledge bases, Log4KR includes implementations of MinimalViolationMeasures [Potyka, 2014], a family of probabilistic inconsistency measures. Please consult [Grant and Hunter, 2008], [Hunter and Konieczny, 2008] and [Thimm, 2013] for more informations on on inconsistency measures in general. To reason with inconsistent knowledge bases, Log4KR contains implementations of generalized probabilistic entailment [Potyka and Thimm, 2015].

Download and Orientation

The current source code of Log4KR, along with several file and programming examples is publicly available in the SVN repository


Log4KR's working directory can be found in the directory /Software/Log4KR/trunk. The easiest way to get familiar with Log4KR, is to look at some examples.

The directory fileExamples contains several propositional and relational examples for knowledge bases in Log4KR's text format. To learn how to reason with these knowledge bases, you should look at the source examples.

The directory sourceExamples contains many examples how to reason with knowledge bases, either defined in text files or by Lok4KR's data types. All packages containing reasoning examples for probabilistic logics have the prefix The subpackage reasoning contains examples to reason with optimum entropy models. Examples for probabilistic entailment can be found in the subpackage reasoning.entailment. The subpackages inconsistency.measure and inconsistency.reasoning contain examples for measuring inconsistency and for reasoning with inconsistent knowledge bases.

To learn more, you might also want to look at some unit tests, which can be found in the directory test. The source code can be found in src


If there are any questions left or if you noticed any bugs, please send an email to Nico Potyka.


[Beierle et al., 2011] Beierle, C., Finthammer, M., Kern-Isberner, G., and Thimm, M. (2011). Evaluation and comparison criteria for approaches to probabilistic relational knowledge representation. In Bach, J. and Edelkamp, S., editors, KI 2011, volume 7006 of LNCS, pages 63–74. Springer.

[Fisseler, 2012] Fisseler, J. (2012). First-order probabilistic conditional logic and maximum entropy. Logic Journal of the IGPL, 20(5):796–830.

[Grant and Hunter, 2008] Grant, J. and Hunter, A. (2008). Analysing inconsistent firstorder knowledgebases. Artificial Intelligence, 172(8-9):1064–1093.

[Hunter and Konieczny, 2008] Hunter, A. and Konieczny, S. (2008). Measuring inconsistency through minimal inconsistent sets. In Brewka, G. and Lang, J., editors, Proc. Principles of Knowledge Representation and Reasoning, KR 2008, pages 358–366. AAAI Press.

[Hansen and Jaumard, 2000] Hansen, P. and Jaumard, B. (2000). Probabilistic satisfiability. In Kohlas, J. and Moral, S., editors, Handbook of Defeasible Reasoning and Uncertainty Management Systems, volume 5 of Handbook of Defeasible Reasoning and Uncertainty Management Systems, pages 321–367. Springer Netherlands.

[Kern-Isberner, 2001] Kern-Isberner, G. (2001). Conditionals in nonmonotonic reasoning and belief revision. Springer, Lecture Notes in Artificial Intelligence LNAI 2087.

[Kern-Isberner and Thimm, 2010] Kern-Isberner, G. and Thimm, M. (2010). Novel semantical approaches to relational probabilistic conditionals. In Lin, F., Sattler, U., and Truszczynski, M., editors, Proceedings Twelfth International Conference on the Principles of Knowledge Representation and Reasoning, KR’2010, pages 382–391. AAAI Press.

[Nilsson, 1986] Nilsson, N. J. (1986). Probabilistic logic. Artificial Intelligence, 28:71–88.

[Paris, 1994] Paris, J. (1994). The uncertain reasoner’s companion – A mathematical perspective. Cambridge University Press.

[Potyka, 2012] Potyka, N. (2012). Towards a general framework for maximum entropy reasoning. In Proc. FLAIRS-2012, pages 555–560. AAAI Press, Menlo Park, California.

[Potyka, 2014] Potyka, N. (2014). Linear programs for measuring inconsistency in probabilistic logics. In Proceedings KR 2014. AAAI Press.

[Potyka et al., 2015] Potyka, N., Beierle, C., and Kern-Isberner, G. (2015). A concept for the evolution of relational probabilistic belief states and the computation of their changes under optimum entropy semantics. Journal of Applied Logic. (to appear).

[Potyka and Thimm, 2015] Potyka, N. and Thimm, M. (2015). Probabilistic reasoning with inconsistent beliefs using inconsistency measures. International Joint Conference on Artificial Intelligence 2015 (IJCAI’15) (to appear).

[Thimm, 2013] Thimm, M. (2013). Inconsistency measures for probabilistic logics. Artificial Intelligence, 197:1–24.