You can see what is happening by ")set message bottom on". It seems to try various type conversions (involving polynomial types) and fail eventually.
There are other places where a correct program needs long time to type check. In that case, adding additional explicit type hints/conversion helps. - Qian On 1/5/20 6:53 AM, Kurt Pagani wrote: > I've been confronted with the following oddness when accidentally a > wrong entry (i.e. 1 instead of a symbol) is used: > > (1) -> foo(L:List Symbol):OutputForm == first [outputForm(s)$OutputForm > for s in L] > > (2) -> foo [a,b,c,1] > Compiling function foo with type List(Symbol) -> OutputForm > Conversion failed in the compiled user function foo . > > Cannot convert the value from type List(Polynomial(Integer)) to List > (Symbol) . > > (4) -> foo [a,b,c,d,e,1] > Conversion failed in the compiled user function foo . > > Cannot convert the value from type List(Polynomial(Integer)) to List > (Symbol) . > > (5) -> foo [a,b,c,d,e,f,1] > Conversion failed in the compiled user function foo . > > Cannot convert the value from type List(Polynomial(Integer)) to List > (Symbol) . > > time needed grows exponentially with the length of the list !? > foo [a,b,c,d,e,f,g,1] hangs already ... > > This is an isolated example. The same occurs whether compiled or > interpreted (as below). > What's going on? > > --- same > > foo.spad > )abbrev domain FOO foo > foo() : Exports == Implementation where > Exports == with > mkfoo : Integer -> % > dsp: (%,List Symbol) -> OutputForm > Implementation == Integer add > Rep := Integer > mkfoo(x:Integer) == x@% > dsp(x:%,il:List Symbol):OutputForm == > l:List OutputForm := [outputForm(s)$OutputForm for s in il] > first l > > Example: dsp(5,[a,b,c,d,s,r]) > > foo.input: > dsp(x:Integer,il:List Symbol):OutputForm == > l:List OutputForm := [outputForm(s)$OutputForm for s in il] > first l > > Example: dsp(5,[a,b,c,d,5,5,t,s,r,s,s,s,s]) (killed after 1h) > > Thanks > Kurt > > -- > 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 [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/fricas-devel/a9c97164-5fce-499b-a951-8cea68846b6f%40googlegroups.com > <https://groups.google.com/d/msgid/fricas-devel/a9c97164-5fce-499b-a951-8cea68846b6f%40googlegroups.com?utm_medium=email&utm_source=footer>. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/3df8914f-6e22-fc83-c121-244ef3a43dc3%40gmail.com.
