Answered step by step
Verified Expert Solution
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.
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 = recStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started