Skip to content

MalteQuandt/BooleanSolver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How to use:

To use the solver in its current state, you declare a string which contains a valid boolean expression (See the EBNF down below). Then you can create the object like so:

BoolSolver identifier = new BoolSolver(stringExpression);

This should print a truth table to the console with the variables that were in the string from left to right being output in the truth table in the opposite order.

If you find a case i have not handled, please write me a message so that i can fix this!

EXP    := TERM {'+' TERM}
TERM   := FACTOR {'*' FACTOR}
FACTOR := VALUE
FACTOR := '!' FACTOR
FACTOR := '(' EXP ')'
VALUE  := 1 | 0 | VARIABLE

Variable is just a simple c-like identifier described with:

[_a-zA-Z][_a-zA-Z0-9]{0,30}

About

A simple program to solve boolean expressions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages