In this project you will implement a Boolean satisfiability (SAT) solver in OCaml. The program takes as input a string representing a Boolean formula.

computer science

Description

1 Introduction 

In this project you will implement a Boolean satisfiability (SAT) solver in OCaml. The program takes as input a string representing a Boolean formula. This formula may involve constants (TRUE and FALSE) and variables (represented by lowercase letters a through z). Each variable may be either TRUE or FALSE. The program should return a list of variable assignments that make the formula true. For instance, to make (and a b) true, both “a” and “b” need to be TRUE. To make (or a b) true, there are three possible solutions, both “a” and “b” are TRUE, or “a” is TRUE, “b” is FALSE, or “b” is TRUE, “a” is FALSE. The grammar for the logical formula in our project is defined below:


1.1 Tree representation of Boolean formula 

To begin with, you will first convert the string list into a parse tree. You will write a recursive descent parser to extract the parse tree from the string list. For example, the parse tree for string list ( and ( or a b ) TRUE ) with respect to the grammar defined above is the following: 


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.