Hi guys
I need help with my project
I want to write a java code that determine if an expression is tautology or not
e.g.
P v Q -> R
note that:
v is or
-> is implies

i need a help how to start?
do i need a truth table or can i do it without truth table?

hi,

I don't think you need a truth table. you can work with byte and byte array to see if you are getting a tautology or not.

Cheers

thanks for ur help
my project will accept three exps like P v Q -> R
I guess if i wanna do byte and byte array Ill end up with 8 rows array
but sometime I need to do three exps like this P v Q -> P
note that the P is twice in the last
is that means I need 8 rows or 4 rows for the byte and byte array
im confuse

any help will be appreciated

P v Q = P only if Q is 1 or true in all rows.
P v Q = R only if you do int || int and R would be the result.

Try to code something, we'll help you wherever you got stuck..

Cheers

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.