Prepare files for making repository public
This commit is contained in:
parent
e5a9c03bb6
commit
d164af275e
5 changed files with 56 additions and 32 deletions
43
LICENSE
43
LICENSE
|
|
@ -1,30 +1,21 @@
|
||||||
Copyright Author name here (c) 2019
|
MIT License
|
||||||
|
|
||||||
All rights reserved.
|
Copyright (c) 2019 Garmelon
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
modification, are permitted provided that the following conditions are met:
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright
|
The above copyright notice and this permission notice shall be included in all
|
||||||
notice, this list of conditions and the following disclaimer.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
copyright notice, this list of conditions and the following
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
disclaimer in the documentation and/or other materials provided
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
with the distribution.
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
* Neither the name of Author name here nor the names of other
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
contributors may be used to endorse or promote products derived
|
SOFTWARE.
|
||||||
from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
|
||||||
35
README.md
35
README.md
|
|
@ -1 +1,36 @@
|
||||||
# rextra
|
# rextra
|
||||||
|
|
||||||
|
At the moment, rextra can display DFAs and NFAs using Graphviz,
|
||||||
|
convert between NFAs and DFAs, and minimize DFAs.
|
||||||
|
|
||||||
|
The representation of DFAs and NFAs assumes an infinite alphabet:
|
||||||
|
|
||||||
|
DFA states always contain a default transition (marked with `*` in the
|
||||||
|
visualisations), which is taken if the current token doesn't appear in
|
||||||
|
any of the other transitions.
|
||||||
|
|
||||||
|
NFA transitions either apply to a set of tokens, or to all tokens
|
||||||
|
*except* a specified set. In the visualisation, the character `Σ`
|
||||||
|
denotes the alphabet of tokens.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
This example minimizes the DFA shown on the
|
||||||
|
[wikipedia article about DFA minimization](https://en.wikipedia.org/wiki/DFA_minimization).
|
||||||
|
|
||||||
|
Transitions for the token `1` are specified explicitly (where
|
||||||
|
necessary), while transitions for the token `0` are represented by the
|
||||||
|
default transition marked with `*`.
|
||||||
|
|
||||||
|
This ghci session shows the minimization of the DFA mentioned above.
|
||||||
|
|
||||||
|
``` haskell
|
||||||
|
>>> Just a = dfa [ ("a",[('1',"c")],"b"), ("b",[('1',"d")],"a"), ("c",[('1',"f")],"e"), ("d",[('1',"f")],"e"), ("e",[('1',"f")],"e"), ("f",[],"f") ] "a" ["c","d","e"]
|
||||||
|
>>> saveDotAsPng "dfa.png" $ dfaToDot a
|
||||||
|
```
|
||||||
|

|
||||||
|
``` haskell
|
||||||
|
>>> saveDotAsPng "dfa_minimized.png" $ dfaToDot $ minimizeDfa a
|
||||||
|
```
|
||||||
|

|
||||||
|
|
||||||
|
|
|
||||||
10
package.yaml
10
package.yaml
|
|
@ -1,10 +1,10 @@
|
||||||
name: rextra
|
name: rextra
|
||||||
version: 0.1.0.0
|
version: 0.1.0.0
|
||||||
github: "Garmelon/rextra"
|
github: "Garmelon/rextra"
|
||||||
license: BSD3
|
license: MIT
|
||||||
author: "Author name here"
|
author: "Garmelon"
|
||||||
maintainer: "example@example.com"
|
maintainer: "joscha@plugh.de"
|
||||||
copyright: "2019 Author name here"
|
copyright: "2019 Garmelon"
|
||||||
|
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
- README.md
|
- README.md
|
||||||
|
|
@ -23,8 +23,6 @@ dependencies:
|
||||||
- transformers >= 0.5.6 && < 0.6
|
- transformers >= 0.5.6 && < 0.6
|
||||||
- containers >= 0.6 && < 0.7
|
- containers >= 0.6 && < 0.7
|
||||||
- graphviz >= 2999.20 && < 2999.21
|
- graphviz >= 2999.20 && < 2999.21
|
||||||
- fgl >= 5.7 && < 5.8
|
|
||||||
# algebraic-graphs >= 0.4 && < 0.5
|
|
||||||
|
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
|
|
|
||||||
BIN
resources/minimization_example_dfa.png
Normal file
BIN
resources/minimization_example_dfa.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
resources/minimization_example_dfa_minimized.png
Normal file
BIN
resources/minimization_example_dfa_minimized.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Loading…
Add table
Add a link
Reference in a new issue