A few remarks about Clips70x

60 views
Skip to first unread message

denis.be...@gmail.com

unread,
Oct 19, 2024, 2:16:52 AM10/19/24
to CLIPSESG

A few remarks about Clips70x


I understand that  this is a pre-release version of CLIPS7, but here are nevertheless a few remarks about it. Hope this helps.



1. Basic Programming Guide
It's very nice to have the changes in blue. Its makes it much easier to read only what's new.

It'd be visually nice to have blank lines before the sections and sub-sections (or a different formatting of section and sub-section titles).
It's strange to see the Tables defined (in 14.1) after the functions for using them (in 12.22).



2. Inheritance of deftemplates is excellent news. 

I  hope it doesn't remove the possibility of modifying a deftemplate until a defrule uses it (or now also until another deftemplate inherits from it). This should be made clear in the Basic Programming Guide.

3. Modify versus update
From the Basic Programming Guide, I can't see any difference between "modify" and "update" and I fail to see the point of introducing "update".
One problem with "modify" is, any logical support is lost. This may be the desired behaviour in some cases, but it is problematic in other cases. Of course, "modify" is a basic function whose behaviour mustn't be changed. But I would have expected a new command to allow keeping the logical support. 


4. Tables
It's good news to see some data structures appearing in Clips. However, I don't think the unmutable Tables described in the Basic Programming Guide will be a big game changer. I would have expected means for defining them in a more dynamical way, even if they are unmutable at the end of their definition. In particular, it'd be nice, within the "deftable" command, to allow using a function to define the contents of each row or still better to build the whole Table.


5. Goals
I understand that goals are the main change and the examples are nice but I haven't had the opportunity to use goals in my applications and I have no remarks about them.

.

CLIPS Support

unread,
Oct 21, 2024, 1:13:17 AM10/21/24
to CLIPSESG
On Saturday, October 19, 2024 at 1:16:52 AM UTC-5 denis.be...@gmail.com wrote:

A few remarks about Clips70x


I understand that  this is a pre-release version of CLIPS7, but here are nevertheless a few remarks about it. Hope this helps.


I've never figured out a way to make directories in the repository private, so I've been using the 70x branch as a backup, not a prerelease. There's still a good bit of work to be done before it's ready for beta release.


1. Basic Programming Guide
It's very nice to have the changes in blue. Its makes it much easier to read only what's new.

It'd be visually nice to have blank lines before the sections and sub-sections (or a different formatting of section and sub-section titles).
It's strange to see the Tables defined (in 14.1) after the functions for using them (in 12.22).


I made the sections blue to make it easier for me to see which sections have been updated and what may need additional work, but I was planning on keeping them blue throughout the beta release and then changing them to black for the final release.

 

2. Inheritance of deftemplates is excellent news. 

I  hope it doesn't remove the possibility of modifying a deftemplate until a defrule uses it (or now also until another deftemplate inherits from it). This should be made clear in the Basic Programming Guide.


That's how it works. You can redefine a deftemplate as long as nothing else is referring to it, whether that's a rule, another deftemplate, a function, or something else.

 

3. Modify versus update
From the Basic Programming Guide, I can't see any difference between "modify" and "update" and I fail to see the point of introducing "update".
One problem with "modify" is, any logical support is lost. This may be the desired behaviour in some cases, but it is problematic in other cases. Of course, "modify" is a basic function whose behaviour mustn't be changed. But I would have expected a new command to allow keeping the logical support. 


The update function allows you to preserve logical dependencies since it will only effect patterns that explicitly match a changed slot. The documentation is in a prerelease state so its not complete or fully updated.

CLIPS>
(deftemplate point
   (slot x)
   (slot y))
CLIPS>
(defrule on-x-axis
   (logical (point (y 0)))
   =>
   (assert (on-x-axis)))
CLIPS> (watch facts)
CLIPS> (assert (point (x 3) (y 0)))
==> f-1     (point (x 3) (y 0))
<Fact-1>
CLIPS> (run)
==> f-2     (on-x-axis)
CLIPS> (update 1 (x 6))
<== f-1     (point (x 3) ...)
==> f-1     (point (x 6) ...)
<Fact-1>
CLIPS> (modify 1 (x 8))
<== f-1     (point (x 6) ...)
<== f-2     (on-x-axis)
==> f-1     (point (x 8) ...)
<Fact-1>
CLIPS>
 

4. Tables
It's good news to see some data structures appearing in Clips. However, I don't think the unmutable Tables described in the Basic Programming Guide will be a big game changer. I would have expected means for defining them in a more dynamical way, even if they are unmutable at the end of their definition. In particular, it'd be nice, within the "deftable" command, to allow using a function to define the contents of each row or still better to build the whole Table.

 
I was planning on allowing the use of = within the table to specify that a function call follows (the same way it's used within a pattern).

5. Goals
I understand that goals are the main change and the examples are nice but I haven't had the opportunity to use goals in my applications and I have no remarks about them.


Data driven backward chaining (with automatic goal generation) is really useful for certain types of applications that ask questions: decision trees, diagnosis, recommendation, and classification. Lots of student projects fall into these categories. There's also a lot of academic papers on expert systems for diagnosing plant, animal, and human diseases. The toy examples Towers of Hanoi and Monkey and Bananas show how you can use it for task planning, but I don't know if this is a common usage. You can use goals to solve problems like the farmer's dilemma, traveling salesman, or n-queens, but this is more of a trick of clever goal generation than something you would use to solve a real problem--there's no functionality similar to backtracking in Prolog.
 

denis.be...@gmail.com

unread,
Oct 21, 2024, 2:15:51 AM10/21/24
to CLIPSESG

Thanks for your answer.

Le lundi 21 octobre 2024 à 07:13:17 UTC+2, CLIPS Support a écrit :
On Saturday, October 19, 2024 at 1:16:52 AM UTC-5 denis.be...@gmail.com wrote:

A few remarks about Clips70x


I understand that  this is a pre-release version of CLIPS7, but here are nevertheless a few remarks about it. Hope this helps.


I've never figured out a way to make directories in the repository private, so I've been using the 70x branch as a backup, not a prerelease. There's still a good bit of work to be done before it's ready for beta release.

Ah, my apologies for my too early remarks. As it was public, I hadn't understood this.


 


1. Basic Programming Guide
It's very nice to have the changes in blue. Its makes it much easier to read only what's new.

It'd be visually nice to have blank lines before the sections and sub-sections (or a different formatting of section and sub-section titles).
It's strange to see the Tables defined (in 14.1) after the functions for using them (in 12.22).


I made the sections blue to make it easier for me to see which sections have been updated and what may need additional work, but I was planning on keeping them blue throughout the beta release and then changing them to black for the final release.

Could you always keep them in blue in all the "final" releases, until the next one. For old users of Clips, it really makes it easier to see what's new.


  

2. Inheritance of deftemplates is excellent news. 

I  hope it doesn't remove the possibility of modifying a deftemplate until a defrule uses it (or now also until another deftemplate inherits from it). This should be made clear in the Basic Programming Guide.


That's how it works. You can redefine a deftemplate as long as nothing else is referring to it, whether that's a rule, another deftemplate, a function, or something else.

Exactly what I was hoping for.
If I try to make "on-x-axis" more precise, I find some strange behaviour:

(deftemplate point

   (slot x)

   (slot y))


(defrule on-x-axis

   (logical (point (y ?y&0)))

   (point (x ?x) (y ?y))

   =>

   (assert (on-x-axis ?x ?y))

)


(watch facts)

(assert (point (x 3) (y 0)))

==> f-1     (point (x 3) (y 0))

<Fact-1>


(run)

==> f-2     (on-x-axis 3 0)


(update 1 (x 4))

<== f-1     (point (x 3) ...)

==> f-1     (point (x 4) ...)

<Fact-1>


(facts)

f-1     (point (x 4) (y 0))

f-2     (on-x-axis 3 0)

For a total of 2 facts.


(on-x-axis 3 0) remains valid, as expected.
But, shouldn't (on-x-axis 4 0) have been asserted?

 

4. Tables
It's good news to see some data structures appearing in Clips. However, I don't think the unmutable Tables described in the Basic Programming Guide will be a big game changer. I would have expected means for defining them in a more dynamical way, even if they are unmutable at the end of their definition. In particular, it'd be nice, within the "deftable" command, to allow using a function to define the contents of each row or still better to build the whole Table.

 
I was planning on allowing the use of = within the table to specify that a function call follows (the same way it's used within a pattern).

 Great. At least for me, it solves the problem for the ways I was thinking of using them.

CLIPS Support

unread,
Oct 21, 2024, 4:55:50 PM10/21/24
to CLIPSESG
On Monday, October 21, 2024 at 1:15:51 AM UTC-5 denis.be...@gmail.com wrote:

Thanks for your answer.

Le lundi 21 octobre 2024 à 07:13:17 UTC+2, CLIPS Support a écrit :
On Saturday, October 19, 2024 at 1:16:52 AM UTC-5 denis.be...@gmail.com wrote:

A few remarks about Clips70x


I understand that  this is a pre-release version of CLIPS7, but here are nevertheless a few remarks about it. Hope this helps.


I've never figured out a way to make directories in the repository private, so I've been using the 70x branch as a backup, not a prerelease. There's still a good bit of work to be done before it's ready for beta release.

Ah, my apologies for my too early remarks. As it was public, I hadn't understood this.

No worries. If it can be seen, people are going to take a peek. 

1. Basic Programming Guide
It's very nice to have the changes in blue. Its makes it much easier to read only what's new.

It'd be visually nice to have blank lines before the sections and sub-sections (or a different formatting of section and sub-section titles).
It's strange to see the Tables defined (in 14.1) after the functions for using them (in 12.22).


I made the sections blue to make it easier for me to see which sections have been updated and what may need additional work, but I was planning on keeping them blue throughout the beta release and then changing them to black for the final release.

Could you always keep them in blue in all the "final" releases, until the next one. For old users of Clips, it really makes it easier to see what's new.

 Sure.
You left out a (run) command:

CLIPS> (update 1 (x 4))

<== f-1     (point (x 3) ...)
==> f-1     (point (x 4) ...)
<Fact-1>
CLIPS> (agenda)
0      on-x-axis: f-1,f-1
For a total of 1 activation.
CLIPS> (facts)

f-1     (point (x 4) (y 0))
f-2     (on-x-axis 3 0)
For a total of 2 facts.
CLIPS> (run 1)
==> f-3     (on-x-axis 4 0)
CLIPS> (facts)

f-1     (point (x 4) (y 0))
f-2     (on-x-axis 3 0)
f-3     (on-x-axis 4 0)
For a total of 3 facts.
CLIPS>
Reply all
Reply to author
Forward
0 new messages