LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-29-2009, 07:51 AM   #1
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Rep: Reputation: 30
CLIPS general questions


It goes like this: I'm supposed to learn CLIPS by tomorrow (stupid university) and they gave us no tutorial or courses or books or examples.

My google searching didn't go too well. All I could find is this tutorial:
http://iweb.tntech.edu/bhuguenard/ds...OfContents.htm
Which is great, I got the basic idea of facts and rules.

But, say I have this rule:
(defrule helloworld
=>
(printout t "Hello world!" crlf))

How do I... get it to check it? (Aka actually print Hello world)

Also, that is shown in all tutorials as the method to print. But what are t and crlf?

Another question: does anybody know where I can find any good tutorials, examples or books? I can't seem to find anything.

Thanks for your time and sorry for all the noob questions... Any info or suggestion is welcomed
 
Old 05-29-2009, 08:11 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by Valkyrie_of_valhalla View Post
It goes like this: I'm supposed to learn CLIPS by tomorrow (stupid university) and they gave us no tutorial or courses or books or examples.

My google searching didn't go too well. All I could find is this tutorial:
http://iweb.tntech.edu/bhuguenard/ds...OfContents.htm
Which is great, I got the basic idea of facts and rules.

But, say I have this rule:
(defrule helloworld
=>
(printout t "Hello world!" crlf))

How do I... get it to check it? (Aka actually print Hello world)

Also, that is shown in all tutorials as the method to print. But what are t and crlf?

Another question: does anybody know where I can find any good tutorials, examples or books? I can't seem to find anything.

Thanks for your time and sorry for all the noob questions... Any info or suggestion is welcomed
It's not CLIPS, it's CLISP:

http://clisp.cons.org/
http://en.wikipedia.org/wiki/CLISP
http://clisp.sourceforge.net/propaganda.html
.
 
Old 05-29-2009, 08:20 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by Valkyrie_of_valhalla View Post
It goes like this: I'm supposed to learn CLIPS by tomorrow (stupid university) and they gave us no tutorial or courses or books or examples.
First, I doubt that the university is stupid......

Second, what is the context of an assignment with no reference material and due in 1 day? As is, it does not seem credible. It took me MONTHS to learn C. (Mostly all leaked out now) In a week, I learned a few bits of Python, but it would take several more before I could do anything useful.
 
Old 05-29-2009, 10:41 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian
Posts: 2,396

Rep: Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814Reputation: 814
Quote:
Originally Posted by Sergei Steshenko View Post
Um, if you look at the link in the OP:
Quote:
The following six short tutorials will step you through most of the basic information you need in order to use the CLIPS expert system development tool.
Although the syntax does look lisp-like.

Quote:
Originally Posted by Valkyrie_of_valhalla
My google searching didn't go too well. All I could find is this tutorial:
Really? The first result from google for clips is CLIPS: A Tool for Building Expert Systems which appears to be the official page.
Quote:
Originally Posted by CLIPS user guide
Write to Me

Besides asserting facts in the RHS of rules, you also can print out information using the printout function. CLIPS also has a carriage return/linefeed keyword called crlf which is very useful in improving the appearance of output by formatting it on different lines. For a change, the crlf is not included in parentheses. As an example,



CLIPS> (defrule duck

(animal-is duck)

=>

(printout t "quack" crlf)) ; Be sure to type in the "t"

==> Activation 0 duck: f-1

CLIPS> (run)

quack

CLIPS>



The output is the text within the double quotes. Be sure to type the letter "t" following the printout command. This tells CLIPS to send the output to the standard output device of your computer. Gen*erally, the standard output device is your terminal (hence the letter "t" after printout.) However, this may be rede*fined so that the standard output device is some other device, such as a modem or disk.
 
Old 05-29-2009, 10:54 AM   #5
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Original Poster
Rep: Reputation: 30
Thanks for your quick answers

Erm... just that it's not CLISP, it really is CLIPS: http://en.wikipedia.org/wiki/CLIPS

And yes, my university is stupid.

In the first year, we had a course for learning C. In the first course, the teacher gave us a paper with the basic key words, loops, etc, and then the next day we had a laboratory where we had to program in C. I already knew it, but for some group mates who saw it for the first time, it was pretty hard. We also had a course about matlab. The course talked only about math algorithms, and at the lab, they gave us a paper with the basic structures, and "ok, read it. You have 5 minutes. Then start solving the exercises" and if you called the assistant for help, it would be like "I don't know, you wrote the program, you should know what's wrong with it!" even if your question is "how do I initialise an array?"

Now we had this course, that is supposed to teach us diffrent ways of programming. We learn weird programming languages. We started with Scheme and Prolog, and yesterday we had the lab... "here is the paper with what CLIPS looks like. We weren't able to install a compiler on this linux, so you'll have to call me and I'll tell you if it works or not! Also, this is your homework for Saturday at midnight." Why weren't they able to install it? No idea, it took 20 seconds to install the program on my box at home...


Either way, I sort of found my answer... you have to do a reset before you run it... aka
(load filename.clp)
(reset)
(run)

And the hello world example works.

Still, any useful links anybody might have are welcomed
 
Old 05-29-2009, 10:59 AM   #6
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Original Poster
Rep: Reputation: 30
Hmm thanks ntubski, somehow I omitted to type in just clips (out of the assumption that i will get mostly websites with movie clips) and tried "clips tutorial" and stuff... My google skills fail me, must be the lack of sleep.

I see they have quite a big documentation on their website, it will make a good read. Thanks again

And yes, from what they told us, clips is something like lisp...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
General Questions FallenEmpire Linux - Newbie 6 07-21-2006 04:44 PM
few more general questions xushi Solaris / OpenSolaris 1 05-16-2005 01:54 AM
some general questions dnraz Fedora 2 09-05-2004 06:17 PM
Some questions in general... kierwind Linux - Newbie 8 07-24-2003 07:36 AM


All times are GMT -5. The time now is 03:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration