On 04/12/2017 07:12 PM, Raymond wrote: > I hate to be a pest but I have looked around and apparently don't understand > some conditional/typing. > For instance after > n : PI > we get. > > (9) -> if (n>-3) then true else false > > n is declared as being in PositiveInteger but has not been given a > value. > > This was also mentioned in: > http://axiom-wiki.newsynthesis.org/DefiniteIntegration > with no update (it's quite old) or response that I can see.. > " > n:PositiveInteger > what this tellsFriCAS <http://axiom-wiki.newsynthesis.org/FriCAS>is > that|n|will > be assigned an integer value greater than 0 - only that. After it is actually > assigned some value, then it can be used exactly like that value, but not > before. > > To me, this is a tremedous waste of an opportunity inFriCAS > <http://axiom-wiki.newsynthesis.org/FriCAS>to to deal with "domain of > computation" issues such as are addressed in other untyped computer algebra > systems by the use of "assumptions" such as: > > assume(x,PositiveInteger); > " > I need it for a negative binomial rule/function as > per:https://arxiv.org/pdf/1105.3689.pdf > In GouldBK we never stoop so low as/actually/ use numbers! :) > Ray
Well, you may be right in that a declaration like "n: PI" is not used in FriCAS as one might expect it. However, the problem lies somewhat in the difference between a programming variable and a variable in a symbolic expression. If you say "n: PI" then it is simply telling the interpreter (or the compiler) to reserve some space for an integer value. That is NOT a variable in a symbolic sense. In non-typed systems like Maple the distinction between programming variable and symbolic variable is a bit blurred. In Maple there is the rule, if an identifier, let's say it's x, occurs that has not been assigned a value then this identifier becomes a symbolic variable. In fact, it becomes the programming variable x gets a value, namely `x`, i.e. the value of x is x and that is all that counts in non-typed systems. Now, if you declare "n: PI" in FriCAS, an evaluation rule like above cannot work since the value of n must be an integer, i.e., cannot evaluate to the variable n, because a (symbolic) variable is not an integer. Of course, it would work, if FriCAS could attach information like "assume(n, PI)" to the (symbolic) variable n. But that's currently not possible (as far as I know). It's definitely not "n: PI" and I doubt that it will ever by such a syntax. I would certainly oppose such a meaning for "n: PI", because this clear (programming) declaration would get misused for a symbolic purpose. I'd rather prefer an "assume" statement for your purpose. Ralf -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.
