Skip to content

jszot/oop-logics

 
 

Repository files navigation

Logical Expressions

Your task is to design the model for logical expressions which can represent propositional logic formulas which uses and, or, not, implies, iff, constants true and false, and named variables like x, y, z.

You have to design your model in such an approach, to allow user to evaluate your expression in some specified valuation which will assign values to named variables. After designing your model, let's fill the FormulaFactory with valid implementation and use it in samples/tests building.

Your classes need to be able to convert themselves to readable representation which should be presented in Main class.

Your second goal is to write brute-force solver for your formulas' model. Your solver should at first collect data about all variables that appear in formula and then try all assignments of true/false to these variables, looking for first assignment for which formula evaluates to true. It should be implemented as Solver class.

Last step is to write a few (at least three) interesting (not trivial) unit tests that will be readable by human and will check if found valuation by Solver is a valid one. If you need some template, how to write unit tests in Java, take a look at your queue tests code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 91.7%
  • Kotlin 8.3%