We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,991 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Prolog Help

at the moment I am having a problem with looping back to noun_phrase from np2. I was wondering if someone can help me loop back to nounphrase. Here is some code:

noun_phrase([X|T],(det(X), NP2),Rem):-
det(X),
np2(T,NP2,Rem).

np2([H|T],np2(adj(H),Rest),NP) :- adj(H), np2(T,Rest,Rem), noun_phrase(NP,Rem,_).

I want to loop from np2 back to noun_phrase. I think the code for np2 is wrong as I just hacked it together.

2
Contributors
1
Reply
3 Days
Discussion Span
1 Year Ago
Last Updated
2
Views
Johnathon332
Newbie Poster
8 posts since Apr 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Prolog has not loops. I do not understand what you try to accomplish as we have not any examples of input or expected output.

pyTony
pyMod
Moderator
6,303 posts since Apr 2010
Reputation Points: 879
Solved Threads: 986
Skill Endorsements: 26

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5377 seconds using 2.62MB