I want to store and work (access each literal from an expression and further) on logical expressions like ((A /\\ B) / C) in python. Can anyone please suggest a data structure or a way to do it using classes. I am new to python so please explain your answer in detail.
There is a lib named sympy. Maybe you can have a try
from sympy import *
a,b,c = symbols('a b c')
(a & b) | c
Or(And(a, b), c)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.