Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

prolog if and else using cut

Posted on 2008-10-28
8
Medium Priority
?
681 Views
Last Modified: 2008-10-29
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
Comment
Question by:kuntilanak
  • 5
  • 3
8 Comments
 
LVL 27

Accepted Solution

by:
ddrudik earned 1500 total points
ID: 22831335
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
 

Author Comment

by:kuntilanak
ID: 22831408
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
 
LVL 27

Expert Comment

by:ddrudik
ID: 22831448
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:kuntilanak
ID: 22831458
I tried that but never found some really good ones
0
 
LVL 27

Expert Comment

by:ddrudik
ID: 22831479
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
 

Author Comment

by:kuntilanak
ID: 22832044
it's not about homework. it's about a concept.. I was just asking whether it's possible or not
0
 
LVL 27

Expert Comment

by:ddrudik
ID: 22832239
No worries, not sure about other resources then outside of the forum links I provided.
0
 
LVL 27

Expert Comment

by:ddrudik
ID: 22836980
Thanks for the question and the points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Introduction to Processes
Loops Section Overview
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question