This commit is contained in:
parent
1deb18ef22
commit
d2907bb2e1
@ -1,6 +1,8 @@
|
||||
# glemt
|
||||
# GFLAP
|
||||
|
||||
Computational theory automata, work in progress.
|
||||
Computational theory automata built with Gleam, work in progress.
|
||||
|
||||
Inspired by [JFLAP](https://www.jflap.org/)
|
||||
|
||||
## Development
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
name = "glemt"
|
||||
name = "gflap"
|
||||
version = "1.0.0"
|
||||
|
||||
# Fill out these fields if you intend to generate HTML documentation or publish
|
||||
|
@ -140,7 +140,7 @@ pub fn ends_with_b() -> NFA {
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
io.println("Hello from glemt!")
|
||||
io.println("Hello from gflap!")
|
||||
|
||||
let automaton = even_a()
|
||||
let _ = io.debug(is_dfa(automaton))
|
37
test/gflap_test.gleam
Normal file
37
test/gflap_test.gleam
Normal file
@ -0,0 +1,37 @@
|
||||
import gflap
|
||||
import gleeunit
|
||||
import gleeunit/should
|
||||
|
||||
pub fn main() {
|
||||
gleeunit.main()
|
||||
}
|
||||
|
||||
pub fn nfa_even_a_test() {
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("")
|
||||
|> should.equal(True)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("a")
|
||||
|> should.equal(False)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("aa")
|
||||
|> should.equal(True)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("aaa")
|
||||
|> should.equal(False)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("aaaa")
|
||||
|> should.equal(True)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("aab")
|
||||
|> should.equal(False)
|
||||
|
||||
gflap.even_a()
|
||||
|> gflap.check_string("baabaa")
|
||||
|> should.equal(False)
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import glemt
|
||||
import gleeunit
|
||||
import gleeunit/should
|
||||
|
||||
pub fn main() {
|
||||
gleeunit.main()
|
||||
}
|
||||
|
||||
pub fn nfa_even_a_test() {
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("")
|
||||
|> should.equal(True)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("a")
|
||||
|> should.equal(False)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("aa")
|
||||
|> should.equal(True)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("aaa")
|
||||
|> should.equal(False)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("aaaa")
|
||||
|> should.equal(True)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("aab")
|
||||
|> should.equal(False)
|
||||
|
||||
glemt.even_a()
|
||||
|> glemt.check_string("baabaa")
|
||||
|> should.equal(False)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user