Skip to main content

CLIPS Python bindings

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

clipspy-0.3.2-cp38-cp38-manylinux2010_x86_64.whl (686.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp38-cp38-manylinux1_x86_64.whl (686.3 kB view hashes)

Uploaded CPython 3.8

clipspy-0.3.2-cp37-cp37m-win_amd64.whl (477.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

clipspy-0.3.2-cp37-cp37m-win32.whl (415.2 kB view hashes)

Uploaded CPython 3.7m Windows x86

clipspy-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl (683.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp37-cp37m-manylinux1_x86_64.whl (683.8 kB view hashes)

Uploaded CPython 3.7m

clipspy-0.3.2-cp36-cp36m-win_amd64.whl (477.6 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

clipspy-0.3.2-cp36-cp36m-win32.whl (417.5 kB view hashes)

Uploaded CPython 3.6m Windows x86

clipspy-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl (683.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp36-cp36m-manylinux1_x86_64.whl (683.7 kB view hashes)

Uploaded CPython 3.6m

clipspy-0.3.2-cp35-cp35m-win_amd64.whl (479.6 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

clipspy-0.3.2-cp35-cp35m-win32.whl (417.6 kB view hashes)

Uploaded CPython 3.5m Windows x86

clipspy-0.3.2-cp35-cp35m-manylinux2010_x86_64.whl (684.2 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp35-cp35m-manylinux1_x86_64.whl (684.2 kB view hashes)

Uploaded CPython 3.5m

clipspy-0.3.2-cp34-cp34m-manylinux2010_x86_64.whl (684.1 kB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp34-cp34m-manylinux1_x86_64.whl (684.1 kB view hashes)

Uploaded CPython 3.4m

clipspy-0.3.2-cp27-cp27mu-manylinux2010_x86_64.whl (688.0 kB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp27-cp27mu-manylinux1_x86_64.whl (688.0 kB view hashes)

Uploaded CPython 2.7mu

clipspy-0.3.2-cp27-cp27m-manylinux2010_x86_64.whl (688.0 kB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

clipspy-0.3.2-cp27-cp27m-manylinux1_x86_64.whl (688.0 kB view hashes)

Uploaded CPython 2.7m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page