Christian Wolinski

MaplePrimes Activity

These are replies submitted by Christian Wolinski

I see this code satisfies what I expected from earlier versions of Maple:


S := {x[5] = x[2]/x\[1], x[6] = x[3]/x[2], x[7] = x[1]/x[4], x[8] = (2*x[2]+x[4])/(2*x[1]+x[3]+x[4])};
V := {x[1], x[2], x[3], x[4], x[8]};
T := (numer @ (lhs - rhs)) ~ (S):
Groebner :- Solve(T);
W := map(proc(L, v) seq([remove(evalb, s), L[3]], s = [solve](L[1], v)) end, %, V);


Here is an example of something I expect to happen in previous example.:


eliminate({x[2] = x[5] * x[1]}, {x[1], x[2]});



true, [x = 2, y = 2]

I was anticipating this result.

@Carl Love but builtin:


H := proc ()
   if type('procname, indexed') and type([op]('procname'), 'list(posint)') then op(map(op, map((n, m) -> `if`(n <= m, n, NULL), [op]('procname'), 'nargs'), ['args'])) else 'procname(args)' fi


@Preben Alsholm I was contemplating whether args[1] is a reference to parameter a or procname a reference to procedure F in this made up example (in any of the Maple versions):


F := proc(a, b)
   f := () -> args[1];
   g := () -> procname;

Also, is there a kernel substitute for f in this example?

@vv The task is trivial if you have both versions. Let someone like that post here instead please.

@vv Perhaps instead of using solve/ eliminate one should use gaussjord or linsolve?

@vv who wrote "The code looks to me as unnecessarily complicated, almost obfuscated. "
   So in short: Maple is not your programming language, nor is English your spoken language. But you should have read the original post. The query is about the following code, which uses only the most basic kernel functions, yet reportedly it fails on newer versions, say 2016.


F := proc(S, T)
   local A, n, m, x, y, v, w, V, W, i, f, g;
   n := `$`(1 .. nops(S));
   m := `$`(1 .. nops(T));
   f := () -> args[1];
   g := `@`(assign, op, map);
   g(V @ f = op, [n], 'S');
   g(W @ f = op, [m], 'T');
   g(v = simplify @ V, [n]);
   g(w = simplify @ W, [m]);
   A := frontend([eliminate], [map(x = v, {n}) union map(y = w, {m}), indets(map(w, {m}), function) union map(y, {m})], [{Non(function)}, {}]);
   A := map(x = V, [n]), subs(A[1][1], map(y, [m]));
   map(W, [m]), subs(A)

F('{log[12](27)}, {log[36](24)}');
F('{log[2](3), log[3](5), log[7](2)}, {log[140](63)}');


   I would like someone to present how two different platforms execute this code differently. Also @vv if you have an opinion about this code please post in the original thread, (link).

@hitstudent Have you actually produced the object asked? The method you produced is simply incomplete.

@taro I think that should be:

numer_expand := expand@numer/denom;

@Carl Love type(f[1](x),indexed); returns false, at least in Maple 5.4. Is this different in Maple 16?

@Preben Alsholm I have not observed this before:


rng := ''i = 1 .. 3'';
u := setattribute((x) -> 'x' ^ op(1, 'procname'), remember);
['u[i]' $ rng](x-y);
op(4, eval(u));

So an index on a function name always invokes the same procedure. I always expected an indexed function to require a table.

So how do we typecheck an expression for function f, specifically with or specifically without the index?

@Carl Love type('u[1](x)', specfunc(anything, u))=false; #Maple 5.4

That is to say specfunc judges the face of the expression with identity. What about newer Maple?

Say u:=proc(x) x+1 end; v:=table([]); type('u[1](x)', specfunc(anything, u)), type('v[1](x)', specfunc(anything, v));

@Carl Love I did not anticipate specfunc(`~`[`=`]) as a possibility. Does this mean newer maple would identifiy u[1](x) as specfunc(u)? How does one identify indexed function by its base name?

@Carl Love Would this be a cartesian product,: {{1,3}, {1}} union~ {{5},{6}}? Is that even valid form?

My original question was this: type('a =~ b', specfunc(anything, `~`)) or type('a =~ b', specfunc(anything, `=~`)) or some other type?

3 4 5 6 7 8 9 Page 5 of 9