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.
On Linux, CLIPSPy is packaged for x86_64 architectures as a wheel according to PEP-513 guidelines.
Most of the distributions should be supported.
$ [sudo] pip install clipspy
CLIPSPy comes as a wheel for most of the Python versions and architectures.
> 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.
$ sudo make install
Please check the documentation for more information regarding building CLIPSPy from sources.
(slot name (type STRING))
(slot surname (type STRING))
(slot birthdate (type SYMBOL)))
"""environment=clips.Environment()# load constructs into the environment from a fileenvironment.load('constructs.clp')# define a fact templateenvironment.build(DEFTEMPLATE_STRING)# retrieve the fact templatetemplate=environment.find_template('person')# assert a new fact through its templatefact=template.assert_fact(name='John',surname='Doe',birthdate=clips.Symbol('01/01/1970'))# fact slots can be accessed as dictionary elementsassertfact['name']=='John'# execute the activations in the agendaenvironment.run()