But the use of left recursion in the above program did no harm. Otherwise, the updated list has X at the head and the old List at the tail. The examples we studied were rather too general. Now we will try to put together all these things we have studied so far in order to develop facility in writing programs which can be useful building blocks of accounting information systems. Such structures also resemble predicates with their associated arguments.
Structures are, however, stored in most systems more compactly in memory.
Prolog however provides facilities for converting structures into lists and vice versa. Now let us see how we can use all the things we have learned so far. Suppose you have a database of facts pertaining to the employees in a company. In the real world, this would be rather inefficient since the same data can be stored more compactly as a relational table. However, since our purpose here is to show that what we have learned so far is useful in writing simple routines that can form building blocks of accounting information systems.