# compare -- compares two elements in a poset

## Synopsis

• Usage:
r = compare(P, a, b)
• Inputs:
• P, an instance of the type Poset,
• a, , an element of the poset
• b, , an element of the poset
• Outputs:
• r, , whether $a \leq b$ in $P$

## Description

This method determines if two elements are comparable and further if $a$ is less than or equal to $b$ in $P$.

 i1 : P = poset {{a,b},{a,c}}; i2 : compare(P, a, b) o2 = true i3 : compare(P, c, a) o3 = false

If two elements are incomparable, then the result is false.

 i4 : compare(P, b, c) o4 = false

## Ways to use compare :

• "compare(Poset,Thing,Thing)"

## For the programmer

The object compare is .