Previous If-then Tests Next

If-then tests can be done with the operator ->.
It allows tests that specify that if one expression is true, then another must also be true.

Try these sentences on the world All Here Revisted:

Circle(d) -> Square(f)
Square(e) -> Larger(c,f)
Square(e) -> Square(c)
- This is false
Square(c) -> Circle(d)

The last example is true because the -> operator only indicates that IF the first expression is true, the second must also be true. If the first is false, the second may or may not be true, so the result is true.

The if operator is the converse of the -> operator
i.e. the statement
statement1 if statement2
is logically equivalent to the statement
statement2 -> statement1

A similar operator is <->. This indicates that the first expression is true if and only if the second statement is true. In other words, this operator evaluates to true when bothh expressions are true or both expressions are false.
Here are two examples:

Square(e) <-> Triangle(c)
Square(c) <-> Square(d)

The and and or operators have higher precedence than -> and <->. That means that they are evaluated first.

For example, the statement:
Square(d) -> Triangle(c) or Circle(a)
is logically equivalent to only one of these two statements. Which one?
(Square(d) -> Triangle(c)) or Circle(a)
Square(d) -> (Triangle(c) or Circle(a))