Boolean expressions of counter programs #
Expressions of counter programs (Turing.CounterProgram.Expr) compute natural numbers. A Boolean
value b is represented by b.toNat, so comparisons, connectives, finite conjunctions and
disjunctions, and conditionals are again expressions. Each lemma below states the value of a
combinator from the values of its arguments, in the form e.eval regs = b.toNat for Boolean
results. Digits in a radix are expressions too (Turing.CounterProgram.Expr.ofDigits).
Main definitions #
Turing.CounterProgram.Expr.ltB,Turing.CounterProgram.Expr.eqB: comparisons.Turing.CounterProgram.Expr.notB,Turing.CounterProgram.Expr.andB,Turing.CounterProgram.Expr.orB,Turing.CounterProgram.Expr.allB,Turing.CounterProgram.Expr.anyB: connectives.Turing.CounterProgram.Expr.iteB: a conditional on a Boolean expression.Turing.CounterProgram.Expr.ofDigits: the number with given digits in a radix.
Main results #
Turing.CounterProgram.Expr.eval_ltB,Turing.CounterProgram.Expr.eval_eqB,Turing.CounterProgram.Expr.eval_andB, …: the values of the combinators.Turing.CounterProgram.Expr.eval_ofDigits: the value of a number given by digits.
The negation of a Boolean expression.
Instances For
The conjunction of Boolean expressions.
Instances For
The disjunction of Boolean expressions.
Instances For
The conjunction of a list of Boolean expressions.
Instances For
The disjunction of a list of Boolean expressions.
Instances For
The value of a if the Boolean expression c holds, of b otherwise.