Predicate Logic - Software Testing

161 Views Asked by At

This is a section from Logic Coverage in Software Testing, I don't understand how the logic of the image below is resolved.

Assuming that the value of b is true, (true <-> b) should resolve to true but the book says it resolves to b. How is this possible?

The same goes for the opposite side, (false <-> b) should result to false.

The point of this is to see how a determines the value of the predicate p.

The book then says the following: "That is, for any value of b, a determines the value of p without regard to the value for b"

What am I missing here?

Thanks.

Book - link

enter image description here

1

There are 1 best solutions below

4
On

He has replaced into the "logical function"

$p := a \leftrightarrow b$

first $TRUE$ in place of $a$, getting $p_{a=TRUE} := TRUE \leftrightarrow b$ and then $FALSE$ in place of $a$, getting $p_{a=FALSE} := FALSE \leftrightarrow b$.

Then he uses the fact that $TRUE \leftrightarrow b$ is equivalent to $b$: check with truth table, and that $FALSE \leftrightarrow b$ is equivalent to $\lnot b$.

Thus:

$p_a := p_{a=TRUE} ⊕ p_{a=FALSE} = b ⊕ \lnot b = TRUE$.