Opened 12 months ago

Closed 5 months ago

#2685 closed defect (done)

SymbolicExpressionGrammars calculate the min length and depth of expression wrong

Reported by: mkommend Owned by: mkommend
Priority: medium Milestone: HeuristicLab 3.3.15
Component: Encodings.SymbolicExpressionTreeEncoding Version: 3.3.14
Keywords: Cc:

Description (last modified by mkommend)

The calculation for the minimum and maximum expression length and depth based on the restrictions of the grammar (allowed child symbols) returns wrong results if the symbols are nested recursively.

The attached script reproduces the problem. Thanks to sforsten for reporting this problem.

Attachments (2)

Grammar.png (9.0 KB) - added by mkommend 12 months ago.
Visualization of the grammar
Script Grammar Expression Length Test.hl (1.4 KB) - added by mkommend 12 months ago.
Script to reproduce the problem

Download all attachments as: .zip

Change History (17)

comment:1 Changed 12 months ago by mkommend

  • Status changed from new to accepted

Changed 12 months ago by mkommend

Visualization of the grammar

Changed 12 months ago by mkommend

Script to reproduce the problem

comment:2 Changed 12 months ago by mkommend

  • Description modified (diff)

comment:3 Changed 12 months ago by mkommend

r14340: Added ctor to simple symbol.

comment:4 Changed 12 months ago by mkommend

r14341: Added unit test for min expression length and depth of configured grammars.

comment:5 Changed 12 months ago by mkommend

r14342: Refactored calculation of minimum expression length and depth into an separate class. Removed separate initialization code for the grammar caches in the ctor.

comment:6 Changed 12 months ago by bburlacu

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

comment:7 Changed 12 months ago by bburlacu

  • Status changed from assigned to accepted

comment:8 Changed 12 months ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from accepted to reviewing

r14352: Refactored length and depth calculation and updated unit tests.

comment:9 Changed 12 months ago by bburlacu

  • Owner changed from mkommend to bburlacu
  • Status changed from reviewing to assigned

comment:10 Changed 12 months ago by bburlacu

  • Owner changed from bburlacu to mkommend
  • Status changed from assigned to reviewing

r14353: Accidental commit.

r14354: Revert accidental commit.

r14355: Add correction step to account for grammar cycles. Update unit test.

Last edited 12 months ago by bburlacu (previous) (diff)

comment:11 Changed 12 months ago by bburlacu

r14356: Fix exception with symbols with no children (sequence contains no elements), factor out common code in separate methods.

Last edited 12 months ago by bburlacu (previous) (diff)

comment:12 Changed 12 months ago by bburlacu

r14357: Minor refactor.

comment:13 Changed 6 months ago by mkommend

  • Status changed from reviewing to readytorelease

comment:14 Changed 5 months ago by mkommend

r14958: Merged r14340, r14341, r14342, r14352, r14353, r14354, r14355, r14356, r14357 into stable.

comment:15 Changed 5 months ago by mkommend

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