Skip to content

Latest commit

History

58 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Three-valued logic

  • true (1)
  • false (0)
  • unknown (1/2)

Create a formula

importstaticorg.github.trushev.logicenum.formula.Formula.*;
vara = var("a");
varb = var("b");
varf = and(a, b, or(not(a), isNull(b)));
System.out.println(f);
(a & b & (!a | ?b))

Print truth table

vartable = newCsvTruthTable(newSingleTruthTable(f));
System.out.println(table);
a, b, f
0.0, 0.0, 0.0
0.5, 0.0, 0.0
1.0, 0.0, 0.0
0.0, 0.5, 0.0
0.5, 0.5, 0.5
1.0, 0.5, 0.5
0.0, 1.0, 0.0
0.5, 1.0, 0.5
1.0, 1.0, 0.0

About

Three-valued logic's swag

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages