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

Improve expression visitor #51

Closed
vitaut opened this issue Apr 23, 2015 · 2 comments
Closed

Improve expression visitor #51

vitaut opened this issue Apr 23, 2015 · 2 comments

Comments

@vitaut
Copy link
Contributor

vitaut commented Apr 23, 2015

Currently, ExprVisitor handles NumericExpr and LogicalExpr hierarchies separately. This was done because the result types of expression conversion for numeric and logical expressions are normally different (this is true for gecode and ilogcp). Need to add support for Expr, including string expressions. Among other things this will be useful for completing structural comparison of expressions.

Possible ways to implement:

  • Add another Visit(Expr) overload and dispatch on all expression kinds. Drawback: duplicates numeric and logical expression dispatch.
  • Replace Visit(NumericExpr) and Visit(LogicalExpr) with Visit(Expr). Since these methods use jump tables, it shouldn't affect performance, but need to handle different return types for logical and numeric expressions somehow.
@vitaut vitaut mentioned this issue Apr 23, 2015
2 tasks
@vitaut
Copy link
Contributor Author

vitaut commented Jun 9, 2015

Implemented the second option (one dispatch for all expression types) in fe42f07. Now it's possible to handle arbitrary target expression hierarchies. Need to implement string expressions and update solver drivers.

@vitaut
Copy link
Contributor Author

vitaut commented Jun 9, 2015

Finished refactoring and added support for StringLiteral and SymbolicIf in 041583b.

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

No branches or pull requests

1 participant