The following example illustrates a complete structured specification definition (referencing a specification named Partial_Order, which is assumed to declare the sort Elem and the predicate __ < __):
insert(x,nil) = cons(x,nil); |
x < y => insert(x,cons(y,l)) = cons(x,insert(y,l)); |
¬ (x < y) => insert(x,cons(y,l)) = cons(y,insert(x,l)) |
order[__ < __](nil) = nil; |
order[__ < __](cons(x,l)) = insert(x,order[__ < __](l)) |