Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

2PPy (tuProlog in Python)

Experimental porting of 2P-Kt on Python, via JPype.

This is a work in progress. 2PPy is not ready for general availability, yet.

Introduction

Object-oriented and modular ecosystem for symbolic AI and logic programming, currently featuring:

  • a module for logic terms and clauses representation, namely tuprolog.core,

  • a module for logic unification, namely tuprolog.unify,

  • a module for in-memory indexing and storing logic theories, as well as other sorts of collections of logic clauses, namely tuprolog.theory,

  • a module providing generic API for resolution of logic queries, namely tuprolog.solve, currently implementing a Prolog solver

  • two parsing modules: one aimed at parsing terms, namely tuprolog.core.parsing, and the other aimed at parsing theories, namely tuprolog.theory.parsing,

  • two serialisation-related modules: one aimed at (de)serialising terms and clauses, namely tuprolog.core.serialize, and the other aimed at (de)serialising terms theories, namely tuprolog.theory.serialize,

  • a module for using Prolog via a command-line interface, namely tuprolog.repl.

How to do stuff

Prerequisites

  1. Install Python 3 (look into the .python-version to know the exact version)

    • I suggest using Pyenv to easily handle multiple Python versions on the same machine
    • Ensure PIP works fine
  2. Install Java (JDK preferred), and ensure the JAVA_HOME variable is correctly set

  3. Ensure Java and Python are both either 64bit or 32bit

  4. If you have installed some prior development version of 2PPy (e.g. tuppy or tuprolog), uninstall them via

    pip uninstall tuppy tuprolog
    

    On Mac OS this may not work as expected. Consider running the following command instead:

    python3 -m pip uninstall tuppy tuprolog
    

How to develop 2PPy

  1. Restore Python dependencies via PIP, by running:

    pip install -r requirements.txt
    

    On Mac OS this may not work as expected. Consider running the following command instead:

    python3 -m pip -r requirements.txt
    
  2. Restore JVM dependencies via download-jars.sh, by running:

    ./download-jars.sh
    

    Notice that this command requires curl and wget to be installed on your system (wget may be lacking on Mac OS and Windows)

How to use 2PPy as a library

  1. Install 2PPy from Pypi by running:

    pip install 2ppy
    

    On Mac OS this may not work as expected. Consider running the following command instead:

    python3 -m pip install 2ppy
    
  2. Import tuprolog.* modules in your Python scripts

  3. Profit

How to use 2PPy as an executable

  1. Install 2PPy from Pypi by running:

    pip install 2ppy
    

    On Mac OS this may not work as expected. Consider running the following command instead:

    python3 -m pip install 2ppy
    
  2. Run tuprolog module via

    python -m tuprolog
    

For the moment, running 2PPy means starting an interactive Python shell with pre-loaded tuprolog.* modules.

Eventually python -m tuprolog will launch a command-line logic solver.

Release files for 2ppy 0.1.8.dev3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 2ppy 0.1.8.dev3
File Size Uploaded
2ppy-0.1.8.dev3.tar.gz 7.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for 2ppy 0.1.8.dev3
File Interpreter ABI Platform
2ppy-0.1.8.dev3-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 MB

Release files / 2ppy-0.1.8.dev3.tar.gz

Download URL 2ppy-0.1.8.dev3.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
b883bde80acdb72a8918b3023cbc5d7ba374eafcdac4e4ee427e74eb0034e7e4
BLAKE2b-256 checksum
How to use checksums
b34e8cb24284c972194793b6926c55b4c9cee6882b799e63eb3620e1298132cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

Release files / 2ppy-0.1.8.dev3-py3-none-any.whl

Download URL 2ppy-0.1.8.dev3-py3-none-any.whl
Size 7.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c3f4c08d7da7263cd3104b3c7bbe8c3899630b313b46d7bf8085639c1b04a6ee
BLAKE2b-256 checksum
How to use checksums
93e52627decdfc798610cda5591cdd71d5be4aef368fbe974a6ea5bd7b23bd8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page