login  home  contents  what's new  discussion  bug reports help  links  subscribe  changes  refresh  edit

Consider the following function, given in recursive manner:

fricas
N0(t|(t<0) or (t>1))==0
Type: Void
fricas
N0(t|(t>=0) and (t<=1))==1
Type: Void
fricas
N(t,i,0)==N0(t-i)
Type: Void
fricas
N(t,i,p|p>0)==(t-i)/p*N(t,i,p-1)+(i+1-t)/p*N(t,i+1,p-1)
Type: Void

This is a way to create (uniform) bsplines. Now try to differentiate fricas
D(N(t,0,3),t)
There are 3 exposed and 1 unexposed library operations named <
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op <
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named <
with argument type(s)
Polynomial(Integer)
NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op < to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.
FriCAS will attempt to step through and interpret the code.
There are 3 exposed and 1 unexposed library operations named <
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op <
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named <
with argument type(s)
Polynomial(Integer)
NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need. Yack!!! This is obviously wrong! The map is continuous and is not constant, despite what Axiom seems to claim here. fricas N(t,0,3) There are 3 exposed and 1 unexposed library operations named < having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op < to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named < with argument type(s) Polynomial(Integer) NonNegativeInteger Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.
FriCAS will attempt to step through and interpret the code.
There are 3 exposed and 1 unexposed library operations named <
having 2 argument(s) but none was determined to be applicable.
Use HyperDoc Browse, or issue
)display op <
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named <
with argument type(s)
Polynomial(Integer)
NonNegativeInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need. On the other hand the function is not constant. See this: fricas N0(t|(t<0) or (t>1))==0; Compiled code for N0 has been cleared. Compiled code for N has been cleared. 1 old definition(s) deleted for function or rule N0 Type: Void fricas N0(t|(t>=0) and (t<=1))==1; 1 old definition(s) deleted for function or rule N0 Type: Void fricas N(t,i,0)==N0(t-i); 1 old definition(s) deleted for function or rule N Type: Void fricas N(t,i,p|p>0)==(t-i)/p*N(t,i,p-1)+(i+1-t)/p*N(t,i+1,p-1); 1 old definition(s) deleted for function or rule N Type: Void fricas for x in -5..15 repeat output N(x/10,0,3) fricas Compiling function N0 with type Fraction(Integer) -> NonNegativeInteger fricas Compiling function N with type (Fraction(Integer), Integer, Integer) -> Fraction(Integer) 0 0 0 0 0 0 1 ---- 6000 1 --- 750 9 ---- 2000 4 --- 375 1 -- 48 9 --- 250 343 ---- 6000 32 --- 375 243 ---- 2000 1 - 6 133 - ---- 6000 43 - --- 750 217 - ---- 2000 67 - --- 375 13 - -- 48 Type: Void Drawing the plot (unfortunately not available here) would show it even more clearly. But in D(N(t,0,3),t) you are not calling the function N with numeric parameters. In N(t,0,3) the type of t is Variable t. Ultimately N(t,0,3)=0 because of your function definition N0(t|(t<0) or (t>1))==0. This is 0 because t>1 is true when t is of type Variable t. You can see why if you use the option )set message bottomup on to see the mode map selection fricas )set message bottomup on t>1 Function Selection for > Arguments: (VARIABLE(t), PI) -> no appropriate > found in Variable(t) -> no appropriate > found in PositiveInteger -> no appropriate > found in Symbol -> no appropriate > found in Integer -> no appropriate > found in Variable(t) -> no appropriate > found in PositiveInteger -> no appropriate > found in Symbol -> no appropriate > found in Integer Modemaps from Associated Packages no modemaps Remaining General Modemaps  (D,D) -> Boolean from D if D has PORDER -> no function > found for arguments (VARIABLE(t), PI) Function Selection for > Arguments: (VARIABLE(t), NNI) -> no appropriate > found in Variable(t) -> no appropriate > found in NonNegativeInteger -> no appropriate > found in Symbol -> no appropriate > found in Integer -> no appropriate > found in Variable(t) -> no appropriate > found in NonNegativeInteger -> no appropriate > found in Symbol -> no appropriate > found in Integer Modemaps from Associated Packages no modemaps Remaining General Modemaps  (D,D) -> Boolean from D if D has PORDER -> no function > found for arguments (VARIABLE(t), NNI) Function Selection for > Arguments: (VARIABLE(t), INT) -> no appropriate > found in Variable(t) -> no appropriate > found in Integer -> no appropriate > found in Symbol -> no appropriate > found in Variable(t) -> no appropriate > found in Integer -> no appropriate > found in Symbol Modemaps from Associated Packages no modemaps Remaining General Modemaps  (D,D) -> Boolean from D if D has PORDER -> no function > found for arguments (VARIABLE(t), INT) Function Selection for > Arguments: (VARIABLE(t), SINT) -> no appropriate > found in Variable(t) -> no appropriate > found in SingleInteger -> no appropriate > found in Symbol -> no appropriate > found in Variable(t) -> no appropriate > found in SingleInteger -> no appropriate > found in Symbol Modemaps from Associated Packages no modemaps Remaining General Modemaps  (D,D) -> Boolean from D if D has PORDER -> no function > found for arguments (VARIABLE(t), SINT) There are 1 exposed and 2 unexposed library operations named > having 2 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op > to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation. Cannot find a definition or applicable library operation named > with argument type(s) Variable(t) PositiveInteger Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.

Axiom interprets both t and 1 as being of type POLY INT and the function > is defined by the lexical ordering of the polynomials.

This result is counter-intuitive, but once you understand why Axiom gives this result then you will be in a good position to understand the rest of Axiom's type system!

It is possible to write the function N0 so that it returns the desired result. See ExampleSolution1?.

 Subject:   Be Bold !! ( 15 subscribers )
{"ft_lang_label":"__label__en","ft_lang_prob":0.7392763,"math_prob":0.66333646,"size":7986,"snap":"2020-34-2020-40","text_gpt3_token_len":2037,"char_repetition_ratio":0.17100978,"word_repetition_ratio":0.66924864,"special_character_ratio":0.26133233,"punctuation_ratio":0.08659794,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9541385,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,5,null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-11T07:28:02Z\",\"WARC-Record-ID\":\"<urn:uuid:16ff8f76-deae-4bd3-bf44-e0e01897f374>\",\"Content-Length\":\"31797\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d3bb88cb-9398-4baf-bb8e-5ddb121e52d5>\",\"WARC-Concurrent-To\":\"<urn:uuid:d14f31ae-3073-47d9-96ca-7a94b0a60d2a>\",\"WARC-IP-Address\":\"156.17.86.4\",\"WARC-Target-URI\":\"http://fricas-wiki.math.uni.wroc.pl/PiecewiseFunctions?root=FriCAS%20Problems\",\"WARC-Payload-Digest\":\"sha1:2XYVF42EPZAZTDAKMADITCIQRZY224FY\",\"WARC-Block-Digest\":\"sha1:RYE3AZMAKD42K7KCJG6ELZWTVTICKEIP\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439738735.44_warc_CC-MAIN-20200811055449-20200811085449-00100.warc.gz\"}"}