(****************************************************************)

Definition half_adder_sum (a b : bool) := xorb a b.Definition half_adder_carry (a b : bool) := a && b.

(* Specifications: *)
Lemma half_adder_sum_sym : forall a b : bool, half_adder_sum a b = half_adder_sum b a.
Lemma half_adder_carry_sym : forall a b : bool, half_adder_carry a b = half_adder_carry b a.
Lemma half_adder_sum_false : forall a : bool, half_adder_sum a false = a.
Lemma half_adder_carry_false : forall a : bool, half_adder_carry a false = false.
Lemma half_adder_sum_true : forall a : bool, half_adder_sum a true = negb a.
Lemma half_adder_carry_true : forall a : bool, half_adder_carry a true = a.
Theorem half_adder_ok : forall a b : bool, bool_to_nat (half_adder_sum a b) + (bool_to_nat (half_adder_carry a b) + bool_to_nat (half_adder_carry a b)) = bool_to_nat a + bool_to_nat b.