Skip to content

levshuster/functional-swipl-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Functional Swipl Interface

A wrapper built on top of the official SWI-Prolog Python interface to iteract with prolog through python using a functional programming paradigm. This wrapper is specifically designed to facilitate programmers with no prior knowledge of logic programming to interact with Prolog

Getting Started

Follow the directions at www.swi-prolog.org/packages/mqi/prologmqi.html to install both swipl and SWIPL's Machine Query Interface

pip install functional-swipl-interface

Usage Example

copy example/email_validation.pro to your local directory

import functional-swipl-interface as SWIPL
print(SWIPL()\
    .load_file("email_validation.pro")\
    .validate_queries("is_valid_email", [
        "abcd@gmail.ghx.com",
        "1234@@ghx.com",
        "abcd1234@ghx",
    ]))
[('abcd@gmail.ghx.com', True), ('1234@@ghx.com', False), ('abcd1234@ghx', False)]

To upload to pypi:

python3 setup.py sdist bdist_wheel
twine upload dist/*

set the username to __token__

set the password to the pypi token

About

A wrapper built on top of the official SWI-Prolog Python interface to iteract with prolog through python using a functional programming paradigm. This wrapper is specifically designed to facilitate programmers with no prior knowledge of logic programming to interact with Prolog

Topics

Resources

License

Stars

Watchers

Forks

Contributors