CLIPS

Comments Off on CLIPS

A blast from the past!

Here is the classic “Hello World” program in CLIPS (Cognitive Infrastructure for Logic Programming and Situation), a rule-based expert system shell:

(defrule hello-world
  (declare (salience 10)) ; higher salience to match first
  =>
  (printout t "Hello World!~%")
)

Let me explain what’s going on:

  • (defrule starts defining a new rule.
  • hello-world is the name of this rule.
  • (declare (salience 10)) sets the salience of this rule to 10, which means it will match first when multiple rules are applicable. In this case, we only have one rule, so it doesn’t matter much, but it’s a good habit to get into!
  • => indicates the “then” part of the rule.
  • (printout t "Hello World!~%") is the action that gets executed when the rule matches. In this case, we’re simply printing out “Hello World!” followed by a newline character (~%). The t argument means to print the output to the console.

To use this code, save it in a file with a .clp extension (e.g., hello-world.clp) and then load the file into CLIPS using the command-line interface or a GUI frontend. When you run the program, you should see “Hello World!” printed to the console!

Prompt
young woman, beautiful face, standing, great body, gorgeous figure, long legs, pretty eyes, long hair, learns CLIPS programming language, beautiful background, magnificent scenery, Victor Borisov-Musatov style, HD, sharp focus, stunningly beautiful, hyper-detailed, Real estate photography style, Professional, inviting, well-lit, high-resolution, property-focused, commercial, highly detailed

Negative prompt
dark, blurry, unappealing, noisy, unprofessional, extra eyes, bad eyes, ugly eyes, imperfect eyes, deformed pupils, deformed iris, cross-eyed, poorly drawn face, bad face, fused face, ugly face, worst face, unrealistic skin texture, out of frame, poorly drawn hands, cloned face, double face, blurry, bad quality

Text model: llama3

Image model: EventHorizonPictoXL