Stream: Beginner Questions

Topic: commutative monoid solver?


view this post on Zulip Jason Hu (Sep 01 2022 at 19:25):

Hi, I am wondering if there is a decision procedure for deciding whether two expressions from the same commutative monoid are equal? in a sense, it is also a permutation decision procedure. if not, how do I write such procedure?

view this post on Zulip Manuel Eberl (Sep 01 2022 at 20:03):

What is your setting here? Are you using a typeclass like comm_monoid_mult or are you in HOL-Algebra?

view this post on Zulip Manuel Eberl (Sep 01 2022 at 20:04):

In either case, isn't this decidable simply be adding the ac rules (associativity and commutativity) and the neutral element rules to the simp set and running the simplifier?

view this post on Zulip Jason Hu (Sep 02 2022 at 01:28):

is that this easy? the simplifier can solve this?

view this post on Zulip Mathias Fleury (Sep 02 2022 at 07:26):

yes: the simplifer (with AC) will reorder terms in canonical form (getting a + b + c + ... where a is larger (for a certain order) than b, itself larger than c and so one). So something like simp add: ac_simps or similar should work

view this post on Zulip Manuel Eberl (Sep 02 2022 at 16:49):

Or just simp add: algebra_simps.


Last updated: Dec 21 2024 at 16:20 UTC