maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: Francisco Durán <duran AT lcc.uma.es>
- To: Mandy Martin <tesleft AT hotmail.com>
- Cc: "maude-help AT cs.uiuc.edu" <maude-help AT cs.uiuc.edu>
- Subject: Re: [Maude-help] how to use the traditional polynomials example in manual
- Date: Fri, 12 Jun 2015 09:41:39 +0200
- List-archive: <http://lists.cs.uiuc.edu/pipermail/maude-help/>
- List-id: <maude-help.cs.uiuc.edu>
Mandy,
What is X suppose to be? A variable? The only X I can see is the label of one of the parameters. The terms to be rewritten should be ground, but you can still use variables, but need to be in the module, or defined on the fly, something like X:Ring.
Cheers,
Paco
On 11/6/2015, at 20:51, Mandy Martin <tesleft AT hotmail.com> wrote:_______________________________________________Maude> rew in MYPOLY : X + X . Warning: <standard input>, line 60: bad token X. Warning: <standard input>, line 60: no parse for term.Hi,
fth TRIV is sort Elt . endfth fth RING is sort Ring . ops z e : -> Ring . op _+_ : Ring Ring -> Ring [assoc comm id: z] . op _*_ : Ring Ring -> Ring [assoc comm id: e] . op -_ : Ring -> Ring . vars A B C : Ring . eq A + (- A) = z [nonexec] . eq A * (B + C) = (A * B) + (A * C) [nonexec] . endfth fmod MONOMIAL{X :: TRIV} is protecting NAT . sorts Pow{X} Mon{X} . subsorts Pow{X} < Mon{X} . *** multiplication op __ : Mon{X} Mon{X} -> Mon{X} [assoc comm] . op _^_ : X$Elt NzNat -> Pow{X} . var X : X$Elt . vars N M : NzNat . eq (X ^ N) (X ^ M) = X ^ (N + M) . endfm fmod POLYNOMIAL{R :: RING, X :: TRIV} is protecting MONOMIAL{X} . sorts Poly{R, X} . subsorts R$Ring < Poly{R, X} . *** multiplication op __ : Poly{R, X} Poly{R, X} -> Poly{R, X} [assoc comm] . *** addition op _++_ : Poly{R, X} Poly{R, X} -> Poly{R, X} [assoc comm] . op --_ : Poly{R, X} -> Poly{R, X} . op __ : R$Ring Mon{X} -> Poly{R, X} . vars A B : R$Ring . vars U V : Mon{X} . vars P Q R : Poly{R, X} . eq P ++ z = P . eq P ++ (-- P) = z . eq P e = P . eq -- (P ++ Q) = (-- P) ++ (-- Q) . eq -- (A U) = (- A) U . eq P (Q ++ R) = (P Q) ++ (P R) . eq z U = z . eq z P = z . eq A (B U) = (A B) U . eq (A U) ++ (B U) = (A ++ B) U . eq (A U) (B V) = (A B) (U V) . eq A B = A * B . eq A ++ B = A + B . endfm fmod MYPOLY is inc POLYNOMIAL{RING, TRIV2PACKET} . endfm rew in MYPOLY : X + X
Regards,
Martin Lee
Maude-help mailing list
Maude-help AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/maude-help
- [Maude-help] how to simulate this natural numbers system, Mandy Martin, 06/10/2015
- Re: [Maude-help] how to simulate this natural numbers system, Mandy Martin, 06/10/2015
- Re: [Maude-help] how to simulate this natural numbers system, Mandy Martin, 06/10/2015
- [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/11/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Francisco Durán, 06/12/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/12/2015
- [Maude-help] how to use predicates.maude in Igor2.3 and how to get the result from Rewrite Result, Mandy Martin, 06/12/2015
- [Maude-help] bad token ^ when using default code in prelude.maude and redefine again, Mandy Martin, 06/14/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/13/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/13/2015
- [Maude-help] why minus result is wrong and how to return understandable result from haskell maude, Mandy Martin, 06/13/2015
- [Maude-help] how to use predicates.maude in Igor2.3 and how to get the result from Rewrite Result, Mandy Martin, 06/12/2015
- [Maude-help] why sign of two terms exchanged in minus case, Mandy Martin, 06/13/2015
- Re: [Maude-help] why sign of two terms exchanged in minus case, Mandy Martin, 06/13/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/12/2015
- Re: [Maude-help] how to use the traditional polynomials example in manual, Francisco Durán, 06/12/2015
- [Maude-help] how to use the traditional polynomials example in manual, Mandy Martin, 06/11/2015
- Re: [Maude-help] how to simulate this natural numbers system, Mandy Martin, 06/10/2015
- Re: [Maude-help] how to simulate this natural numbers system, Mandy Martin, 06/10/2015
Archive powered by MHonArc 2.6.16.