Skip to main content

Python CFFI bindings for the ‘C’ Language Integrated Production System CLIPS 6.30.

Source:

https://github.com/noxdafox/clipspy

Documentation:

https://clipspy.readthedocs.io

Download:

https://pypi.python.org/pypi/clipspy

Build Status Documentation Status

Initially developed at NASA’s Johnson Space Center, CLIPS is a rule-based programming language useful for creating expert and production systems where a heuristic solution is easier to implement and maintain than an imperative one. CLIPS is designed to facilitate the development of software to model human knowledge or expertise.

CLIPSPy brings CLIPS capabilities within the Python ecosystem.

Installation

Windows

CLIPSPy comes as a wheel for most of the Python versions and architectures. Therefore, it can be installed from Pip.

> pip install clipspy

Linux

Debian and derivates

CLIPS 6.30 is available as Debian package in Unstable.

# apt install libclips libclips-dev
# pip install clipspy

Building from sources

The provided Makefile takes care of retrieving the CLIPS source code and compiling the Python bindings together with it.

$ make
# make install

The following tools are required to build the sources.

  • gcc

  • make

  • wget

  • unzip

  • python

  • python-cffi

The following conditional variables are accepted by the Makefile.

  • PYTHON: Python interpreter to use, default python

  • CLIPS_SOURCE_URL: Location from where to retrieve CLIPS source code archive.

  • SHARED_LIBRARY_DIR: Path where to install CLIPS shared library, default /usr/lib

Example

from clips import Environment, Symbol

environment = Environment()

# load constructs into the environment
environment.load('constructs.clp')

# assert a fact as string
environment.assert_string('(a-fact)')

# retrieve a fact template
template = environment.find_template('a-fact')

# create a new fact from the template
fact = template.new_fact()

# implied (ordered) facts are accessed as lists
fact.append(42)
fact.extend(("foo", "bar"))

# assert the fact within the environment
fact.assertit()

# retrieve another fact template
template = environment.find_template('another-fact')
fact = template.new_fact()

# template (unordered) facts are accessed as dictionaries
fact["slot-name"] = Symbol("foo")

fact.assertit()

# execute the activations in the agenda
environment.run()

Release files for clipspy 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clipspy 0.3.1
File Size Uploaded
clipspy-0.3.1.tar.gz 22.9 kB Details

Release files / clipspy-0.3.1.tar.gz

Download URL clipspy-0.3.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
740f8e65f34628b3bd1139749572031fc0a4aea1913eed84e84b95a1e8d0880d
BLAKE2b-256 checksum
How to use checksums
b23658f51e62e1e2a42e141ecff8f57c51dd6fd394c7af466ebd302cbc3a5793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.5

Release history Release notifications | RSS feed

1.0.6

31 release files

1.0.5

26 release files

1.0.4

22 release files

1.0.3

22 release files

1.0.2

28 release files

1.0.1

20 release files

1.0.0

14 release files

0.3.3

21 release files

This release

0.3.1 This release

1 release file

0.3.0

7 release files

0.2.4

7 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

5 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page