Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SemanticSubstitute sensitive to internal replacements map ordering #42

Open
GoogleCodeExporter opened this issue May 8, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

The test below (com.sri.ai.test.grinder.GrinderTest.testSubstitute()) is 
sensitive to the map's internal ordering, and it should not be.

The current map order generates output "10 + 10", but if stored in a different 
order we get "2 + 10".

        expression   = parse("x + 2");
        replacements = Util.map(
                parse("x"), parse("2"),
                parse("2"), parse("10"));
        expected     = parse("10 + 10");
        testSemanticSubstitute(replacements, process);

This was noticed when the underlying map was changed from HashMap to 
LinkedHashMap

Changing the semantic substitute to an exhaustive replacement does not work as 
it may cause infinite recursion.

Original issue reported on code.google.com by [email protected] on 11 Feb 2014 at 8:15

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

No branches or pull requests

1 participant