# I need simple boolean expressions optimizer in python PLY

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',

'~a',

'~0': '1',

'~1': '0',

'~~~~a': 'a',

'~~~~1': '1',

'(((a)))': 'a'

Beceriler: Algoritma, C Programlama, Çevirmen, Java, Python

İşveren Hakkında:
( 0 değerlendirme ) Biała, Poland

Proje NO: #19362648

## Seçilen:

carbotaniuman

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.

%selectedBids___i_period_sub_7% gün içinde 23%project_currencyDetails_sign_sub_9% %project_currencyDetails_code_sub_10%
(2 Değerlendirme)
1.6

## Bu iş için 3 freelancer ortalamada €49 teklif veriyor

TalAkerele

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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% EUR
(26 Değerlendirme)
5.0
susanna2018

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

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% EUR
(15 Değerlendirme)
4.4