SYLLOG.DOC Syllogisms? What's a syllogism? Well, with this program your HP48 will become intelligent! It let's your calculator handle syllogisms like the ones below: Socrates is a man. Man is mortal. (Therefore:) Socrates is mortal. A bird is an animal. An eagle is a bird. An animal is mortal. (Therefore:) An eagle is an animal and (therefore) it is mortal. Just transfer the directory to your HP48G(X). I can't really remember if I used some GX specific UserRPL commands, so if you have a S(X), you'll just have to try it out and see if it works. If it doesn't I'm not responsible. You have been warned... You can start the program with RUN. This little program will ask you for a string and does something with it (we will see what it does a little later). After that it asks for a another string. You stop the program by just pressing ENTER (i.e. by entering ""). You can enter normal English (or even Dutch ;-)) sentences, as long as they follow the following rules: 1) The only verb is "is". 2) Only a subject and an object. 3) For questions, the subject must be one word without spaces in the middle (so use _ as a space in objects consisting of more than one word). This might sound a bit stupid and not very useful, but let me explain what the program does with strings you enter: - It leaves out all characters between ascii code 32 and 65 (thus eliminating things like question marks, full stops, etc). - It converts all lower case letters to upper case (i.e. you don't need to type in lower case letters to get "nice looking sentences" because the first thing the program does is get rid of those lower case letters If you entered a fact the program will first search it's fact database to see if it knows the fact already (either because you already entered it or because it can deduce it from basic facts you already entered). If this is the case it tells you this and does nothing. If it does not know the fact it will enter it into the database. If you entered a question the program will search the database to see if the fact you ask about is in the database (again: either as a basic fact entered before or as a conclusion from other facts). If it is, it will answer your question affirmatively. If not, it just says "I don't know". Even though this program is not one of the most useful I've ever seen (or written for that matter) it sure can be fun to have an "intelligent" calculator around. I will conclude this file with an example conversation with the program. This will assume the database to contain the facts that you will find in the Database variable in the SYLLOG directory. You can clear the database by storing {{}{}} in the variable Database at any time. "Socrates is mortal." I know. (Of course it does; it's one of my examples, right?) "A cow is a mammal." If you say so. "A cow is a herbivore." If you say so. "A cow is an animal." I know. "Is a tiger a predator?" That is correct. "Is a predator a carnivore?" That is correct. "A tiger is a carnivore." I know. "Is Jarno mortal?" I don't know. "Jarno is a man." If you say so. (I should know, shouldn't I!? ;-)) "Is Jarno mortal?" That is correct. (Damn. Well, can't say I didn't know that already.) Of course, I'm an animal too. You can try that one yourself. Have fun with this program! Jarno Peschier, JPSOFT jpeschie@cs.ruu.nl P.S. You can do with this program what you like. All I ask is a little credit for stuff I wrote when you can use it in your own programs. One positive candidate for this kind of recycling could be my association list or dictionary datastructure, I think. I've included it in this ZIP archive as ASSOCLIS.