[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

if and else in prolog in a single rule

From: kuntilanak
Subject: if and else in prolog in a single rule
Date: Wed, 29 Oct 2008 07:31:54 -0700 (PDT)

Say that I have one predicate called test (which just succeds or fails,
returns back yes or no), and I have another predicate called checker,
basically here's what I am trying to do in prolog:

test :- checker(T),  if checker suceeds(i.e, returns yes) then print
bla..bla..bla otherwise
          checker processes the remaining predicates here ........

how can I represent all that in prolog in one single rule of test without
having to declare another test rule for this? Is there anyway I can get
around this?
View this message in context:
Sent from the Gnu - Prolog - Users mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]