This problem does not occur on the NAG version:
\begin{axiom}
dom:=(INT->INT)
g(f:dom):dom== x+->(f(x))^2
p(x:INT):INT == x-1
\end{axiom}
The next line crashes Axiom. (Here the crash is indicated by not showing the result for q which should be something like theMap(LAMBDA_ibs3ze_708.174) (from NAG version):
\begin{axiom}
q:= g p
\end{axiom}
Below is the transcript for the NAG version:
G82322 (1) -> dom:= (INT->INT)(1) (Integer -> Integer) Type: Domain G82322 (2) -> g(f:dom):dom== x+->(f(x))^2 Function declaration g : (Integer -> Integer) -> (Integer -> Integer ) has been added to workspace. Type: Void G82322 (3) -> p(x:INT):INT==x-1 Function declaration p : Integer -> Integer has been added to workspace. Type: Void G82322 (4) -> q:= g p Compiling function p with type Integer -> Integer Compiling function g with type (Integer -> Integer) -> (Integer -> Integer)
+++ |*1;g;1;G82322| redefined
(4) theMap(LAMBDA_ibs3ze_708,174) Type: (Integer -> Integer) G82322 (5) -> q 3(5) 4 Type: PositiveInteger
#114 Maps on Function crash => #114 Map on Functions crash
(1) -> )clear all
All user variables and function definitions have been cleared.
We can avoid the use of an anonymous function and use
function composition to define the functional g as follows:
dom ==> INT -> INT
g(f:dom):dom == function(x^2,sq, x) sq * f
Function declaration g : (Integer -> Integer) -> (Integer -> Integer ) has been added to workspace.
p(x:INT):INT == x-1
Function declaration p : Integer -> Integer has been added to workspace.
q := g p
Compiling function p with type Integer -> Integer There are 31 exposed and 40 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(sq) (Integer -> Integer)
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.
Compiling function g with type (Integer -> Integer) -> (Integer -> Integer) Compiled code for g has been cleared.
Compiling function sq with type Integer -> Integer
q 3