-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce trivial product #80
Comments
I'm not sure what code should be dealing with this. It might help to have a program where such expressions occur and are successfully simplified, as well as the one in which they are not. |
I believe there are several programs in @cscherrer can you point us to the program you were using where this didn't happen? |
@JacquesCarette
|
Thanks. I think the issue is that the code to simplify these kinds of products is called only very late in the pipeline, and not in all the places that could benefit from it. |
After pasting this, I realize I had hand-simplified some expressions that were obviously always true. But maybe this goes back to the difficulty of making that obvious to Maple. |
If it were an order of simplification thing, it should reduce further with another call, right? |
There are some simplifications that are not done because they require knowledge that is (currently) unavailable (such as properties of values inside arrays). If these are crucial, then we'll need to up the priority on that work. Simplification, in theory, should be idempotent. In practice, I definitely don't think it is. Which is another way of saying: yes, try multiple calls to simplify. It might work. |
I agree that all 3 occurrences of I tried to
Which |
I forgot to say: In order to fire, the rewrite in |
Also, |
@JacquesCarette, I'm not sure why you're talking about the variable name |
@ccshan Because of the error message you posted about 3 hours ago. #80 (comment). |
To enable: infolevel[NewSLO:-simplify_factor_assuming:-eval_piecewise] := 3; Then perhaps: trace(KB:-kb_entails);
Using commit 131e0cf, I was able to track down the necessary preconditions to add to |
The |
Well, the trivial product issue is not completely fixed, merely worked around by adding |
@ccshan can you rig up a much simpler example to show this, and create a new issue with it? |
I don't understand what it means for the KB to discharge a condition. From what I do understand, we want to simplify |
Please understand "discharge" as "entail".
Yes we want to simplify |
This seems reasonable, and I am willing to try to implement it. Thanks for the clarification. Just to confirm, the presence of the 'extra' condition |
Indeed the presence of |
simplify
sometimes produces expressions of this form:But since the match is an equality test (not a more general predicate) and the false branch is 1, this loop reduces to
f(k)
.Can
simplify
be made to recognize this? Or maybe this is acompile
orsummary
thing. (The boundaries or responsibilities of the tools are a little blurry to me)The text was updated successfully, but these errors were encountered: