Giter Site home page Giter Site logo

comprosoftceo / truthtable Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 67 KB

Boolean Expression Truth Table Builder

License: GNU General Public License v3.0

C++ 79.66% Makefile 3.99% Lex 6.52% Yacc 9.83%
truth-table truth-table-generator truth-tables expression-evaluator expression-parser expression-tree expression-tree-builder expression-parsing expression-trees

truthtable's Introduction

Truth Table

Boolean Expression Truth Table Builder


Compiling

The provided makefile should handle all of the compiling and linking of objects. However, you need to install the Flex Lexer and the Bison Parser, as the app uses Flex and Bison to generate the parser. For Debian Linux distros, this is as simple as:

sudo apt-get install flex
sudo apt-get install bison

Usage

TruthTable <Expression1> <Expression2> ...

  • Expression - The boolean expression to build a truth table for. Each instance of <Expression> will get its own truth table.

Expression

An expression is a series of identifiers or literals connected by operators and parenthesis. For example:

[(a&b) -> (b|~c)] <-> (b!=T)

Identifiers all start with a letter, followed by 0 or more alphanumeric characters. Literals are either T or F (or any of the variations listed below). Unary operators go before an identifier, and binary operators go between an identifier (infix notation).

If you wish to include multiple expressions in a single truth table, each expression should separated by a comma. For example:

(a&b), a->(a&b), [~a<->c]

Note: Although truth tables normally don't list the same expression twice, using this comma notation overrides this rule for the outermost expression. So, it might include a -> (a&b) twice, but not (a&b) twice.


Literal Values

Value Symbols
True True, T, or 1
False False, F, or 1

Note:True and False can be in any case, so TrUe, TRue, and TRUE are all valid.


All Supported Operators

Operation Symbol Type
Not ~ or ! Unary
Or + or | Binary
And & Binary
Exclusive Or ^ Binary
Implies -> Binary
Not Implies ~> or - Binary
If and Only If <-> Binary
Equals = Binary
Not Equals != Binary

More operators may be added in the future

truthtable's People

Contributors

comprosoftceo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

tafoca usiifo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.