and evaluating statements without an operator. Therefore, it is safe to assume that any input

Similar to the parsing tree example in class, there is not much usefulness in parsing and evaluating statements without an operator. Therefore, it is safe to assume that any input to your parsing tree will contain an operator. Examples of valid inputs are: Example of inputs that are not expected (and that you don’t need to account for): Also, if you haven’t started, and want a clean slate to start with, use this skeleton code in MS Teams The primary tasks in this fourth assignment are to implement the following three functions. 1. buildMPLogicParseTree(s) – this function should take a string as input (e.g. s = ‘( T OR P_0.9 )’) and should return the binary tree representing the parse tree as described in class 2. evaluateMPLogicParseTree(t) – this function should take a binary tree as input and should return a T or an F that is based on the on the input state

💡 Buy the answer for only $12 Get it now →

ment 3. printMPLogicExpression(t) – this function should take a binary tree as input and should return the string that looks like the original string (perhaps with extra parentheses) 4. create some examples of how your functions work (inside of def main()), and test that each of the functions works correctly (using unittest) Also: When you submit your assignment, it will be graded in large part based on whether it successfully runs when using different input strings. The tests will roughy look like the following: Again, several different input strings will be also be tested. When an M_x or P_x is present then the test will confirm that your tree evaluates to the correct average. For example, the above input string will evaluate to T roughly 30% of the time. The symbols of our maybe-probably Boolean logic are: Some additional examples of statements in this language are:

💡 Buy the answer for only $12 Get it now →