Many-valued logics and the logic of the C programming language

Benedek Nagy · 2005

In this paper we analyse the logic of the programming language C, where integers used as logical values. The logic has several axiom-systems, the oldest one is the axioms of the Boolean-algebra. We analyse how logical laws work in C. We also compare some many-valued systems to the logic of C. We show that the logic of C is not two-valued logic, neither a classical many-valued logic. The commutative laws are not justified for all cases, because of the lazy evaluation of conditions. The problem occurs when an evaluation in a condition can produce error message. We present a three-valued non-commutative logic describing the logic of C.

Read the paper · More papers on PaperTik