Hey guys.
I need help with developing an algorithm, and I post here because I know it is not that easy (at least I can not come up with a good solution)
Say you got a Formula F = A & B & (C | D) .. where "&" is AND, and "|" is OR.
What I wanna do, Is creating multiple Formulas which will be connected by disjunction, that means for the formula above:
F1 = A & B & C
F2 = A & B & D
--> F1 | F2
Which is also called "Conjunctive Normal Form".
In my case, the parts of this CNF-Formula represent Initial States/Values of a Procedure
Functions I already created/used during my project and that could come in handy i guess:
- Conversion of a Formula into an array, splitted on operators e.g. "x = 3" --> ["x","=","3"]
- Conversion of a Formula in Infix notation to Postfix notation, this fucntion also regards oparator precedence. e.g. "x = 3" --> x 3 =
I don't want full solutions at all, I'm happy with ideas, probably someone has done something like that before
I will post ideas if I come up with something^^
Kind Regards,
Bree