SICStus Prolog zlib Module

Nov 27, 2009

Tags: dev, prolog

For my own purposes I wrote a simple zlib module for SICStus 3. But since it may be useful to others, I have made it available. The module provides three predicates for compressing and uncompressing byte lists:


CompressedByteList just contain the compressed data without any other information. Applications should keep the length of the uncompressed byte list to be able to perform successful decompression.

It is often useful to directly compress very large terms. Such functionality is provided through separate term compression predicates:


The term compression predicates separate goals blocked on term variables from the term, and the term and blocked goals are then written to a buffer using the fastrw module for fast reconstruction. The fastrw representation is then compressed.