Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Yupar
  • Order by date
  1. Yupar

    Parsing

    Hi, I am learning grammar and parsing. Here I can parse a very simple sentence "John eats the cat". BUT HOW CAN I EXTEND IT TO PARSE A MORE COMPLICATED SENTENCE LIKE " The wombat on Jane give him". The parts of speech to be covered are: art noun prep pro proper v ("pro" signifies pronoun...
  2. Yupar

    recursive, lists and need help!

    Hi! I got stuck with this problem. When I trace it(trace! in iprolog), I notice that it doesn't loop correctly for Di values. And I have 2 different implementations, i)when Do<Di. ii)when Do>=Di. But when Do>=Di, it doesn't perform the expected action(append..), yet go back to distance...
  3. Yupar

    Tree Height in Prolog

    Hi, How can I write a predicate for tree_height(Tree,Height) that binds Height to the number of nodes on the longest path from the root to a leaf in a binary tree. Trees are represented either "empty" or as "tree(L,Data,R)", where L and R are the left and right are the left and right subtrees...
  4. Yupar

    Prolog..interchanging pairs in the list!

    How can I write a predicate that takes a List like [1,2,3,4,5,6] and binds NewList to a list formed by interchanging pairs of members of the list, so in the example, NewList would be [2,1,4,3,6,5]. If the list has an odd number, then the final one is left unchanged at the end of the NewList...

Part and Inventory Search

Back
Top