haslab / halex Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
The dot file so generated by the functions ndfa2graphviz, dfa2graphviz, ndfa2graphvizfile and dfa2graphvizfile has extra double quotes in initial state, final state and state labels. This dot file thus cannot be directly processed by graphViz using gvedit. We have to manually edit and remove the extra quotes which may be tedious for big programs. A fix is required for this issue either by using some extra code that removes the bugs or changing the functions which generate the files.
I have used some extra code for now to fix it and also made a pull request which solves this issue. Please verify and update the library. It's really helpful!
I have tried using Language.HaLex.FaAsDiGraph and Language.HaLex.Ndfa to generate the dot files but there are no example codes of how to use it.
By this I mean I initially started with my own data type for Ndfa and later I had to convert an instance of my type into an instance of the Ndfa data type defined in the module.
The documentation on hackage just gives you the type definition of Ndfa and of other functions. There are no clear examples of how to use it.
I faced a lot of trouble in converting an instance of my Ndfa data type into an instance of Ndfa type defined in the library. Basically the definition of delta function or transition function is not clear.
data Ndfa st sy = Ndfa [sy] -- Vocabulary
[st] -- Finite set of states
[st] -- The set of start state
[st] -- The set of final states
(st -> Maybe sy -> [st]) -- Transition function
myNdfa :: Ndfa Int Char
myNdfa = Ndfa ['a','b'] [0,1,2,3,4,5] [0] [5] delta
delta :: Int -> Maybe Char -> Int
delta 0 Nothing = [1,3]
delta 1 Just 'a' = [2]
delta 3 Just 'b' = [4]
delta 2 Nothing = [5]
delta 4 Nothing = [5]
delta _ _ = []
In the entire documentation no where it is stated that Nothing corresponds to an Epsilon rule in the documentation. Also it is not mentioned what the resulting list returned by the transition function should be like.
Should it be an epsilon closure of final states reachable from the input state or it should just be the list of final states?
Another important thing is they have not specified for what the input [Char]
is required. Intuitively it makes sense that it should be the file name but this is where it troubles the user, I mean the lack of documentation. Hackage just says to Print a Ndfa in GraphViz use :
ndfa2graphviz :: (Eq sy, Show a, Show sy, Ord a) => Ndfa a sy -> [Char] -> [Char]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.