Skip to main content

CLIPS Python bindings

Project description

Build Status Documentation Status

Python CFFI bindings for CLIPS 6.30

Installation

The CLIPS shared library and headers must be installed within the system.

If library and headers are not in the system default locations, they can be specified to the installer via the CFLAGS and LDFLAGS environment variables.

# CFLAGS="-I<headers path>" LDFLAGS="-L<library path>" pip install pyclips

Documentation

Documentation available on Read The Docs.

Example

from clips import Environment, Symbol

environment = Environment()

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

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

# retrieve a fact template
template = environment.facts.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.facts.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.agenda.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 Distribution

clipspy-0.1.1.tar.gz (20.9 kB view details)

Uploaded Source

File details

Details for the file clipspy-0.1.1.tar.gz.

File metadata

  • Download URL: clipspy-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clipspy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9582460418b5f45c9c7e23f3a2eadb586d6b039e303a097e895ad189878de9c2
MD5 1ca692bbde61f15d06258752ba33a7ae
BLAKE2b-256 05851a489338c1fcbbdb5f785685388a6a69a2d491d7d2726477729cc97d5d3a

See more details on using hashes here.

Supported by

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