PReFScript:
Partial Recursive Functions for Scripting
Author: Jose Luis Balcazar, ORCID 0000-0003-4248-4528
Project started: mid Germinal 2003.
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.
Current version: 2.0.2, late Fructidor 2026. Previous version 1.2 of mid Messidor 2026 is incompatible.
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; see https://github.com/balqui/cantorpairs/blob/main/README.md.
Specifically, 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.
Installation and ways to use PReFScript functions
The usual pip-based process should work. Differently from
previous versions, all functionality in 2.0.* is fully compatible
with a pipx installation. You may need to specify --upgrade
flags, depending on your previous installation. LLMs say that
uv should work as well.
The current version installs a stand-alone interpreter. See doc.md.
The following applied to the previous version 1.2: Scripts were maintained in objects of the class PReFScript, that could be imported into your own Python program. Thus, you had available two main ways of programming in PReFScript. All this does not apply anymore to versions 2.0.*.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prefscript-2.0.2.tar.gz.
File metadata
- Download URL: prefscript-2.0.2.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96c710069d59d69236024b54c264ddc3b3eda403b47db1423b40b16914325f22
|
|
| MD5 |
5264e8918a5886d183c23f4208341556
|
|
| BLAKE2b-256 |
4c440fce816d9a5142f2075dc03db36480e3e941a0795ff06e5eed0db91dcc33
|
File details
Details for the file prefscript-2.0.2-py3-none-any.whl.
File metadata
- Download URL: prefscript-2.0.2-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
416a899017f8bf826b6fd1801d00979be179dfb845e06be358fbbe9d37769268
|
|
| MD5 |
ae16850626650a638d4435382479be9c
|
|
| BLAKE2b-256 |
ef44382c6bd7decc6df63ab932a98741cc5650c555f5f74fb7476f8961a43de7
|