Function sum of a b and carry bit c

add stack a, stack b, and carry bit c and output the sum

Format:

sum of a b and carry bit c

Input:

list a -
list b -
bit c -

Output:

list - None

Properties that reference this function:

sum of (empty list) (empty list) and carry bit 0 = empty list (Add List Carry)
sum of (empty list) (empty list) and carry bit 1 = list 1 and (empty list) (Add List Carry (2))
sum of (list x and xs) (empty list) and carry bit 0 = list x and xs (Add List Carry (3))
sum of (list 0 and xs) (empty list) and carry bit 1 = list 1 and xs (Add List Carry (4))
sum of (list 1 and xs) (empty list) and carry bit 1 = list 0 and (sum of xs (empty list) and carry bit 1) (Add List Carry (5))
sum of (empty list) (list y and ys) and carry bit 0 = list y and ys (Add List Carry (6))
sum of (empty list) (list 0 and ys) and carry bit 1 = list 1 and ys (Add List Carry (7))
sum of (empty list) (list 1 and ys) and carry bit 1 = list 0 and (sum of (empty list) ys and carry bit 1) (Add List Carry (8))
sum of (list x and xs) (list y and ys) and carry bit carry = list (sum of bit x bit y and bit carry) and (sum of xs ys and carry bit (carry on sum of bit x bit y and carry)) (Add List Carry (9))
sum of unsigned integers a and b = sum of a b and carry bit 0 (Add Unsigned Integer)
sum of x (empty list) and carry bit 0 = x (Add List Carry Property)


Comments

Please log in to add comments