View Issue Details

IDProjectCategoryView StatusLast Update
0000513ascendgeneralpublic2011-11-11 11:23
Reportervikram 
Assigned Toben 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version10.04 LTS
Product Version0.9.7 
Target Version0.9.8Fixed in Version0.9.8 
Summary0000513: Constant raised to constant evaluated incorrectly
DescriptionWhen a constant value is raised to another constant value, the result is base constant value raised to base constant value irrespective of the index constant value.
Steps To ReproduceA simple example :

    x IS_A factor;
    y IS_A factor;

    x = 2^4;
    y = 4^2;

x converged to 4 which is 2^2
y converges to 254 which is 4^4
TagsNo tags attached.

Relationships

Activities

vikram

2011-06-21 15:51

reporter  

test_bug.a4l (153 bytes)

john

2011-06-21 16:10

administrator   ~0000745

Reminder sent to: ben

Hi Ben

You might want to look at this bug... very strange, it seems that a^b is being evaluated as a^a in cases where a is an integer.

Cheers
JP

john

2011-06-21 16:12

administrator   ~0000746

Note: the bug also occurs with

    x = 2^4.0;
    y = 4^2.0;

john

2011-06-21 17:40

administrator   ~0000747

TODO: test if same occurs when 4.0, 2.0 are replaced by real_constant or integer_constant instances.

john

2011-06-23 12:08

administrator   ~0000750

Ben responds:

The relation instantiator (with simplification on at least) will
promote real constants that are identifiably integer back to integers
as int power functions can be rather cheaper.

john

2011-06-23 12:08

administrator   ~0000751

Earlier response from Ben, too:

please confirm (or deny) that the same error occurs if relations
simplification is enabled/disabled
via g_simplify_relations.

Also please use the display relations functionality to show the
instantiated relation tokens and see if the error is in the
instantiation (which should appear in the tokens) or in the equation
solution process (which should not). If err in the solution process,
solving with matrix partitioning turned off (using matrix 2x2 newton
rather than inversion) should get to the right solutions.

This will narrow down where the problem is quickly.

john

2011-10-09 21:19

administrator   ~0000774

Hi Ben

Confirm that bug is caused by the "g_simplify_relations" being set to 1.

Will try next to use the 'display relations functionality'. Any thoughts at this stage?

Cheers
JP

john

2011-10-09 22:12

administrator   ~0000775

Using 'WriteRelationString' (via the PyGTK GUI) I was able to determine that the problem arises from the instantiation process.

john

2011-11-07 22:32

administrator   ~0000779

Reminder sent to: ben

Hi Ben

Wonder if you might be able to pass your eyes over compiler/relation.c around line 1600... I think the problem of this bug might be in that vicinity, and also, it says "still need to code C^R case".

Cheers
JP

john

2011-11-11 11:22

administrator   ~0000780

Fixed by Ben in changeset 3849. Thanks Ben!

Issue History

Date Modified Username Field Change
2011-06-21 15:51 vikram New Issue
2011-06-21 15:51 vikram File Added: test_bug.a4l
2011-06-21 16:10 john Note Added: 0000745
2011-06-21 16:12 john Note Added: 0000746
2011-06-21 16:28 john Assigned To => john
2011-06-21 16:28 john Status new => confirmed
2011-06-21 17:40 john Note Added: 0000747
2011-06-23 10:48 john Priority normal => high
2011-06-23 10:48 john Product Version => 0.9.7
2011-06-23 10:48 john Target Version => 0.9.8
2011-06-23 12:08 john Note Added: 0000750
2011-06-23 12:08 john Note Added: 0000751
2011-10-09 21:07 svn
2011-10-09 21:17 svn
2011-10-09 21:19 john Note Added: 0000774
2011-10-09 22:12 john Note Added: 0000775
2011-11-07 22:32 john Note Added: 0000779
2011-11-11 11:22 john Note Added: 0000780
2011-11-11 11:22 john Assigned To john => ben
2011-11-11 11:22 john Status confirmed => assigned
2011-11-11 11:23 john Status assigned => resolved
2011-11-11 11:23 john Fixed in Version => 0.9.8
2011-11-11 11:23 john Resolution open => fixed