Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

OCAML PLEASE ONLY ANSWER IF YOU ARE KNOWLEDGEABLE IN THIS AREA. I AM SICK OF GETTING WRONG ANSWERS. 1. Consider the grammar below for formulas

OCAML PLEASE ONLY ANSWER IF YOU ARE KNOWLEDGEABLE IN THIS AREA. I AM SICK OF GETTING WRONG ANSWERS.

image text in transcribed

1. Consider the grammar below for formulas of propositional logic, where the set of terminals is {T, F,p, q, T, s, Pl, P2, ..J and the set of non-terminals is {F, P) Formulas in this language can be represented in OCaml using the following data structure similar to one used in a previous assignment: type propstring type form - | True | False | Prop of prop | And of form fornm | Or of form form | Imp of form * form | Neg of form (a) Complete the following OCaml function (in the file a4.ml). Your program must convert the input argument of type form to a string representing the corresponding formula in correct syntax according to the above grammar. (Use the lowercase letter v for V and use the hat symbol ^ for let pretty-print-form (f:form) string = rec : 1. Consider the grammar below for formulas of propositional logic, where the set of terminals is {T, F,p, q, T, s, Pl, P2, ..J and the set of non-terminals is {F, P) Formulas in this language can be represented in OCaml using the following data structure similar to one used in a previous assignment: type propstring type form - | True | False | Prop of prop | And of form fornm | Or of form form | Imp of form * form | Neg of form (a) Complete the following OCaml function (in the file a4.ml). Your program must convert the input argument of type form to a string representing the corresponding formula in correct syntax according to the above grammar. (Use the lowercase letter v for V and use the hat symbol ^ for let pretty-print-form (f:form) string = rec

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions