I need some program that with given input of logical expression like a:
"a * 1 * (b + c) + (1 * d + 0)"
will output an optimized form of that expression like a:
"a * (b + c) + d"
etc. Other examples at the bottom.
Parser's operators should be:
* - logical conjunction (AND)
+ - logical alternative (OR)
~ - logical negation (NOT)
(...) - expression grouping
a,b,c,d - some variable (VAR)
0, 1 - Boolean true or false (BOOL)
The parser needs to be written in python PLY generator or ANTLR in any language.
Best would be to apply the Quine-McCluskey algorithm implementation ([login to view URL]) or/and Karnough tables.
Other examples in the format: ('input_expression': 'desired_output'):
'a + 0': 'a',
'a * 1': '1',
'a * 0': '0',
'~(a + b)',
'~(a * b)',
'(a + b + c) * d',
'(a * b * c) + d',
'a * b',
'1 + 1': '1',
'0 * 1': '0',
'0 * 0': '0',
I can do this. I know Python and have worked on abstract syntax trees for a while. I'll apply the basic boolean rules and generate optimized solutions.
Bu iş için 3 freelancer ortalamada €49 teklif veriyor
Hi, I am very happy to bid your project. I read your requirements carefully,so i see what you mean. I have been experiments with Algorithm, C Programming, Interpreter, Java, Python I'd like to work with you. i'll Daha Fazla
Hi, Sir!! i am a python expert and full-stack developer with full time. @$@$@$PLEASE CONTACT ME. I CAN DO IT WONDERFULLY $@$@$@ i use tensorflow, sklearn, keras for AI, ML, pandas for Data Analaysis, sele Daha Fazla