Giter Site home page Giter Site logo

clips_1's Introduction

CLIPS Python bindings

Python CFFI bindings for 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

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 clipspy

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

clips_1's People

Contributors

noxdafox avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.