954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Programming Prolog in C++

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?

apcxpc
Junior Poster in Training
55 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

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:

apcxpc
Junior Poster in Training
55 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

>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.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

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.

apcxpc
Junior Poster in Training
55 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

**mid-Feb, I mean.

apcxpc
Junior Poster in Training
55 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You