PReFScript:
Partial Recursive Functions for Scripting
Author: Jose Luis Balcazar, ORCID 0000-0003-4248-4528
Project started: mid Germinal 2003.
Copyleft: 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.6, late Fructidor 2026. Previous version 1.2 of mid Messidor 2026 is incompatible. Version 2.0.5 still has a (very seldom arising) tiny bug. Please make sure to use 2.0.6.
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.*.
Metadata
Release files for prefscript 2.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prefscript-2.0.6.tar.gz | 20.9 kB | Without provenance | Details for prefscript-2.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prefscript-2.0.6-py3-none-any.whl | Python 3 | none | any | Details for prefscript-2.0.6-py3-none-any.whl |
Total release size: 49.3 kB
Release files / prefscript-2.0.6.tar.gz
| Download URL | prefscript-2.0.6.tar.gz |
|---|---|
| Size | 20.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d09b4210d7befe52a2365f48d800705f827b72c8772b2653a657d0e74eadd8c
|
|
BLAKE2b-256 checksum How to use checksums |
6a8c8b14390982278518160e42f37e05e15180a3c6e06378622fda00601d883e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / prefscript-2.0.6-py3-none-any.whl
| Download URL | prefscript-2.0.6-py3-none-any.whl |
|---|---|
| Size | 28.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1bd65655a4b2a96b4da4039f4ab9d9e5642385ec9a5cc6c059f4522a61a9d24e
|
|
BLAKE2b-256 checksum How to use checksums |
2516fae225896070b9b0c898990bca71978874d00fddc398d1f3398c59b919a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for prefscript 2.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.