Question: 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.

OCAML PLEASE ONLY ANSWER IF YOU ARE KNOWLEDGEABLE IN THIS AREA. I

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

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!