#2485 closed defect (done)

CSharp formatter for symbolic data analysis expressions does not produce correct expressions in all cases

Reported by: gkronber Owned by: gkronber
Priority: medium Milestone: HeuristicLab 3.3.13
Component: Problems.DataAnalysis.Symbolic Version: 3.3.12
Keywords: Cc:

Description (last modified by gkronber)

The HL interpreter also allows Boolean operators with real-valued arguments. This is not yet handled correctly by the formatter.

There also seems to be a problem when using only arithmetic operators: Ich vermute, dass der TreeInterpreter ein anderes Ergebnis produziert als der Code den der C# Formatter ausgibt. Ich habe bei mir in einem Testscript einmal die Policy Function als C# Code eingebettet und einmal unter Verwendung des TreeInterpreter. Als C# Code kommt Qualität 0 heraus mit dem TreeInterpreter Qualtät 10. Als Grammatik habe ich nur die ArithmeticExpressionGrammar verwendet.

Attachments (1)

TreeInterpreterFormatterProblemScript.hl (12.4 KB) - added by gkronber 18 months ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 18 months ago by gkronber

  • Owner set to gkronber
  • Status changed from new to assigned

comment:2 Changed 18 months ago by gkronber

  • Milestone changed from HeuristicLab 3.3.13 to HeuristicLab 4.0.x Backlog

comment:3 Changed 18 months ago by gkronber

  • Description modified (diff)

Changed 18 months ago by gkronber

comment:4 Changed 18 months ago by gkronber

See attached script to reproduce the problem

comment:5 Changed 18 months ago by mkommend

  • Owner changed from gkronber to mkommend
  • Status changed from assigned to accepted

comment:6 Changed 18 months ago by mkommend

r13116: Corrected C# formatter for SymbolicExpressionTrees to handle subtractions correctly.

comment:7 Changed 18 months ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from accepted to assigned

r13116 should fix the issue that could be reproduced with the attached script. The error was related to the handling of unary subtractions (rare corner case). However, bool operations are still not supported.

Maybe a unit test would be useful to guarantee that the interpreter returns the same results as a function compiled from the tree formatter.

Last edited 18 months ago by mkommend (previous) (diff)

comment:8 Changed 18 months ago by mkommend

  • Milestone changed from HeuristicLab 4.0.x Backlog to HeuristicLab 3.3.13

comment:9 Changed 17 months ago by gkronber

Reviewed r13116 thanks for the fix.

comment:10 Changed 17 months ago by gkronber

Boolean expressions are still not handled correctly by the C# formatter and also by the Mathematica formatter. A new ticket has been created to track that bug (#2514).

comment:11 Changed 17 months ago by gkronber

r13240: merged r13116 from trunk to stable

comment:12 Changed 17 months ago by gkronber

  • Status changed from assigned to accepted

comment:13 Changed 17 months ago by gkronber

  • Status changed from accepted to reviewing

comment:14 Changed 17 months ago by gkronber

  • Status changed from reviewing to readytorelease

comment:15 Changed 17 months ago by gkronber

  • Resolution set to done
  • Status changed from readytorelease to closed
Note: See TracTickets for help on using tickets.