acer

30167 Reputation

29 Badges

18 years, 235 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@sursumCorda Recall how I was waffling on about evaluation rules? Well, there are a few more interesting bits. The assuming mechanism does have delayed evaluation of its first argument, by ways of its first parameter being declared ::uneval. It uses the delayed evaluation as an opportunity to place its assumptions (which it gets rid of at the end, by resubstituting with original names).

The assuming mechanism is still more complicated, though. Part of that is to avoid placing assumptions on keyword parameters, and so forth. But it also contains hard-coded knowledge of certain commands. The following example illustrates it's avoidance of placing assumptions on the name in the argument name=range, ie. the variable of integration. It'll place them on names in the range, though. I suppose one might phrase that avoiding getting in int's way of making its own assumptions on the variable of integration.

restart;

bar := proc(X) map(about,_passed); 1; end proc:

 

F(bar(x), x=0..1) assuming positive:

Originally x, renamed x~:
  is assumed to be: RealRange(Open(0),infinity)
 

int(bar(x), x=0..1) assuming positive:

x:
  nothing known about this object
 

F(bar(x), x=0..x) assuming positive:

Originally x, renamed x~:
  is assumed to be: RealRange(Open(0),infinity)
 

int(bar(x), x=0..x) assuming positive:

x:
  nothing known about this object
 

F(bar(x,X), x=0..X) assuming positive:

Originally x, renamed x~:
  is assumed to be: RealRange(Open(0),infinity)

Originally X, renamed X~:
  is assumed to be: RealRange(Open(0),infinity)
 

int(bar(x,X), x=0..X) assuming positive:

x:
  nothing known about this object

Originally X, renamed X~:
  is assumed to be: RealRange(Open(0),infinity)
 

Download assuming_mech_h.mw

So, now back your followup example. I'll just use an unassigned name f rather than unnecessary obfuscation via RETURN, error, etc. We see here that assuming will not place the assumption on the name appearing on the LHS of the name=range argument in the int call, even if it does appear in the RHS or that argument. This finesse is special to assuming's treatment of a function call to int, but not of some other function call.

restart;

S(f(about(x),coulditbe(x = 1)), x = 0 .. x) assuming 0 < x, x < 1;

Originally x, renamed x~:
  is assumed to be: RealRange(Open(0),Open(1))
 

S(f(false), x = 0 .. x)

restart;
int(f(about(x),coulditbe(x = 1)), x = 0 .. x) assuming 0 < x, x < 1;

x:
  nothing known about this object
 

f(true)*x

Download int_assuming_p.mw

You also mentioned nested integrals, but gave no examples. I'll mention that there is a big difference in how int can function between,
    int(int(int( f(x,y,z), x=a..b), y=c..d), z=e..f)
and,
    int( f(x,y,z), [x=a..b, y=c..d, z=e..f] )

In the former, nested case the inner int call is evaluated with no knowledge of the outer integration's variable's range. Since int follows standard evaluation rules the inner one is computed before the outer ones act. But for the latter, collapsed case int has the opportunity to place assumptions on the outer integrations' variables, prior to computing the inner integral.

See exports CollapseNested and ExpandMultiple of the IntegrationTools package, for programmatic conversion between these two forms, for Int or int.

@charlie_fcl Interesting. Thanks.

If I make that my personal initialization file then both worksheets run ok in my Maple 2024.0 for Linux.

Please do not create separate Question threads for this.

Please add followups here, instead.

Please do not create separate Question threads for this.

If you have followup queries on a revised attempt, then please add such in Replies here, instead.

@Bubbleee I have seen fewer reports of corrupted files from Maple 2024.

@Bubbleee Unfortunately, the attachment you've linked consists of only two lines, the first empty and the second containing only the text:

</Worksheet>

The file is only 13 bytes in size. Nothing useful can be recovered from that.

@charlie_fcl

Is there code in the Startup region of the worksheet? Are there any hidden inputs?

If neither, then could you show us the contents of your initialization file (supposing that it doesn't contain secret stuff)?

Your problematic worksheets (saved using Maple 2024) don't appear to contain much more than some stock examples. But none of us can tell all that's really in them without direct access to the acutal .mw worksheet files. Could you provide the actual worksheet files, instead of .pdf exports?

The most helpful way to proceed is to provide code and files, giving the best chance to reproduce and diagnose the problem.

@Ali Hassani 

The type-check against,

    specfunc(identical(x^2), sin)

will be true if it's a function call of sin, and all arguments being of type identical(x^2). That includes the case of no arguments at all.

The type-check against,

    specfunc(sin)

is the same as that against,

   specfunc(anything, sin)

where it will be true if it's a function call of sin and all the arguments are of type anything. Ie, any function call to sin. That includes the case of no arguments at all.

The type identical(...) is a check for an identical match, as the name suggests.

These are all described, close together on the structured types Help-page. There it states:   

identical(expr)

an expression identical to expr

 

| specfunc(f)

the function f with (possibly zero) arguments of any type

 

| specfunc(type,f)

the function f with (possibly zero) type arguments

@C_R If you're using that plaintext then you'd have to remove the errant `*` instances (which Carl has likely correctly surmised comes from transcription here of faulty 2D Input).

The OP does not provide actual worksheet attachments, which makes helping him unnecessarily awkward. It's not helpful.

@Alexandrakristensen24 I was unable (as yet) to recover that corrupted portion, which contained a faulty image portion.

Your attachment's faulty portion does seem to start at line 274 of the XML. But there are only 286 lines in the file. It's quite possible that your attachment doesn't contain much more data, and that the (nor properly saved) original was actually much larger.

@C_R 

As I'd already mentioned in my original Answer: the custom mechanism is busted in M2024.0.

I've already reported that functionality regression.

@C_R Regardless of which command you might extend, you'll need a conditional to test for type `=`.

Otherwise you'll have weird errors when applying rhs,lhs accidentally to type algebraic, Matrix, piecewise, etc.

What version are using? Did you see the part of my Answer that explained that the `simplify/ext` mechanism doesn't work in Maple 2023.2 and Maple 2024.0?

The general mechanism worked in 2022.2.

Which are you using here?

@C_R It may be due to the special characters in the file name. The OP could try renaming it.

@C_R Experiment and the quest for understanding are great motivations. I was curious, is all. Thanks.

I'd have to study those other examples later.

1 2 3 4 5 6 7 Last Page 1 of 551