Partial Recursive Functions for Scripting
Project description
PReFScript:
Partial Recursive Functions for Scripting
Author: Jose L Balcazar, ORCID 0000-0003-4248-4528
Project started: mid Germinal 2003.
Current version: 1.1, late Thermidor 2024.
Copyleft: MIT License (https://en.wikipedia.org/wiki/MIT_License)
A Python-based environment to explore and experiment with partial recursive functions; naturally doubles as a (purely functional) programming language, but it is not intended to be used much as such.
Scripts
In PReFScript, a script is a sequence of functions defined in terms of each
other and of a few basic functions via the partial recursion rules
of composition and minimization. All functions are from the
natural numbers into the natural numbers and may be undefined
for some inputs. In order to handle tuples or sequences of natural
numbers, a Cantor-like encoding is used.
The always available basic functions include:
k_1
, the constant 1 function;
id
, the identity function;
addition and multiplication, add
and mul
respectively,
that interpret the single number received as the Cantor encoding
of a pair <x.y>
and compute the corresponding operation on x
and
y
; modified difference diff
that receives likewise a Cantor-encoded
pair <x.y>
and computes max(0, x - y)
so that we always stay
within the natural numbers; and two functions related to projections
of Cantor-encoded sequences.
Scripts are maintained in objects of the class PReFScript, that can be imported into your own Python program. Alternatively, a stand-alone interpreter is also provided. Thus, you have available two main ways of programming in PReFScript.
Installation and ways to use PReFScript functions
See doc.md for all the details (somewhat incomplete as of today).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file prefscript-1.1.tar.gz
.
File metadata
- Download URL: prefscript-1.1.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ce3f86db10e62219cf7c8fdeeae6a320903f0a9bf47d93c9ff6f7bdf0fcc44a |
|
MD5 | 022cb63fd27384e10e973faca3477c5b |
|
BLAKE2b-256 | 799302465fc500221662cd510fea8800c642e98178358f65d7e64001f0da103f |
File details
Details for the file prefscript-1.1-py3-none-any.whl
.
File metadata
- Download URL: prefscript-1.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700cb591a333bfc716d521da6b9b9879a56e008bd95befd6f23fa77ce6d8b0e7 |
|
MD5 | 2d02575137bc047799e58d828ae33370 |
|
BLAKE2b-256 | 7be6ec101d2e3655f930323469b30fa1740114574da2199c104ccd13397a7f36 |