[PATCH] print integral in integ.input

23 views
Skip to first unread message

Qian Yun

unread,
Nov 27, 2023, 6:24:29 AM11/27/23
to fricas-devel
This will make it easier to compare the integral test result
after making changes to integration code.

- Qian

diff --git a/src/input/integ.input b/src/input/integ.input
index 0d12c1b1..9a0662be 100644
--- a/src/input/integ.input
+++ b/src/input/integ.input
@@ -14,7 +14,7 @@ is_evaluated_integral(res, f) ==

testIntegrate(f: String, x: String, issue: String): Void ==
testcaseNoClear("integrate(" f ", " x ") (" issue ")")
- testTrue("(res := integrate(" f ", " x "); true)")
+ testTrue("(res := integrate(" f ", " x "); print(res); true)")
testTrue("is_evaluated_integral(res, " f ")")
testEquals("normalize(D(res, " x ") - (" f "))", "0")

Waldek Hebisch

unread,
Nov 27, 2023, 8:49:14 PM11/27/23
to fricas...@googlegroups.com
On Mon, Nov 27, 2023 at 07:24:24PM +0800, Qian Yun wrote:
> This will make it easier to compare the integral test result
> after making changes to integration code.

Actually, the idea behind _not_ printing test results was that
changes in exact form of output do not affect correctness.
So skipping printed form makes comparison easier. You now care
about form of output, but it is not clear to me this change is
good in general.

--
Waldek Hebisch

Qian Yun

unread,
Nov 28, 2023, 5:17:19 AM11/28/23
to fricas...@googlegroups.com
Currently the result is checked by machine.

Printing out the result will not change that.

It will make human easier to check for expected/unexpected
output form change after making changes to integrator.

- Qian

Waldek Hebisch

unread,
Nov 28, 2023, 6:31:15 AM11/28/23
to fricas...@googlegroups.com
On Tue, Nov 28, 2023 at 06:17:14PM +0800, Qian Yun wrote:
> Currently the result is checked by machine.
>
> Printing out the result will not change that.
>
> It will make human easier to check for expected/unexpected
> output form change after making changes to integrator.

Well, currently still about 60% of testsuite needs textual
comparison to check results. The helper script
'src/scripts/norm-out' checks all files, so changes in
printed form would show up.

--
Waldek Hebisch

Qian Yun

unread,
Nov 28, 2023, 7:11:39 AM11/28/23
to fricas...@googlegroups.com
The problem is that "testIntegrate" doesn't print anything.
This patch will make it print the integral result so that
'src/scripts/norm-out' can help to check.

- Qian

Waldek Hebisch

unread,
Dec 5, 2023, 2:34:34 PM12/5/23
to fricas...@googlegroups.com
On Tue, Nov 28, 2023 at 08:11:34PM +0800, Qian Yun wrote:
> The problem is that "testIntegrate" doesn't print anything.
> This patch will make it print the integral result so that
> 'src/scripts/norm-out' can help to check.

As I explained not printing is intentional: printed form
may change without changing value and we want to minimize
amount of checking done by human. OTOH I am not sure
if that matters: AFAICS with added printout output from
'integ.input' did not change after my patch. The only
change from your patch was different placement of square
root.

--
Waldek Hebisch

Qian Yun

unread,
Dec 5, 2023, 6:58:18 PM12/5/23
to fricas...@googlegroups.com
That's because there's no such testcases in integ.input yet.

If you add testcases like 'testIntegrate("1/(x^4+1)", "x", "rat")',
then there's difference in output.

This patch does not mean for us to check for output difference
every time, but makes it easier for us to check for output
when needed.

- Qian

Waldek Hebisch

unread,
Dec 7, 2023, 7:57:35 PM12/7/23
to fricas...@googlegroups.com
On Wed, Dec 06, 2023 at 07:58:13AM +0800, Qian Yun wrote:
> That's because there's no such testcases in integ.input yet.
>
> If you add testcases like 'testIntegrate("1/(x^4+1)", "x", "rat")',
> then there's difference in output.

Well, there is a test, but it is done in different way,
not using 'testIntegrate'.

> This patch does not mean for us to check for output difference
> every time, but makes it easier for us to check for output
> when needed.

I run 'norm-out' before every commit and other commiters should
do the same: it is needed to see that all included test passed.
Merely doing 'make check' in practice would miss many errors.
So I hope that you understand that I want output of 'norm-out'
to be as small as possible but still catch errors.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages