mercredi 8 avril 2020

Generating random boolean expression using a grammar in python [closed]

I have the grammar rules, i need to generate random expressions using that in python.

Grammar rules :

E -> Value

E -> ( E & E ) | ( E | E ) | ( E ^ E )

can anyone help with any kind of python script for generating random expressions from the grammar above. And value can be anything ,for now just use value as it is in the expression.




Aucun commentaire:

Enregistrer un commentaire