GithubHelp home page GithubHelp logo

pyclips's Introduction

PyCLIPS

This is a reboot of PyCLIPS on GitHub, as git and GitHub have become my favourite tools for developement.

PyCLIPS - a Python module to integrate CLIPS into Python
(c) 2002-2008 Francesco Garosi/JKS

Version 1.0 (release)



RELEASE NOTES
=============

This is a C module embedding CLIPS functionality. To build it, you need to
download the source code for CLIPS, which can be found on its web site, at

    http://clipsrules.sourceforge.net/

(you must follow the link to the download page). Please note that the ZIP
version of the source archive is needed, since the setup procedure unpacks
it by itself. Recent versions of PyCLIPS will try to connect to SourceForge
automatically to download the latest source package supported by PyCLIPS,
but in case it does not work you will have to download it manually. If the
source package is provided, no attempt to connect to the internet will be
made.

The module fully embeds the CLIPS engine, with COOL (Clips Object Oriented
Language) and environments support. It does not require a CLIPS installation
to function. It also supports the file formats produced (and interpreted) by
CLIPS itself. Documentation is provided in source (TeX) format, as a PDF
file and as an HTML tarball.

This is a new stable release of the 1.0 branch. Not all the approved
enhancements have been completed, but all basic module functionality appears
to be working and stable. The test suite is also almost complete and helps
to find possible flaws and weaknesses. From now on I will try to enhance the
module with additional (optional) packages, keeping the base version as
close as possible to the 1.0 stable branch. This release is named 1.0.X.Y
where X is a number indicating the patch level (previously it was preceded
by an 'R') and Y is an incremental value. The change in version numbering
has been introduced in order to disambiguate the version string, so that
setuptools can better decide whether or not to replace a package.

Further beta releases will be named 1.1_nn, where the integer number nn will
increase until the final 1.1 version is reached. The release policies are
the same: only "stable enough" versions will be uploaded to the file release
system, while the SVN repository will also provide possibly unstable changes.



REQUIREMENTS
============

PyCLIPS requires Python 2.4 or higher to work. Recently it has been tested
on Python 2.5. Previous versions of Python are not supported.

PyCLIPS also requires the CLIPS 6.23 or CLIPS 6.24 sources to compile.
Compilation will fail against CLIPS version 6.22 or earlier: although the
CLIPS API is quite stable, there are some improvements at this level in
CLIPS 6.23 which are required for PyCLIPS. If you don't need to stick to
the former CLIPS version, please use CLIPS 6.24: the previous version lacks
some features and PyCLIPS is mostly developed against the more recent
release.

I use GCC 3.x to compile PyCLIPS both on UNIX (Linux and Solaris) and on
Win32. If Python was compiled using Visual C 9.0 (the one released with
Visual Studio 2008 Express) and the Platform SDK, this environment does also
build the module successfully, although with warnings due to deprecation of
insecure functions. Win32 users are encouraged to use the prebuilt package.
PyCLIPS can also be successfully compiled using the free Microsoft Visual
C++ Toolkit 2003. However also this compiler will issue some warnings (see
below) which are mostly safe to ignore.

I do not know other dependencies or requirements to build PyCLIPS, but feel
free to contact me for any annoyance.



INSTALLATION
============


1) from the source
------------------

Installing from the source should be simple, as the module uses distutils
in the usual way. As said before, the setup script will try to download
the CLIPS source code.

The sequence of operations should be as follows:

    $ gunzip -c pyclips-1.0.X.Y.tar.gz | tar xvf -
    $ cd pyclips
    $ python setup.py build
    $ su -c "python setup.py install"

This could not work, and you might still receive a message saying that the
CLIPS source package has not been found: you will need to download it
manually following the instructions on the above mentioned web site, and
copy the package in the base directory of the source tree ('pyclips').

The setup procedure should run out of the box. It has been tested on Linux,
Solaris (with GCC and a self compiled version of Python) and Win32 (using
MinGW 3.1 and MSYS 1.0, as well as some flavours of MS Visual C). Recent
versions of PyCLIPS use setuptools instead of distutils, if found: the
setup script falls back to distutils if setuptools are not installed. The
standard setup procedure will also take care of performing additional steps
such as applying patches to the CLIPS source if possible (see below).

To use setuptools instead of distutils you will have to download the
'ez_setup.py' file from http://peak.telecommunity.com, for instance using
the following command:

    $ wget http://peak.telecommunity.com/dist/ez_setup.py

when you are in the base directory of the source tree ('pyclips'). The
main advantage in using setuptools is that the resulting installation is
less "sparse", and will consist in a single file in your $PYTHONPATH. I
found myself this to be a big advantage. Moreover, recent PyCLIPS binary
distributions will be packaged as "eggs", as I verified that this gives
more compatibility across different Linux distributions: the binaries for
Linux present on SourceForge (as .egg) have been built on a Debian-based
distribution and installed and successfully tested on a Slackware-based
one (respectively: Ubuntu and Zenwalk, even though on Ubuntu I completely
recompiled Python for the build system and debugging).

A small note for MS Visual C users: during compilation the compiler will
warn about not recognizing the '-fno-strict-aliasing' option, but it will
continue the build process anyway: this is not a problem, as Microsoft C
does not try to aggressively optimize code in a way that would be unsafe
for CLIPS. This parameter is necessary for CLIPS when using GCC, as stated
in the CLIPS Advanced Programming Guide for CLIPS 6.24: in fact, omission
of this flag produces a module that might lead to obscure crashes.


2) using the prebuilt installer
-------------------------------

For Win32 I also provide prebuilt packages: to use them, just double-click
the installer you downloaded. It will just find out where Python is located
and copy the module in the right place. If your  distribution supports
setuptools, you might also be able to use the "easy_install" program to
install a prebuilt binary distribution (of the ones whose filenames have a
".egg" extension) suitable to your needs. Linux ".egg" packages may also be
available for some Python versions.



LICENSE
=======

PyCLIPS is released under the Library General Public License (LGPL): a copy
of the license text is included in the manual. Also, if you install the
module, the license text can be viewed by typing:

    >>> import clips
    >>> print clips.license

at the Python prompt. However the license can be found in the usual place,
that is at the GNU's web site (http://www.gnu.org/copyleft/lesser.html).

Please take your time to review the CLIPS license, especially in case the
automatic CLIPS source download succeeds (because if it happens, it means
that you have not read the notice on the CLIPS web site): CLIPS is free for
everyone, but the Author suggests that if you derive any commercial or
monetary benefit from CLIPS, a donation might be appreciated. This applies
to CLIPS only, however: I give my "translation" work for free in the spirit
of the LGPL.



DOCUMENTATION
=============

The documentation can be found on SourceForge, at the PyCLIPS download page.
It is distributed as a single PDF file, generated from the TeX sources that
are included in the source distribution. The PyCLIPS documentation does not
cover the CLIPS language: CLIPS is very well documented, the manuals for
CLIPS are available as PDF on its web site.



PATCHES
=======

Recent versions of PyCLIPS allow the possibility to easily apply optional
patches to the official CLIPS source. Mandatory patches are however always
applied by the setup script at the first build. Optional patches can be
used to solve specific problems on some platforms or to test experimental
bug fixes. At the time of writing there are in fact three patchsets:

    - bgfx: fixes provided by the CLIPS maintainers
    - test: "experimental" bug or annoyance fixes
    - ia64: fixes needed for the x86_64 platforms

Patches marked as "experimental" in fact derive from considerations found
in developer forums and from contributions provided by other developers
after addressing particular issues that were found after the release of
the official CLIPS source. On the other hand, patches written for special
platforms are normally mandatory on those: for example, the "ia64" patch
set is needed to successfully pass the test suite on x86_64 platforms.
The other fixes (marked as "bgfx") should be considered mandatory, as they
have officially been provided (sometimes as files to be replaced) by the
people who invented CLIPS, and will hopefully be removed as soon as the
next CLIPS release is out.

If your system has a working GNU 'patch' command (it can be compiled for
Win32 as well), the setup script will use it to apply all patch sets; in
fact for 32-bit platforms the 'ia64' patchset is optional but not harmful.
The setup script will skip files that have already been patched, that is,
for which a copy of the original file exists: do not attempt to manually
patch the files.



TO DO
=====

Testing thoroughly has to be considered a primary goal. Also, in the same
spirit, writing more tests for the test suite is needed: I will be grateful
to everyone that would volunteer for helping me in this task.

Probably both the C and the Python code in the module need some cleanup.
Also the installation script is quite confused - probably it's not easy to
understand what it does when it "creates the environment-aware submodule".

The documentation is fairly complete, I think. However, if someone speaking
english is reading this, probably she or he will notice that it's definitely
not my mother tongue: even though I asked a friend to help me to find errors
in current manual release, I think that especially for further additions and
integrations I will introduce some clues of my "english illiteracy". So feel
free to comment and criticize documentation as well.

There are also other goals: they will pop up from time to time in the RFE
list of the SourceForge.net PyCLIPS page. As the application I'm writing
using the module goes on, I discover bugs and missing features, as well as
concepts that can be implemented in different ways: every time it happens
I post a request on SourceForge, as an external developer would do. Every
developer with a SourceForge account can do the same, and this is also a
contribution to the project.



ACKNOWLEDGEMENTS
================

I'd like to thank the CLIPS crew for writing CLIPS, putting it in the Public
Domain, and for writing the extensive documentation. And the people at CLIPS
Developer Forum (http://groups.google.com/group/CLIPSESG/) for solving many
of my doubts.

I really have to thank Johan Lindberg (you can visit his blog at the address
http://commentsarelies.blogspot.com/) who also develops the module with me.
His help has been invaluable in testing, finding bugs and inconsistencies,
as well as writing the example suite - it was heavily needed, and his idea
to translate Gary's work for CLIPSJNI into PyCLIPS also gives an opportunity
to compare the two different interfaces.

Also thanks to people who have supported my work, especially Vladimir Ulogov
who also worked on a module like this.

A very big "Thank You" goes to all friends and people who have been near me,
sometimes flooded by my words when I have been speaking about PyCLIPS (and
more generally about computers) in front of some beverage...

I would like as well to thank the people who found either bugs or unexpected
behaviours for helping me in the hard task of finding a solution, as well as
those who showed interest in using PyCLIPS for their projects and extending
it to make it more useful.

I am looking forward to having many people to thank here. :)



CONTACT INFORMATION
===================

I can be reached for suggestions, criticisms and reports about any annoyance
at the following e-mail address:

    franzg -at- users -dot- sourceforge -dot- net

I also have a web site, where I will occasionally write some news about this
module as well:

    http://www.jks.it

Every kind of help is really welcome.

Francesco Garosi


---

$Id: README 343 2008-02-22 01:35:38Z Franz $

pyclips's People

Contributors

almostearthling avatar ubarkai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyclips's Issues

clips.BatchStar() and (batch ...) not working together

I have three files:
1.) A python file test.py:

import clips
PATH_TO_CLP_FILE = r'd:\temp\batch_bug.clp'
clips.BatchStar(PATH_TO_CLP_FILE)
clips.PrintFacts()

2.) A file batch_bug.clp:

(assert (asdf0))
(batch "D:\\temp\\batchbug2.clp")
(assert (asdf1))
(printout t (facts))

And finally a file batchbug2.clp:
(assert (fdsa))

python test.py results in the following output:

f-0     (initial-fact)
f-1     (asdf0)
f-2     (asdf1)
For a total of 3 facts.

[ENVRNMNT8] Environment data not fully deallocated.

[ENVRNMNT8] MemoryAmount = 22.

[ENVRNMNT8] MemoryCalls = 1.

This is not what I expected because there is no "fdsa" fact, i.e. calling (batch "D:\\temp\\batchbug2.clp") did not work. In addition, there are the [ENVRNMNT8] messages. What is going on here?

EDIT:

I found out about the CLIPS batch*(...) command. And using this instead of the batch(...) works as expected. Why is that?

pyclips-1.1_clips-6.30: Large integer errors with Python for Windows 32 bit

I outlined here and especially here how I got pyclips-1.1_clips-6.30 to build on Windows 7 64 bit, both with cygwin/gcc and Visual Studio 2008.

However, as written in the two posts linked above, there are errors regarding large integers with the modules I built with cygwin 32 bit and Visual Studio 2008.

The 32bit Version of clips (installed via the official installer) works fine on my Windows 7 64 bit.

How do I install PyCLIPS based on CLIPS 6.30 on Windows 7 64 bit for use with a 32bit Windows Python 2.7 ?

Error when setting a clips class instance multislot to [ ]

import clips

C = clips.BuildClass("C", "(is-a USER)(multislot s)")
i = clips.BuildInstance("test1", C)
#i.Slots['s'] = clips.Multifield([])  # error
i.Slots['s'] = []  # error
#i.Slots['s'] = clips.Multifield(["1", "4"])  # no error
#i.Slots['s'] = ["1", "4"]  # no error
print i.Slots["s"]

I am getting this error:
_clips.ClipsError: C09: unable to understand argument

Stacktrace:

File "\\VBOXSVR\vagrant\return_empty_list_bug.py", line 6, in <module>
  i.Slots['s'] = [] # error
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 175, in _WRAPPER
  return f(self, *args)
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 269, in _WRAPPER
  return f(self, *newargs)
File "c:\Python27\Lib\site-packages\clips\_clips_wrap.py", line 2506, in __setitem__
  _c.directPutSlot(self.__instance, name, _py2cl(v))

_clips.ClipsError: C09: unable to understand argument

Building pyclips on Windows 10 64 bit with python 3.7 64 bit

I adapted the setup.py to make it run under python3.

Yet, when trying to build it, I get the error below. Any ideas what is wrong?
I am using VisualStudio 2015 tooling.

c:\tmp\pyclips>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 && cd c:\tmp\pyclips && SET DISTUTILS_USE_SDK=1 && SET MSSdk=1 && python setup.py build && python setup.py install
Module 'clips': Python to CLIPS interface
Setup revision: $Id: setup.py 342 2008-02-22 01:17:23Z Franz $
finding low-level module symbols... Done!
building environment-aware submodule... Done!
Found CLIPS version: 6.30
Creating version number: Standard setup in progress:
'patch' is not recognized as an internal or external command,
operable program or batch file.
running build
running build_py
copying clips\_eclips_wrap.py -> build\lib.win-amd64-3.7\clips
copying clips\_version.py -> build\lib.win-amd64-3.7\clips
running build_ext
building 'clips._clips' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MT -I.\clipssrc -IC:\Python37\include -IC:\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\\winrt" /Tcclipsmodule.c /Fobuild\temp.win-amd64-3.7\Release\clipsmodule.obj -DPYCLIPS -DCLIPS_MAJOR=6 -DCLIPS_MINOR=30 -DPYCLIPS_MAJOR=1 -DPYCLIPS_MINOR=0 -DPYCLIPS_PATCHLEVEL=7 -DPYCLIPS_INCREMENTAL=343 -DWIN_MVC
clipsmodule.c
c:\tmp\pyclips\loptr.c(77): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned long'
c:\tmp\pyclips\loptr.c(90): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned long'
c:\tmp\pyclips\loptr.c(114): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned long'
c:\tmp\pyclips\loptr.c(121): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned long'
clipsmodule.c(610): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(610): error C2085: 'clips_EnvType': not in formal parameter list
clipsmodule.c(619): warning C4311: 'type cast': pointer truncation from 'char [5]' to 'unsigned long'
clipsmodule.c(619): error C2057: expected constant expression
clipsmodule.c(621): error C2085: 'clips_EnvObject': not in formal parameter list
clipsmodule.c(653): error C2085: 'clips_EnvObject_dealloc': not in formal parameter list
clipsmodule.c(653): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(663): error C2065: 'clips_EnvObject': undeclared identifier
clipsmodule.c(665): error C2065: 'clips_EnvObject_dealloc': undeclared identifier
clipsmodule.c(659): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [12]'
clipsmodule.c(659): error C2099: initializer is not a constant
clipsmodule.c(679): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(679): error C2085: 'clips_DeftemplType': not in formal parameter list
clipsmodule.c(684): error C2085: 'clips_DeftemplObject': not in formal parameter list
clipsmodule.c(692): error C2085: 'clips_DeftemplObject_dealloc': not in formal parameter list
clipsmodule.c(692): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(700): error C2065: 'clips_DeftemplObject': undeclared identifier
clipsmodule.c(702): error C2065: 'clips_DeftemplObject_dealloc': undeclared identifier
clipsmodule.c(696): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [12]'
clipsmodule.c(696): error C2099: initializer is not a constant
clipsmodule.c(716): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(716): error C2085: 'clips_FactType': not in formal parameter list
clipsmodule.c(727): error C2085: 'clips_FactObject': not in formal parameter list
clipsmodule.c(770): error C2085: 'lose_fact': not in formal parameter list
clipsmodule.c(770): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(792): error C2143: syntax error: missing ')' before '*'
clipsmodule.c(792): error C2143: syntax error: missing '{' before '*'
clipsmodule.c(792): error C2059: syntax error: ')'
clipsmodule.c(792): error C2054: expected '(' to follow 'pyenv'
clipsmodule.c(805): error C2143: syntax error: missing ')' before '*'
clipsmodule.c(805): error C2143: syntax error: missing '{' before '*'
clipsmodule.c(805): error C2059: syntax error: ')'
clipsmodule.c(805): error C2054: expected '(' to follow 'pyenv'
clipsmodule.c(818): error C2143: syntax error: missing ')' before '*'
clipsmodule.c(818): error C2143: syntax error: missing '{' before '*'
clipsmodule.c(818): error C2059: syntax error: ')'
clipsmodule.c(818): error C2054: expected '(' to follow 'pyenv'
clipsmodule.c(825): error C2143: syntax error: missing ')' before '*'
clipsmodule.c(825): error C2143: syntax error: missing '{' before '*'
clipsmodule.c(825): error C2059: syntax error: ')'
clipsmodule.c(825): error C2054: expected '(' to follow 'pyenv'
clipsmodule.c(839): error C2143: syntax error: missing ')' before '*'
clipsmodule.c(839): error C2143: syntax error: missing '{' before '*'
clipsmodule.c(839): error C2059: syntax error: ')'
clipsmodule.c(839): error C2054: expected '(' to follow 'pyenv'
clipsmodule.c(968): error C2065: 'clips_FactObject': undeclared identifier
clipsmodule.c(968): error C2059: syntax error: ')'
clipsmodule.c(972): error C2065: 'clips_FactObject': undeclared identifier
clipsmodule.c(972): error C2059: syntax error: ')'
clipsmodule.c(976): error C2065: 'clips_FactObject': undeclared identifier
clipsmodule.c(976): error C2059: syntax error: ')'
clipsmodule.c(977): error C2065: 'clips_FactObject': undeclared identifier
clipsmodule.c(977): error C2059: syntax error: ')'
clipsmodule.c(985): error C2065: 'clips_FactObject': undeclared identifier
clipsmodule.c(981): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [5]'
clipsmodule.c(981): warning C4113: 'void (__cdecl *)(PyObject *)' differs in parameter lists from 'printfunc'
clipsmodule.c(981): warning C4133: 'initializing': incompatible types - from 'void (__cdecl *)(PyObject *)' to 'printfunc'
clipsmodule.c(1001): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1001): error C2085: 'clips_AddressType': not in formal parameter list
clipsmodule.c(1007): error C2085: 'clips_AddressObject': not in formal parameter list
clipsmodule.c(1018): error C2085: 'clips_AddressObject_dealloc': not in formal parameter list
clipsmodule.c(1018): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1026): error C2065: 'clips_AddressObject': undeclared identifier
clipsmodule.c(1028): error C2065: 'clips_AddressObject_dealloc': undeclared identifier
clipsmodule.c(1022): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [8]'
clipsmodule.c(1022): error C2099: initializer is not a constant
clipsmodule.c(1042): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1042): error C2085: 'clips_DeffactsType': not in formal parameter list
clipsmodule.c(1047): error C2085: 'clips_DeffactsObject': not in formal parameter list
clipsmodule.c(1055): error C2085: 'clips_DeffactsObject_dealloc': not in formal parameter list
clipsmodule.c(1055): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1063): error C2065: 'clips_DeffactsObject': undeclared identifier
clipsmodule.c(1065): error C2065: 'clips_DeffactsObject_dealloc': undeclared identifier
clipsmodule.c(1059): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [9]'
clipsmodule.c(1059): error C2099: initializer is not a constant
clipsmodule.c(1079): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1079): error C2085: 'clips_DefruleType': not in formal parameter list
clipsmodule.c(1084): error C2085: 'clips_DefruleObject': not in formal parameter list
clipsmodule.c(1092): error C2085: 'clips_DefruleObject_dealloc': not in formal parameter list
clipsmodule.c(1092): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1100): error C2065: 'clips_DefruleObject': undeclared identifier
clipsmodule.c(1102): error C2065: 'clips_DefruleObject_dealloc': undeclared identifier
clipsmodule.c(1096): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [8]'
clipsmodule.c(1096): error C2099: initializer is not a constant
clipsmodule.c(1116): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1116): error C2085: 'clips_ActivationType': not in formal parameter list
clipsmodule.c(1121): error C2085: 'clips_ActivationObject': not in formal parameter list
clipsmodule.c(1129): error C2085: 'clips_ActivationObject_dealloc': not in formal parameter list
clipsmodule.c(1129): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1137): error C2065: 'clips_ActivationObject': undeclared identifier
clipsmodule.c(1139): error C2065: 'clips_ActivationObject_dealloc': undeclared identifier
clipsmodule.c(1133): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [11]'
clipsmodule.c(1133): error C2099: initializer is not a constant
clipsmodule.c(1153): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1153): error C2085: 'clips_DefglobalType': not in formal parameter list
clipsmodule.c(1158): error C2085: 'clips_DefglobalObject': not in formal parameter list
clipsmodule.c(1166): error C2085: 'clips_DefglobalObject_dealloc': not in formal parameter list
clipsmodule.c(1166): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1174): error C2065: 'clips_DefglobalObject': undeclared identifier
clipsmodule.c(1176): error C2065: 'clips_DefglobalObject_dealloc': undeclared identifier
clipsmodule.c(1170): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [10]'
clipsmodule.c(1170): error C2099: initializer is not a constant
clipsmodule.c(1190): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1190): error C2085: 'clips_DeffunctionType': not in formal parameter list
clipsmodule.c(1195): error C2085: 'clips_DeffunctionObject': not in formal parameter list
clipsmodule.c(1203): error C2085: 'clips_DeffunctionObject_dealloc': not in formal parameter list
clipsmodule.c(1203): error C2143: syntax error: missing ';' before '{'
clipsmodule.c(1211): error C2065: 'clips_DeffunctionObject': undeclared identifier
clipsmodule.c(1213): error C2065: 'clips_DeffunctionObject_dealloc': undeclared identifier
clipsmodule.c(1207): warning C4047: 'initializing': 'Py_ssize_t' differs in levels of indirection from 'char [12]'
clipsmodule.c(1207): error C2099: initializer is not a constant
clipsmodule.c(1227): error C2054: expected '(' to follow 'staticforward'
clipsmodule.c(1227): error C2085: 'clips_DefgenericType': not in formal parameter list
clipsmodule.c(1227): fatal error C1003: error count exceeds 100; stopping compilation
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2

Fail to install PyCLIPS via pip

Collecting pyclips
Using cached https://files.pythonhosted.org/packages/36/2e/30b0ba0c724fb6dba9b96578c6cf0c77d7788c8986f13e67b8c88f5898a7/pyclips-1.0.7.343.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Scrooge\AppData\Local\Temp\pip-install-c9znf61n\pyclips\setup.py", line 29
print "Module 'clips': Python to CLIPS interface"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Module 'clips': Python to CLIPS interface")?
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\Scrooge\AppData\Local\Temp\pip-install-c9znf61n\pyclips\

Python CFFI bindings for CLIPS

Greetings,

few years ago, I wrote a lightweight wrapper for CLIPS API in ctypes to overcome some issues with PyCLIPS (most important a memory leak).

Lately I decided to redo the entire work using Python CFFI which is much simpler and performant. The great advantage of such approach, compared to the standard Python extensions, is the small amount of necessary boilerplate code.

This will make transitions to CLIPS 6.40/6.50 APIs much simpler.

The library borrows a lot from PyCLIPS design but differs in few ways.

  • Python 2, 3 and PyPy support
  • No embedded CLIPS library, use the locally installed one
  • A more Pythonic API (no CamelCase functions, use of properties and generators...)
  • A more modular design
  • Very simple Python-to-CLIPS data conversion model
  • No string commands manipulation, only the C APIs were wrapped

I was wondering if the PyCLIPS community was interested in this project and if we could, one day, merge the efforts.

I just shared the code here.

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.