Compatibility with PAKCS and KiCS2

This page is for readers who want to run a Curry program or CPM package from PAKCS or KiCS2 on Sprite. It explains what runs unchanged, what runs with a different result, and what Sprite refuses.

Curry programs share code through CPM, the Curry Package Manager; its index lists the published packages. A package may declare external operations: operations that the Curry system implements in its host language instead of in Curry. Several packages declare externals that only PAKCS implements. Sprite implements most of them; it refuses some by design and lacks some that need outside tools.

The dissertation’s semantics is the reference. Sprite supports a language construct or external operation when its set of results does not depend on the schedule or search order. Where PAKCS gives an operation its meaning through left-first search, Sprite raises a named error. PAKCS is evidence, not the definition. The developer notes state the CPM support rule (#262).

What runs unchanged

Curry’s language and standard library provide the shared basis for programs that run unchanged on Sprite. Sprite ships the base 3.4.0 library with its own set functions. The sections below describe set functions and the discipline for global state; later sections describe the limits that can affect a port.

The pinned checks pass for 46 CPM packages. A pass records the check for that package version, not every possible program that uses it. The package table lists the results.

Weak encapsulation by set functions

Set functions preserve the distinction between choices in a function body and choices in its arguments. A set function captures choices in the body. Choices in its arguments stay outside. This is weak encapsulation, as described in the Curry primer:

module Weak where
import Control.SetFunctions
f :: Int -> Int
f x = x ? (x + 1)
main :: [Int]
main = sortValues (set1 f (1 ? 5))

Sprite and PAKCS 3.10.0 both print:

[1,2]
[5,6]

Each outside choice gets its own set. The primer also explains outside failures and captured variables. KiCS2’s manual, section 1.3, page 7 describes set functions as weak encapsulation too.

Global state with Data.Global

Sprite supports Data.Global from the global package under the discipline of that package. Declare a global at the top level and give it a ground initial value. For a temporary global, use its qualified name as the key and a concrete type. The package documentation describes this interface:

module Example where
import Data.Global
counter :: GlobalT Int
counter = globalT "Example.counter" 0

Sprite requires a closed initializer for globalT. If the initializer reaches a caller’s choice, binding or free variable, Sprite raises EvaluationError with the key’s name. A second definition of a key must give the same initial value or raise the same error. One ground value becomes the initial value; no value fails; multiple values raise an error with the key’s name. The developer notes and Release Notes record this rule (#266).

What runs with a different result

These programs are valid input to both systems, but Sprite and PAKCS 3.10.0 produce different output when they run.

A choice at an I/O step

A choice that reaches an I/O step can affect the output before an error. Sprite raises NondetError at that step. The pinned flatcurry-xml exception records this rule as class 2 (#216):

module ChoiceIO where
guarded :: Bool -> IO ()
guarded b = if b then putStrLn "yes" else return ()
main :: IO ()
main = guarded (True ? False)

Sprite prints no yes and reports:

ERROR: non-determinism in monadic actions occurred!

PAKCS prints yes before it reports its error:

yes
ERROR: non-determinism in I/O actions occurred!

What Sprite refuses

Sprite refuses the external operations in these three categories with an error that names the operation and the reason.

Strong encapsulation

Strong encapsulation captures nondeterminism from outside the call too. Sprite refuses the strong-encapsulation externals in the table below because their results depend on evaluation order (class 1). For example, with allvalues 4.0.0:

module Strong where
import Control.AllValues (allValues)
main :: [Int]
main = allValues (1 ? 2)

Sprite reports:

ERROR: Control.AllValues.allValues: not supported by Sprite: strong encapsulation; its results depend on the evaluation order (see https://andyjost.github.io/Sprite/Compatibility.html)

PAKCS 3.10.0 prints:

[1,2]

The package source documents the dependence on rule order. Use set functions when weak encapsulation suits the program. KiCS2’s manual, section 1.3, page 7 describes strong encapsulation through I/O operations and programmable search trees.

Backtrackable global variables

GlobalVariable from global-variables provides global values whose updates follow backtracking. Sprite refuses its externals because their values depend on search order (class 1). For example, a call to prim_writeGVar meets:

ERROR: GlobalVariable.prim_writeGVar: not supported by Sprite: backtrackable global variables; their values depend on the search order (see https://andyjost.github.io/Sprite/Compatibility.html)

Use Data.Global for global state under the discipline above.

PAKCS constraint solvers

The clp-pakcs and clpbool packages expose PAKCS constraint solvers. Sprite refuses their externals because they bind to the Prolog back end of PAKCS (class 4). For example, a call to CLP.R.prim_CLPR_i2f meets:

ERROR: CLP.R.prim_CLPR_i2f: not supported by Sprite: PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS (see https://andyjost.github.io/Sprite/Compatibility.html)

Refused modules and operations

This table lists the refused modules and the scope of each refusal.

This list comes from refusals.py. It applies to missing externals after registered primitive lookup. A module entry covers its missing externals. A named operation entry covers only that operation.

Class

Module

Scope

Reason

Class 1

Control.AllValues

all missing externals

strong encapsulation; its results depend on the evaluation order.

Class 1

Control.Findall

all missing externals

strong encapsulation; its results depend on the evaluation order.

Class 1

Control.Search.SearchTree.Unsafe

all missing externals

strong encapsulation; its results depend on the evaluation order.

Class 1

Control.Search.SearchTree

someSearchTree

strong encapsulation; its results depend on the evaluation order.

Class 1

Control.SearchTree

someSearchTree

strong encapsulation; its results depend on the evaluation order.

Class 1

GlobalVariable

all missing externals

backtrackable global variables; their values depend on the search order.

Class 4

CLP.FD

all missing externals

PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS.

Class 4

CLP.R

all missing externals

PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS.

Class 4

CLPB

all missing externals

PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS.

Class 4

CLPFD

all missing externals

PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS.

Class 4

CLPR

all missing externals

PAKCS constraint solvers; they are bound to the Prolog back end of PAKCS.

CPM packages

This table records the pinned checks for 60 packages from the CPM index dated 2026-11-04, which lists 148 packages. The records contain 46 passes, 13 known exceptions and 1 open entry. The source is index-expected.json; its index SHA256 is 4380eee34d12d0f5be6b80ec07007c2fe09fdf90472ba59e7448a503287e8684.

Each known exception has one of five classes:

  1. Results depend on the schedule or search order, as in strong encapsulation and backtrackable global variables under “What Sprite refuses”.

  2. Sprite applies a stricter rule than PAKCS, as in the choice at an I/O step under “What runs with a different result”.

  3. The package installs a module that the runtime implements, so Sprite refuses that source copy (base and setfunctions).

  4. The package binds a PAKCS constraint solver, whose externals require PAKCS’s Prolog back end (clp-pakcs and clpbool).

  5. An external tool is absent, or the package is broken upstream under PAKCS too.

The open entry is currypp: Contracts times out (#247, caused by #251), and DefaultRules times out (#242). Status lists known defects, such as the functional-pattern sharing defect #251.

Package

Version

Result

Class

Reason / issues

abstract-curry

4.0.0

pass

allvalues

4.0.0

known exception

Class 1

Strong encapsulation is not supported by Sprite: its results depend on the evaluation order.

array

3.0.0

pass

base

3.4.0

known exception

Class 3

The package puts the Prelude and the other runtime-reserved modules on its source path; Sprite refuses a path copy of a reserved module (module rule 2).

bindata

3.0.0

pass

binint

3.1.0

pass

chr-curry

3.2.0

pass

clp-pakcs

3.2.0

known exception

Class 4

PAKCS constraint solvers are not supported by Sprite: they are bound to its Prolog back end.

clpbool

2.0.0

known exception

Class 4

PAKCS constraint solvers are not supported by Sprite: they are bound to its Prolog back end.

combinatorial

3.2.0

pass

containers

3.0.0

pass

contract-prover

4.0.0

pass

coosy

3.1.0

pass

cpm

3.3.0

pass

curry-interface

2.0.1

pass

curry-source

1.3.0

pass

currycheck

4.0.0

pass

currypp

3.2.0

open

#247: IntegratedCode passes all 31 checks; optional SQL integration skips without erd2curry. All five Contracts modules preprocess and compile. The #241 non-determinism error is gone, but the first generated BubbleSort.sort7 check now exceeds the remaining package test budget (1460.1 seconds). A separate BubbleSort-only Contracts run times out at 300 seconds; the direct contracted sort [2,1] prints [1,2], while sort [7,1,6,3,5,4,2] times out at 90 seconds. Reproducer: in examples/Contracts run curry-check -k –nospec –nosource –nodet –deftype=Int BubbleSort. This Contracts evaluation timeout is #247; its cause is #251: a functional-pattern binding loses the sharing of an application that reads the bound variable, so the contract check recomputes it exponentially. DeterministicOperations passes all nine tests. The separate DefaultRules suite analyzes all 14 modules and compiles its test main, passes both BreakWhere checks, and times out at 1800 seconds while evaluating BubbleSort.bsort7 (#242).

db-pakcs

1.0.0

known exception

Class 5

Requires PAKCS-only Prolog database primitives; its metadata also rejects PAKCS 3.10.0.

dimacs

3.0.0

pass

directory

3.0.0

pass

dsdcurry

1.0.0

known exception

Class 5

Imports retired Char and List modules absent from base 3.4.0; PAKCS 3.10.0 fails too after bypassing package compiler metadata.

easycheck

3.2.0

pass

exact-print

2.0.0

pass

failfree

4.0.0

pass

filepath

3.0.0

pass

finite-map

3.0.0

pass

flatcurry

5.0.0

pass

flatcurry-xml

1.0.0

known exception

Class 2

Sprite reports a choice that reaches an I/O step as an error, by design. #216

global

3.2.0

pass

global-variables

1.0.0

known exception

Class 1

Backtrackable global variables are not supported by Sprite: their values depend on the search order.

icurry

3.3.0

pass

inversion

3.0.0

pass

io-extra

3.0.0

pass

json

4.0.0

pass

keydb

3.1.0

pass

plural-arguments

3.1.0

pass

printf

3.0.0

pass

property-prover

2.0.0

pass

queue

3.0.0

pass

redblacktree

3.0.0

pass

regexp

4.1.0

pass

runcurry

3.0.0

pass

rw-data

1.1.0

pass

rw-data-generator

2.0.0

pass

searchtree

3.0.0

known exception

Class 1

Strong encapsulation is not supported by Sprite: its results depend on the evaluation order.

searchtree-unsafe

3.0.0

known exception

Class 1

Strong encapsulation is not supported by Sprite: its results depend on the evaluation order.

setfunctions

3.0.0

known exception

Class 3

The package puts runtime-reserved Control.SetFunctions source on its path; Sprite refuses that path copy (module rule 2).

spicey

4.2.0

pass

string-trie

0.0.2

pass

time

3.0.0

pass

transbooleq

3.3.0

pass

transformers

3.0.0

pass

traversal

3.0.0

pass

ui

1.0.0

known exception

Class 5

Imports retired modules including List and IOExts; PAKCS 3.10.0 fails too after bypassing package compiler metadata.

verify

3.1.0

pass

wui

1.1.0

known exception

Class 5

Imports retired modules including Time; PAKCS 3.10.0 also rejects its required html-2.0.0 dependency after bypassing top-level compiler metadata.

wui2

3.1.0

pass

xml

3.0.0

pass

xmldata

3.0.0

pass