I've got to implement Prolog in C++ for an assignment. I'm very new to C++, it's a little daunting. Also, I have no idea of where to start. Can someone point me to some basic algorithm and/or some resources online?

Thus far I've got just a text menu system that runs in the console. It allows the user to manage the database (add, remove and view stored facts & rules) and a query database option, which is where the user enters their question.
The rules & facts are stored in vectors.

I need help with the 'unification' algorithm... :eek:

>I've got to implement Prolog in C++ for an assignment.
Let me get this straight. You're new to C++ and you've been given an assignment to write a Prolog interpreter in C++? I find that hard to believe. It's easier to believe that you slacked off for most of your C++ course and now you're feeling the hurt because you don't know jack and you have a challenging project that's due soon.

Umm.... no. I'm in third year Computer Science, and we've covered only Java in the first two years. Now I'm doing a course called Comparative Programming Languages, and I've seen C++ for the first time in mid-March. And yes, I've got to implement Prolog within the next month. Our lecturer seems to be somewhat amused by it. I've got to take it quite seriously, though... CPL is my only compulsory course this semester - if I fail it, I don't get my degree.

But yeah, I seem to know enough C++ to create a simple text menu system, and I suppose the rest (of what I need to know in order to program Prolog, at least) is close enough to Java. I just need some help with the unification algorithm.


Edit- it's just basic Prolog... no lists, data structures, etc.

**mid-Feb, I mean.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.