যেমন ?
অভিব্যক্তিগুলি সাধারণ উচ্চ-বিদ্যুত বীজগণিত থেকে, তবে গাণিতিক সংযোজন এবং গুণ (যেমন ), কোনও বিপরীত, বিয়োগ বা বিভাজন ছাড়া সীমাবদ্ধ । চিঠিগুলি ভেরিয়েবল হয়।
যদি এটি সহায়তা করে তবে আমরা বাদে সংখ্যাসূচক মানগুলির সাথে উপস্থাপনযোগ্য কোনও অভিব্যক্তি নিষিদ্ধ করতে পারি; i.e. not nor nor :
- multilinear, no powers other than : is OK, but not , and not anything that could be represented as that, as in a full expansion to sum-of-products e.g. not ;
- all one, no coefficients other than : is OK, but not , and not anything that could be represented as that, as in a full expansion to sum-of-products e.g. not ; and
- no constants other than : again, in the fully expanded sum-of-products e.g. not
Is there an efficient algorithm to determine if two expressions are equivalent?
To illustrate, here's an inefficient brute-force algorithm with exponential time:
expand both expressions fully to sum-of-products, which can easily be checked for equivalence (just ignore order, since commute/associate can reorder).
e.g.
This seems a well-known problem - even high school students are taught manual ways to solve it. It's also solved by automated theorem provers/checkers, but they concentrate on more sophisticated aspects.
Here's a working online automated theorem prover: http://tryacl2.org/, which shows equivalence by finding a sequence of commute/associate/distribute etc:
?
(thm (= (+ (* x y) x y) (+ x (* y (+ x 1))) ))
--- 188 steps
?
(thm (= (+ y (* x (+ y 1))) (+ x (* y (+ x 1))) ))
--- 325 steps
This is my first question here, so please let me know if I've chosen the wrong place, wrong tags, wrong way of describing/asking etc. Thanks!
NB: this question has been rewritten in response to comments
Thanks to all responders! I've learned a lot.