Skip to content

Conversation

@FredrikTaquist
Copy link
Collaborator

This PR completely reworks the implementation for SL lambda to align it more closely with the SL lambda algorithm. The new implementation aims to be more modular in order to facilitate future additions and expansions to the SL lambda algorithm. By aligning the implementation more closely with the algorithm, this PR also fixes issues involving non-determinacy during learning, such as non-determinacy problems revealed when examining issue #78 (which is fixed with this PR). This PR also fixes a number of bugs in ralib.

Among the contributions made by this PR are the following:

  • New, more modular, data structure for classification trees
  • Closedness and consistency checks moved to classification tree
  • Learning algorithm more closely adheres to the theory
  • New RARun data structure allows for extracting runs on a hypothesis over a data word
  • Paths taken during hypothesis traversals now consistent between CE analysis and equivalence testing
  • Fixes a bug that caused SDT::isEquivalent to sometimes return false for SDTs that are equivalent
  • Fixes a bug where data values are sometimes not compared numerically
  • Fixes a null-pointer exception eror in RemappingIterator::next

@kostis kostis requested a review from fhowar November 25, 2025 13:42
Copy link
Member

@fhowar fhowar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing! The implementation is greatly improved. I only ask for small name changes / documentation and removal of deprecated methods.

For the prefix finder: will it be able to search with binary search?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to remove the deprecated method?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for removal. Esp. given the comment above it that it is unsafe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why these methods are deprecated is that the XML automata models make use of the unsafe functionality, in that they are coded to only assign a parameter to a register. They do not reassign old values for registers that will be reused. Because of this, removing the deprecated methods will require refactoring of the XML models. I am not opposed to refactoring the models, but I feel like this is beyond the scope of this PR and should perhaps be done in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add that to the method's documentation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's reasonable to leave this for another PR. However, so as to not forget about it, besides adding this note to the method's documentation, it's good to also open a GitHub issue about this refactoring.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the deprecated method?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some documentation or find a better name for tryEquality

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a boolean method, something starting with is is an appropriate name.
Suggestions: something like isEqualitySolvable or isSolvableByEquality ?

return Optional.empty();
}

private boolean tryEquality(Expression<Boolean> guard, Parameter p, DataValue val, ConstraintSolver solver) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better name?

@FredrikTaquist
Copy link
Collaborator Author

For the prefix finder: will it be able to search with binary search?

The prefix finder currently searches from right to left. However, each loop iteration is independent, so it would be straightforward to implement a binary search.

@kostis
Copy link
Collaborator

kostis commented Dec 24, 2025

The code of this PR now has various javadoc problems that probably have been exposed by PR #114 that added javadoc support. These need to be fixed before this PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants