Comments (6)
hi, what version of python and the dfa package are you using?
from dfa.
Hi @tomyaacov
Sorry about the confusion. I just realized that there was a regression in the readme. The composition API was dropped a while back and it was removed from the readme.
It looks like it was accidentally brought back when cherry picking and old patch.
from dfa.
Ok.. thanks for replying. Is there an older version of the package which includes composition?
from dfa.
So it was explored in an experimental feature branch.
I actually think it might be good to try and explore adding the feature again, but I won't have time to really investigate (and then commit to maintaining) until ~May.
I'm happy to accept a PR though.
Are you just interested in parallel composition? Or do you generally want parallel + sequential composition?
For small alphabets, it's fairly easy to write code that implements these. For example parallel composition should be something like:
from dfa import DFA
def par_compose(dfas: list[DFA]) -> DFA:
def transition(state, char):
return tuple(d._transition(s, c) for d, s, c in zip(dfas, state, char))
def label(state):
return tuple(d._label(s) for s in zip(dfas, state))
return DFA(
start=tuple(d.start for d in dfas),
inputs=product(d.inputs for d in dfas),
outputs=product(d.outputs for d in dfas),
label=label,
transition=transition,
)
from dfa.
To be clear, the real pain is writing logic to symbolically handle sum and product alphabets.
It's not impossible, but I recall there being subtle edge cases.
Typically, I do composition at the circuit level using the py-aiger library.
from dfa.
Will check it out. Thanks!
from dfa.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dfa.