Web Based Expert System Using CLIPS

1,313 views
Skip to first unread message

Prana Adikhrisna

unread,
Oct 18, 2009, 3:59:30 AM10/18/09
to CLIPSESG
Hi, i would like to ask a few question?

1) I want to make a web based expert system, can you tell me which
language/library I can use along with CLIPS/WebCLIPS or any other
library using CLIPS?
2) Can I use a CLIPSNet library in ASP.NET? (It has a server-side C#
code behind the .aspx file)
3) Can anyone suggest any good references/documentations/books for
creating a web based expert system with CLIPS/WebCLIPS?

kiran Shashi

unread,
Oct 18, 2009, 11:48:25 PM10/18/09
to clip...@googlegroups.com

Ari Stopassola Junior

unread,
Oct 19, 2009, 6:47:44 AM10/19/09
to clip...@googlegroups.com
Hello Prana

I use the library for PHP Phlips:
http://phlips.sourceforge.net
I have some examples that could help.
Another possibility is to run Jess code in Java (Web Services).

Bye
Ari Jr.
http://desid.fa.utl.pt/index.php?option=com_content&task=view&id=60&Itemid=101

Prana Adikhrisna

unread,
Oct 20, 2009, 12:32:40 AM10/20/09
to CLIPSESG
Thank you for the suggestion. Where can I get those examples? And also
can you suggest me any good reference/books on developing using
PHLIPS?

Once again, thanks

On Oct 19, 5:47 pm, Ari Stopassola Junior <arijun...@gmail.com> wrote:
> Hello Prana
>
> I use the library for PHP Phlips:http://phlips.sourceforge.net
> I have some examples that could help.
> Another possibility is to run Jess code in Java (Web Services).
>
> Bye
> Ari Jr.http://desid.fa.utl.pt/index.php?option=com_content&task=view&id=60&I...
>
> On Sun, Oct 18, 2009 at 8:59 AM, Prana Adikhrisna
>

Ari Stopassola Junior

unread,
Oct 23, 2009, 9:24:51 AM10/23/09
to clip...@googlegroups.com
Hello Prana

Sorry about late...

1) Instalation
This tutorial is based on the document of my current host (MediaTemple.net):
http://kb.mediatemple.net/questions/1682/Installing+PECL+extensions
You can install from the PECL repository, but the package is outdated
CLIPS - still in version 0.5.0:
http://pecl.php.net/package/clips

Therefore, I recommend getting the source of the latest version of the
extension from the official site.
First, you need to access the server console. Then type:
wget http://phlips.sourceforge.net/downloads/clips-0.5.1.tar.gz
tar -xzf clips-0.5.1.tar.gz
cd clips-0.5.1
phpize5
./configure --with-php-config=/usr/local/php-5.x.x-x/bin/php-config
Obs.: replace php-5.x.x-x the installed version of PHP
make
cp modules/*.so ~/data/lib/php/

Note: if something goes wrong in the creation of the module, add the
directory where you will find the sources and type:
make clean
Redo the whole process with the necessary adjustments.

Edit php.ini and add the lines:
extension_dir = /home/xxxxx/users/.home/data/lib/php
extension = clips-0.5.1.so

Restart the web server, create a test page containing the phpinfo();
and make sure the extension is displayed.

2) Use
View this file:
http://www.de-sid.com/desid.clp
It contains the engine of a quiz.

PHP reads and execute all the rules available on the "agenda".
An example usage would be:
<?php
clips_set_strategy(LEX_STRATEGY);
clips_batch("rules.clp");
clips_load_facts_from_string($_SESSION['facts']);
clips_run();
?>

Each reload, you insert new rules (coming from the session, for
example) and submitt clips of the changes.
For the point of execution of PHP in accordance with the CLIPS I
recommend use global variables:
CLIPS file:
(defglobal ?*rule-triggered* = 0)

PHP file:
$_SESSION['RuleTriggered'] = clips_get_defglobal_value("rule-triggered");

Good luck!
Ari Jr.
http://www.acimainteractive.com
http://desid.fa.utl.pt/index.php?option=com_content&task=view&id=60&Itemid=101

taheri...@gmail.com

unread,
Nov 1, 2015, 12:22:19 PM11/1/15
to CLIPSESG, bp.s...@gmail.com

phlips?


Annie Lo

unread,
Nov 2, 2015, 1:42:04 AM11/2/15
to CLIPSESG
CLIPS has provided a CGI example.
It uses the latest CLIPS with batch command.


On Monday, November 2, 2015 at 1:22:19 AM UTC+8, taheri...@gmail.com wrote:

phlips?


Muhammad Ridzwan

unread,
Jan 6, 2016, 11:46:40 PM1/6/16
to CLIPSESG
Ari 
i want to ask, do you have toturial how to add new rule?

Ari Stopassola Junior

unread,
Jan 7, 2016, 6:20:32 AM1/7/16
to clip...@googlegroups.com
Hello Muhammad

First of all I load the CLIPS code base (clips_batch function), load some extra facts (based on that circumstance through clips_load_facts_from_string), execute (clips_run) and retrieve some new value with clips_get_defglobal_value.
Example:

<?php
//Clear the CLIPS environment
clips_clear();

//Set the conflict resolution strategy
clips_set_strategy(LEX_STRATEGY);

//Load and evaluate the commands stored in rules.clp
clips_batch("rules.clp");

//Position in the beginning
clips_reset();

//Sets the current focus to the specified module
//You must get each module, otherwise they do not load :-(
clips_focus("EXPLANATIONS");
clips_focus("ENABLED");
clips_focus("COLLECTNOTRESPONSE");

//Connect to database and fetch the facts, like:
$facts_DB .= "(resp ".$linha['cod_pergunta']." ".$idx." ".$valor.")\n";
//Load the facts from database to RETE
clips_load_facts_from_string($factos_BD);

//Load the spare fact
clips_assert("(ultima-pergunta ".substr($_SESSION['pergunta_atual'],1).")");

//Execute
clips_run();

//Retrieve the value of a defglobal for use in PHP script
$naorespondidas = clips_get_defglobal_value("MAIN::Perguntas-NaoResp");

//Load some data in PHP session
$_SESSION['perguntas_naoresp'] = clips_get_defglobal_value("MAIN::Perguntas-NaoResp");
?>

If you need some help to compile PHLIPS on version 5.4, 5.5 and 5.6 - use the code available in my tutorial:
https://github.com/stopassola/phlips
Actually I'm working to adapt the extension to PHP7...

Bye
Ari Jr.
BSc, ZCE (PHP 5.3), ZCPE (PHP 5.5), ZFCA (Zend Framework 2), CSM and MCP.
http://www.perito.inf.br
http://www.certificamp.com
(54) 9912 1620

--
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
 
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.

--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe
 
Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
---
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipsesg+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Herminio Paucar

unread,
Apr 9, 2020, 11:40:32 AM4/9/20
to CLIPSESG
Hi Ari.
I need to make an expert system in PHP7,

Can you adapt the PHlips in the PHP7 version?
To unsubscribe from this group and stop receiving emails from it, send an email to clip...@googlegroups.com.

CLIPS Support

unread,
Apr 9, 2020, 1:13:46 PM4/9/20
to CLIPSESG
There hasn't been any activity on PHlilps for years, so if you want it running on PHP7 you will probably have to adapt it yourself.
Reply all
Reply to author
Forward
0 new messages