Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

dea 2 . 1 5 An inductive definition of a set S consists of BASIS :: a list of some ( at least one )

dea 2.15 An inductive definition of a set S consists of
BASIS :: a list of some (at least one) elements BsubeS,
IND. :: one or more rules to construct new elements of S from already
existing elements,
CLSR. :: the statement that S contains only the elements obtained from
the basis by the induction steps.
Saying that something is defined by induction, the closure condition be
comes implicitly assumed and is not stated.
-----------
Exercise 2
(a) Define APIs as I=(:T,F:),T is some set of type names and every (f:t1dotstkt)inF being a
function declaration with arguments t1,dots,tkinT and result tinT. A function with 0 arguments
is called a constant. Let V be a set of variable names typed by a function type : VT.
Define the set EI,V,t of type correct expressions of type t for interface I and variables V. The base
case are the variables of type t and all constants of type t. The constructors are the non-constant
functions of type t. Note that the inductive case will need to depend on the set of expressions for
each of the argument types of the constructors.
To make this work, you need to modify Idea 2.15(inductive definition of a set).
(b) Consider the inductive constructors ?1 for a linked list over a set S :
Define an API for this data type. We can treat the set S as a set of variables and define the
inductive set of list expressions on S.
(c) Consider the inductive constructors for a binary tree:
\langle\rangle : Tree S
Branch(L,s,R): Tree SS Tree S Tree S
Define an API for this data type. We can treat the set S as a set of variables and define the
inductive set of list expressions on S.
(d) Show that for ninN and the set B, the indexed sets
)n
are equivalent to the APIs and inductive definitions of lists and trees.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

b. What groups were most represented? Why do you think this is so?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago

Question

5. Identify and describe nine social and cultural identities.

Answered: 1 week ago