# Predicate

In mathematical logic, a predicate is commonly understood to be a Boolean-valued function. However, we use the extended notion of a logical type instead of Boolean. And a predicate can return three values: true, false, and none (undefined).

To create a predicate within the semantic model, you must type the keyword def. Then the predicate pattern appears. And you can specify the name of the predicate, its arguments, and the body of the predicate, which is a logical expression.

#### Predicate example

def check board(board : ChessBoard) means
check all
var queens = ChessDSL.get queens(board)
for all q1, q2 in queens
not ChessDSL.on one line(q1, q2) and not ChessDSL.on one diagonal(q1, q2)
end
end def