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

FEAT: DFA Parsing #13

Open
3 tasks
Zakrok09 opened this issue Apr 11, 2024 · 3 comments
Open
3 tasks

FEAT: DFA Parsing #13

Zakrok09 opened this issue Apr 11, 2024 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Zakrok09
Copy link
Owner

Problem:

As suggested by @vesk4000, there could be a DFA / Automata parser from some string that represents the DFA. This could come particularly handy (naive to say) when TM are introduced into the package.

Solution:

  • introduce a DFA parser to construct DFAs from a string representing it
  • make it fail on illegal, ill-formatted input.
  • OPTIONAL: make it possible to choose the delimiter symbols to support other ways of representing DFAs as a stringr
@Zakrok09 Zakrok09 added enhancement New feature or request good first issue Good for newcomers labels Apr 11, 2024
@Zakrok09 Zakrok09 added this to the Regular Languages milestone Apr 11, 2024
@Zakrok09 Zakrok09 mentioned this issue Apr 22, 2024
3 tasks
@Gargant0373
Copy link

Wouldn't it's formal representation be a good place to start from?

We could use JSON for it:

{
  "states": ["q0", "q1", "q2"],
  "alphabet": ["0", "1"],
  "transitions": {
    "q0": {
      "0": "q1",
      "1": "q0"
    },
    "q1": {
      "0": "q2",
      "1": "q0"
    },
    "q2": {
      "0": "q2",
      "1": "q2"
    }
  },
  "start_state": "q0",
  "accept_states": ["q2"]
}

@Zakrok09
Copy link
Owner Author

Zakrok09 commented Apr 22, 2024

@Gargant0373 certainly! Using a JSON format like this would be a solid start.

I believe that @vesk4000 had solution for some niche DFA representation used for the Quadruple Quest assignments at TU Delft. What was it there?

Edit: I forgot to mention, this project is labeled as good first issue. If you have the time to contribute, any contribution is gladly accepted.

@vesk4000
Copy link

I believe that @vesk4000 had solution for some niche DFA representation used for the Quadruple Quest assignments at TU Delft. What was it there?

The format went something like this: ({q0,q1,q2},{a,b,c},{((q0,a),q0),((q0,b),q1),((q0,c),q2),((q1,a),q0),((q1,b),q1),((q1,c),q0),((q2,a),q0),((q2,b),q0),((q2,c),q0)},q0,{q0}). It's a tuple of the form: (States, Alphabet, Transitions, Start State, Accepting States).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants