Question: Prove this in Induction step 1. (10 points) Let Simple Tree be the inductive set defined by the following construc- tors: a. Leaf : N

 Prove this in Induction step 1. (10 points) Let Simple Tree

Prove this in Induction step

1. (10 points) Let Simple Tree be the inductive set defined by the following construc- tors: a. Leaf : N Simple Tree. b. Branch1 : Simple Tree Simple Tree. c. Branch2 : Simple Tree x Simple Tree Simple Tree. The function leaves : Simple Tree N is defined by recursion and pattern matching as: a. leaves(Leaf(n)) = 1. b. leaves (Branchi(t)) = leaves(t). c. leaves(Branch2(t1, t2)) = leaves(ti) + leaves(t2). The function branches : Simple Tree + N is defined by recursion and pattern matching as: a. branches(Leaf(n)) = 0. b. branches(Branchi(t)) = 1 + branches(t). c. branches(Branch2(t, t2)) = 1 + branches(ti) + branches(t2). Prove that, for all t e Simple Tree, leaves(t)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!