feat: Implement a mathematical implication

This commit is contained in:
PapaTutuWawa committed 2022-05-13 13:46:41 +02:00
1 parent f92bef517f
commit e24ef0c3d5
5 files changed
+24 -1

No files matched your search

+4
View File
@@ -9,3 +9,7 @@
## 0.1.2
* Add [DeterministicFiniteAutomaton] and [MealyAutomaton]
## 0.1.3
* Add [implies] from the Moxxy main repository
+4
View File
@@ -0,0 +1,4 @@
/// A mathematical implication between [a] and [b] (a -> b);
bool implies(bool a, bool b) {
return !a || b;
}
+1
View File
@@ -2,3 +2,4 @@ library moxlib;
export "awaitabledatasender.dart";
export "automaton.dart";
export "math.dart";
+1 -1
View File
@@ -1,6 +1,6 @@
name: moxlib
description: A collection of code for sharing between various moxxy libraries. Not inteded for outside use.
version: 0.1.2
version: 0.1.3
homepage: https://codeberg.org/moxxy/moxlib
publish_to: https://pub.polynom.me
+14
View File
@@ -0,0 +1,14 @@
import "package:moxlib/math.dart";
import "package:test/test.dart";
void main() {
group("implies", () {
test("Truth table test", () {
expect(implies(true, true), true);
expect(implies(true, false), false);
expect(implies(false, true), true);
expect(implies(false, false), true);
});
});
}