diff --git a/.gleam.toml.kate-swp b/.gleam.toml.kate-swp new file mode 100644 index 0000000..722aefa Binary files /dev/null and b/.gleam.toml.kate-swp differ diff --git a/README.md b/README.md index 159992b..7496691 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/glemt.gleam b/src/gflap.gleam similarity index 99% rename from src/glemt.gleam rename to src/gflap.gleam index e1b0767..059e37d 100644 --- a/src/glemt.gleam +++ b/src/gflap.gleam @@ -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)) diff --git a/test/gflap_test.gleam b/test/gflap_test.gleam new file mode 100644 index 0000000..8b29db9 --- /dev/null +++ b/test/gflap_test.gleam @@ -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) +} diff --git a/test/glemt_test.gleam b/test/glemt_test.gleam deleted file mode 100644 index 4ba7535..0000000 --- a/test/glemt_test.gleam +++ /dev/null @@ -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) -}