Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

18. [5 points] Give a BNF grammar for each of the following language: the set of all strings consisting of odd number of concatenated copies

image text in transcribed
18. [5 points] Give a BNF grammar for each of the following language: the set of all strings consisting of odd number of concatenated copies of the string "abc 19. [5 points] write an ML function red3 of type , a , c that converts a * 'b , c-> , a with three elements into one with two by eliminating the second element. * * 20. [5 points] Write an ML function thirds of type string -> char that returns the third character of a string. 21. [10 points] Write an ML recursive function pow of type real int -> real that raises a real number to an integer power. 22. [10 points] Write an ML recursive functionlistProduct of type int list -> int to calculate the product of all elements in a list. 23. [10 points] Write an ML function min of type int list ->int that returns the smallest element of a list of integers. Hint: write a helper function element seen so far. Then you can complete the exercise by defining minhelper that takes as a second parameter the smallest fun min x minhelper (tl x, hd x)

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_2

Step: 3

blur-text-image_3

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

3. Contrast relational contexts in organizations

Answered: 1 week ago

Question

2. Describe ways in which organizational culture is communicated

Answered: 1 week ago

Question

1. Describe and compare approaches to managing an organization

Answered: 1 week ago