[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

prolog if and else using cut

Okay, say that I have one predicate called test, 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?
0
kuntilanak
Asked:
kuntilanak
  • 5
  • 3
1 Solution
 
ddrudikCommented:
kuntilanak, regular expressions might not be what you understand them:
http://en.wikipedia.org/wiki/Regular_expression

They are not related to prolog logic etc.

If you cannot find a prolog forum here at EE, you might try:
http://www.nabble.com/Gnu---Prolog-f1818.html
http://www.tek-tips.com/threadminder.cfm?pid=345
0
 
kuntilanakAuthor Commented:
thanks that really helps as I never were to get any answers regarding prolog here.. if you have any other suggestions of prolog forums, I would really appreciated it
0
 
ddrudikCommented:
The two forum links in my first post are the ones I found, but you could just search the web for "prolog forum" and browse, that's all I did.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
kuntilanakAuthor Commented:
I tried that but never found some really good ones
0
 
ddrudikCommented:
There might not be any, your questions are the first I have heard of prolog.  If this is related to homework possibly ask other students in your class or a TA etc. about prolog resources they might be aware of.
0
 
kuntilanakAuthor Commented:
it's not about homework. it's about a concept.. I was just asking whether it's possible or not
0
 
ddrudikCommented:
No worries, not sure about other resources then outside of the forum links I provided.
0
 
ddrudikCommented:
Thanks for the question and the points.
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now