home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- trace
- domains
- list = integer*
-
- predicates
- add1(list, list)
-
- clauses
- add1([], []). /* boundary condition */
- add1([Head|Tail], [Head1|Tail1]) :- /* separate the head */
- /* from the rest of the list */
- Head1= Head+1, /* add 1 to the first element */
- add1(Tail, Tail1). /* call element with the rest of the
- list */