maude-help AT lists.siebelschool.illinois.edu
Subject: Maude-help mailing list
List archive
- From: "Francesoc Bongiovanni" <bongiovanni AT gmail.com>
- To: maude-help AT lists.cs.illinois.edu
- Subject: [[Maude-help] ] ambiguous parsing
- Date: Wed, 13 Apr 2016 07:39:44 -0500
Hello,
I am stuck with some piece of Maude code and I am circling aroung it.
I basically coded the Pearson Correlation Coefficient function in Maude,
and came up with this bit of code :
op sizeOf : List{Float} -> Float .
eq sizeOf(F1) = 1.0 .
eq sizeOf(F1 V1) = (1.0 + sizeOf(V1)) .
op sumAB : List{Float} List{Float} -> Float .
eq sumAB(V1,V2) = foldl plusF 0.0 (zipWith plusF V1 V2) .
op sumA : List{Float} -> Float .
eq sumA(V1) = foldl plusF 0.0 V1 .
op sumOfSquare : List{Float} -> Float .
eq sumOfSquare(V1) = foldl plusF 0.0 (map square V1) .
op num : List{Float} List{Float} -> Float .
eq num(V1,V2) = ( ( sumAB(V1,V2) * sizeOf(V1) ) - ( sumA(V1) *
sumA(V2) ) ) .
I ll spare you the denum part.
When I try to load the module containing the op, in Full-Maude, it gives me
the following error :
Warning: Ambiguous parsing for (num(V1,V2))=(((sumAB(V1,V2)* sizeOf(V1))-
(sumA(V1)* sumA(V2))))
Error: no parse for eq num(V1,V2) = ((sumAB(V1,V2)* sizeOf(V1))-(sumA(V1)*
sumA(V2)))
Warning: Ambiguous parsing for (num(V1,V2))=(((sumAB(V1,V2)* sizeOf(V1))-
(sumA(V1)* sumA(V2))))
Error: no parse for eq num(V1,V2) = ((sumAB(V1,V2)* sizeOf(V1))-(sumA(V1)*
sumA(V2)))
When I change the `-` sign with a `+` sign the error goes away...I dont really
get it...how do I keep the minus sign without that error ?
Thanks for your insights !
- Francesco
- [[Maude-help] ] ambiguous parsing, Francesoc Bongiovanni, 04/13/2016
- Re: [[Maude-help] ] ambiguous parsing, Paco DurĂ¡n, 04/13/2016
Archive powered by MHonArc 2.6.16.