LogicAssignment

Objective: In this assignment, you have to implement the construction of a parse tree for a propositional logic formula. You can assume that the formula is well formed and fully parenthesized. The input to your program should be a propositional logical formula in infix notation. The connective symbols you will use for this assignment is as follows.

  1. "~" for negation
  2. "+"for OR
  3. "*" for AND
  4. ">" for implication.

Your code should have separate functions to perform the given tasks.

Task 1: Write a function to convert the infix propositional logic expression into a postfix propositional logic expression. [5]

Task 2: Write a function to convert the postfix expression into a rooted binary parse tree. [5]

Task 3: Write a function to traverse the parse tree to output the infix expression back by in-order traversal of the parse tree.