Robert Israel

6522 Reputation

21 Badges

18 years, 182 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

prep2trans will make a sum into a loop, but it doesn't do anything with a product. It also seems unable to handle anything containing I.
> with(codegen):
  prep2trans(proc(a,b) Re(a+I*b) end proc);
Error, (in intrep/statement) unable to translate I
> prep2trans(proc(a,n) local i; product(a,i=1..n) end proc);
proc (a, n) local i; product(a,i = 1 .. n) end proc
In Maple 11 that gives me proc () local i; for i to 3 while false do false end do end proc Perhaps you mean
subs(true = false, 
  proc()  to 3 do true; end do end proc);
Also mserver.exe, cwmaple.exe, or (in Maple 9.5) java.exe. Any other names? I'm not sure it's Microsoft's fault: under some circumstances, Maple might not shut itself down properly.
Also mserver.exe, cwmaple.exe, or (in Maple 9.5) java.exe. Any other names? I'm not sure it's Microsoft's fault: under some circumstances, Maple might not shut itself down properly.
I think that would be a very good idea.
I think that would be a very good idea.
Actually that should be "a single statement", not "a single line". You could also use any of these:
> parse(cat("if true then ",str," fi;", statement);
> parse(cat("try ",str," end;", statement);
> parse(cat("use zero=0 in ",str," end;", statement);
My reading of the original question was that it was the first integer, rather than the least integer, that was wanted. There actually is a Maple procedure that searches a set or list for the first element of a given type. If L is your input, you could try this:
> if membertype(integer, L, 'p') then L[p] fi;
My reading of the original question was that it was the first integer, rather than the least integer, that was wanted. There actually is a Maple procedure that searches a set or list for the first element of a given type. If L is your input, you could try this:
> if membertype(integer, L, 'p') then L[p] fi;
Your algorithm is indeed not very efficient, but that's hardly surprising: the problem of deciding whether a Boolean expression in sum-of-products form is equivalent to "true" is equivalent to the satisfiability problem SAT for the negation of the expression, and this is NP-complete. So (pending the solution of the P vs NP question) you're not going to find a polynomial-time algorithm for this.
Your code also might not return a minimum sum. Consider this one:
 > minbool("EACDB'+ECA'DB'+CDB'E'A+CDB'A'E'+EBA'CD+EBA'CD'\
+EBA'C'D+EBA'C'D'+C'BAED+C'BAED'+C'BAE'D+C'BAE'D'+ADE'BC\
+ADE'B'C'+D'ACEB+D'ACEB'+D'ACE'B+D'ACE'B'");

*** Max loops in concensusList reached, terminating ***
Minimal sum: ADE' + A'EDB + EC'B + CB'D + ECD'B + ACB' + AD'B
A minimum sum, I think, is CDB'+EBA'+ABC'+ADE'+ACD'.
Oh, sorry, I guess I didn't notice that this was wrong... Yes, it looks like a serious bug. Maple is treating ln(ln(x)) and ln(x) as variables independent of x.
This is not usual. It depends, I guess, on exactly what Maple is doing in those 2 or 3 hours. The details are important. If it's doing some very complicated computations that fill up all the available memory with their results, then this could happen. Perhaps if you tell us what you're trying to do and how you're trying to do it, somebody can suggest a way of avoiding this problem.
That's strange. It worked for me in Maple 11.01. I tried several times, using different orderings for the variables, and it always worked. Can you upload a worksheet that shows it not working?
Isn't this functionality provided (using other notation) by BooleanSimplify in the Logic package?
First 179 180 181 182 183 184 185 Page 181 of 187