tangentstorm / bex

A rust crate for boolean expressions (expression trees, decision diagrams, etc.)
https://docs.rs/bex/
MIT License
30 stars 2 forks source link

unify interface for ast and bdd bases #2

Closed tangentstorm closed 5 years ago

tangentstorm commented 5 years ago

the AST version uses trait base::TBase, wheras the bdd version has a generic BddBase struct.

I want one trait that any base can implement.

tangentstorm commented 5 years ago

(#5) ~I want base.rs to contain trait Base (rather than TBase), enum Op, and NID / VID. The current struct Base should be renamed to ASTBase (or ASTStore) and moved to ast.rs.~

I'm starting to think that it might make sense to factor out a BitStore concept, that does only the very basic operations for calculating new nodes, walking the graph, and scheduling work. Generic services like caching, scheduling work, etc. could be handled by one generic Base<T> implementation.

tangentstorm commented 5 years ago

ast::ASTBase and bdd::BddBase now both implement base::Base.

There's still quite a bit of overlap between the implementations that seem like they should belong in some generic helper struct that uses a base. Things like load/save, tagging, and caching support... But I'll save that for a separate ticket.