Re: Problem with SWI-Prolog
- From: Ligezin <wouterGEENSPAM@xxxxxxxxxx>
- Date: Mon, 30 May 2005 23:34:30 +0200
SRocha schreef in comp.lang.prolog:
> Hi,
>
> I have a doubt in SWI-Prolog. L and C are line and column respectively.
> I want that swi-prolog consider the numeric value of C-1. Is there any
> function to do this.
> the result of the query must be yes.
>
> q(9,8).
> p(L,C) :- q(L,C-1).
>
> ?-p(9,9)
> No
Try this:
q(9,8).
p(L,C):-
D is C - 1,
q(L,D).
?- p(9,9).
Yes
greetz
Wouter
--
http://www.ligezin.be/
.
- References:
- Problem with SWI-Prolog
- From: SRocha
- Problem with SWI-Prolog
- Prev by Date: pedagogic project
- Next by Date: Re: problem with anonymous variables
- Previous by thread: Problem with SWI-Prolog
- Next by thread: Re: Problem with SWI-Prolog
- Index(es):
Relevant Pages
|
|