Examples

Here are some examples of valid sentences, together with their intuitive meanings. Try to construct worlds which satisfy them as well as worlds which don't.

\forall x (Red(x) and Triangle(x))
Every object is a red triangle.

\forall x (Red(x) \implies Triangle(x))
Every red object is a triangle.

\forall x (Red(x) \xor Triangle(x))
Every object is either red or a triangle, but not both.

\forall x (Red(x) \implies \exists y ( LeftOf(x,y) ))
For all objects x, if x is red, then there is an object y such that x is left of y. In other words, every red object is to the left of some object. (They don't necessarily have to be in the same row! For that, you'd need to say LeftOf(x,y) and SameRow(x,y).)

\exists x (Red(x))
There is at least one red object.

\forall x (Red(x) \implies \forall y (Red(y) \implies x = y))
There is at most one red object.

\forall x ((Red(x) \implies Triangle(x)) or (Triangle(x) \implies Red(x)))
Tautology! This is always true. Can you see why?


Counterxamples

These don't work, for a variety of reasons.

Code:  Red(x) and Triangle(x)
Error: Undefined variable: x
You've never specified what you mean by x. If you want this proposition to apply to all blocks, you should start with \forall x. Or, if you just want to say that something is red and a triangle, you should start with \exists x. As written, there's no way to tell what you mean, so this is an error.

Code:  \forall x Red(x) \and Triangle(x)
Error: Undefined variable: x
The way parsing rules work, this gets read as (\forall x Red(x)) \and Triangle(x). That is, the \forall part only applies to the Red(x) part. You need to use parentheses, like the first example on this page.

Code:  Red(x
Error: Parse error on line 1:
Red(x
-----^
Expecting '\\vee', '\\implies', '\\bicond', '\\xor', '\\wedge', '(', ')', '=', '\\not', '\\ne', ',', got 'EOF'

Your parentheses aren't balanced and it doesn't know what to do. If you write something like this, the math-symbols version of your sentence will be red.

Code:  \forall x (RightOf(x))
Error: Different numbers of formals and actuals.
This fails because RightOf takes two arguments, not one. You have to say what x is to the right of.

Code:  \forall x (false Red(x) )
Error: Access to non-tuple or record: getfield,Symbol,b1,Symbol,color
This is the same sort of issue as above. false is a 0-arity predicate, meaning it takes no arguments: as written, this is just sticking two truth values (namely, false and Red(x)) next to each other without saying how they are to be related. If you want to say that Red(x) is false, you should use not Red(x).

Code:  \forall x (\not Red(x) )
Error: Error: Parse error on line 1:
\forall x (\not Red(x) )
-----------^
Expecting '\\T', '\\F', '\\neg', '\\forall', '\\exists', '(', 'SYMBOL', got '\\not'

In our code, \not and not don't mean the same thing. Sorry. It's a carryover from TeX; blame Knuth. You probably don't want to use \not anywhere.

Code:  Red(true)
Error: Access to non-tuple or record: getfield,Symbol,b1,Symbol,color
Asserting that 'true' is Red is meaningless. Predicates like Red only take variables as their arguments.

Code:  Red(x \or y)
Error: Access to non-tuple or record: getfield,Symbol,b1,Symbol,color
It might not look it, but you're doing the same thing as above. x refers to a block, but remember, or is a logical connective: so x or y, if it has any meaning at all, is going to be a truth value. And it doesn't make sense to ask whether a truth value is Red. This is the same sort of mistake as writing code (in Python, say) which says x == (y or z) and expecting it to be true if x equals y or x equals z. That might make sense in English, but that's just not what that sentence means in Python - nor in first-order logic.