Discussion:
[fricas-devel] ncpoly -- "map" problem
Raymond Rogers
2018-06-20 17:35:44 UTC
Permalink
If anybody is running the ncpoly/non-commuting code:
While familiarizing myself with the coding and theory, I have run into a
simple syntax problem.
I have attached the changed files and the problem code is in (?)
test.input
The function factor_test() stalls on the "map()" line; whereas when I do
the same things manually

#map(rank,f_12)
for i in 1..n repeat m:=m*(fct_12(i)::XDP)

works fine.

In particular
-- Factor test
--
--
factor_test : (XDP,LIST(NCP))-> BOOLEAN
factor_test(x::XDP , y::LIST(NCP))  ==
 m:=1::XDP;
 n:=#map(rank,y)
 for i in 1..n repeat m:=m*(y(i)::XDP)
 test(x = m)
--
Which was supposed to automate the checking in the prior last line of
test.input

test(p_12 :: XDP = fct_12(1)::XDP * fct_12(2)::XDP)

to allow variable problem sizes
like so

factor_test(p_12::XDP,fct_12::LIST(NCP))
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Bill Page
2018-07-02 21:40:37 UTC
Permalink
Raymond,

Sorry for the delayed response. Perhaps you have already discovered
the solution.

The line:

factor_test(x::XDP , y::LIST(NCP)) ==

should actually read:

factor_test(x , y) ==

--

Bill Page.

On Wed, Jun 20, 2018 at 1:35 PM, Raymond Rogers
Post by Raymond Rogers
While familiarizing myself with the coding and theory, I have run into a
simple syntax problem.
I have attached the changed files and the problem code is in (?)
test.input
The function factor_test() stalls on the "map()" line; whereas when I do the
same things manually
#map(rank,f_12)
for i in 1..n repeat m:=m*(fct_12(i)::XDP)
works fine.
In particular
-- Factor test
--
--
factor_test : (XDP,LIST(NCP))-> BOOLEAN
factor_test(x::XDP , y::LIST(NCP)) ==
m:=1::XDP;
n:=#map(rank,y)
for i in 1..n repeat m:=m*(y(i)::XDP)
test(x = m)
--
Which was supposed to automate the checking in the prior last line of
test.input
test(p_12 :: XDP = fct_12(1)::XDP * fct_12(2)::XDP)
to allow variable problem sizes
like so
factor_test(p_12::XDP,fct_12::LIST(NCP))
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Raymond Rogers
2018-07-03 02:20:55 UTC
Permalink
Bill,  Okay that works.
Newbie question: why?  I thought I was specifying the incoming data type.
Thanks for the more extensive response earlier; although at this stage
"commit" makes me laugh :)
I will try github.

Ray
Post by Bill Page
Raymond,
Sorry for the delayed response. Perhaps you have already discovered
the solution.
factor_test(x::XDP , y::LIST(NCP)) ==
factor_test(x , y) ==
--
Bill Page.
On Wed, Jun 20, 2018 at 1:35 PM, Raymond Rogers
Post by Raymond Rogers
While familiarizing myself with the coding and theory, I have run into a
simple syntax problem.
I have attached the changed files and the problem code is in (?)
test.input
The function factor_test() stalls on the "map()" line; whereas when I do the
same things manually
#map(rank,f_12)
for i in 1..n repeat m:=m*(fct_12(i)::XDP)
works fine.
In particular
-- Factor test
--
--
factor_test : (XDP,LIST(NCP))-> BOOLEAN
factor_test(x::XDP , y::LIST(NCP)) ==
m:=1::XDP;
n:=#map(rank,y)
for i in 1..n repeat m:=m*(y(i)::XDP)
test(x = m)
--
Which was supposed to automate the checking in the prior last line of
test.input
test(p_12 :: XDP = fct_12(1)::XDP * fct_12(2)::XDP)
to allow variable problem sizes
like so
factor_test(p_12::XDP,fct_12::LIST(NCP))
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Bill Page
2018-07-03 02:46:23 UTC
Permalink
On Mon, Jul 2, 2018 at 10:20 PM, Raymond Rogers
Bill, Okay that works.
Newbie question: why? I thought I was specifying the incoming data type.
You have already specified the incoming (and outgoing) data type by writing:

factor_test : (XDP,LIST(NCP))-> BOOLEAN

Note: BOOLEAN is the "abbreviation" of the actual domain name Boolean.

But alternatively you could just include the types in the function definition:

factor_test(x:XDP , y:LIST(NCP)):Boolean ==

But you must use : not :: on the parameter. Double colon means "coerce
to type", it does not specify the type of a variable or parameter.
Thanks for the more extensive response earlier; although at this stage
"commit" makes me laugh :)
I will try github.
Think "commitment" when you read "commit". :)

Bill.
--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+***@googlegroups.com.
To post to this group, send email to fricas-***@googlegroups.com.
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
Loading...