abstract-algebra

How to use Z3 SMT-LIB to prove theorems in Frobenius Algebras

时光怂恿深爱的人放手 提交于 2019-12-22 09:28:34
问题 We prove the following theorem in Frobenius Algebras The proof is performed using the following code ;; Frobenius algebra object (A,mu,eta,delta, epsilon) (declare-sort A) (declare-sort AA) (declare-sort A_AA) (declare-sort AA_A) (declare-sort I) (declare-sort I_A) (declare-sort A_I) (declare-fun alpha (AA_A) A_AA) (declare-fun inv_alpha (A_AA) AA_A) (declare-fun mu (AA) A) (declare-fun eta (I) A) (declare-fun mu_id (AA_A) AA) (declare-fun id_mu (A_AA) AA) (declare-fun eta_id (I_A) AA)

Structurally enforced Free Alternative, without left distributivity

点点圈 提交于 2019-12-21 03:34:08
问题 There is a nice Free Alternative in the great free package, which lifts a Functor to a left-distributive Alternative. That is, the claim is that: runAlt :: Alternative g => (forall x. f x -> g x) -> Alt f a -> g a is an Alternative homomorphism , with liftAlt . And, indeed, it is one, but only for left-distributive Alternative instances. Of course, in reality, very few Alternative instances are actually left-distributive. Most of the alternative instances that actually matter (parsers, MaybeT

Commutative monoid from 'algebra' package on Hackage

China☆狼群 提交于 2019-12-07 03:30:40
问题 The documentation for algebra/2.1.1.2/doc/html shows a colossal number of type classes. How do I declare that a structure in question must be equipped with a commutative associative operation and a unit/identity element, but without anything else (inverses, distributivity etc)? I'm thinking of reduce :: Monoid m => (a -> m) -> [a] -> m but instances of Data.Monoid are not supposed to be commutative and I want users of my function to see that they need commutativity for the function to work by

How to use Z3 SMT-LIB to prove theorems in Frobenius Algebras

眉间皱痕 提交于 2019-12-05 18:52:38
We prove the following theorem in Frobenius Algebras The proof is performed using the following code ;; Frobenius algebra object (A,mu,eta,delta, epsilon) (declare-sort A) (declare-sort AA) (declare-sort A_AA) (declare-sort AA_A) (declare-sort I) (declare-sort I_A) (declare-sort A_I) (declare-fun alpha (AA_A) A_AA) (declare-fun inv_alpha (A_AA) AA_A) (declare-fun mu (AA) A) (declare-fun eta (I) A) (declare-fun mu_id (AA_A) AA) (declare-fun id_mu (A_AA) AA) (declare-fun eta_id (I_A) AA) (declare-fun id_eta (A_I) AA) (declare-fun lambda (I_A) A) (declare-fun rho (A_I) A) (declare-fun delta (A)

Structurally enforced Free Alternative, without left distributivity

只谈情不闲聊 提交于 2019-12-03 10:44:44
There is a nice Free Alternative in the great free package, which lifts a Functor to a left-distributive Alternative. That is, the claim is that: runAlt :: Alternative g => (forall x. f x -> g x) -> Alt f a -> g a is an Alternative homomorphism , with liftAlt . And, indeed, it is one, but only for left-distributive Alternative instances. Of course, in reality, very few Alternative instances are actually left-distributive. Most of the alternative instances that actually matter (parsers, MaybeT f for most Monad f, etc.) are not left-distributive. This fact can be shown by an example where runAlt