File "brainfog"

The library permits the execution of certain Prolog goals in a π-WAM backend. The concept of a π-WAM embraces a fusion of a processs (π) calculus a Warren Abstract Machine (WAM). Optimized for speed the WAM is very primitive and currently only supports the ‘$SEQ’/2 control construct, plus rudimentary 32-bit integer arithmethic and between/3.

The predicate emulate/1 allows to run a Prolog goal inside a 100% Prolog emulation of the π-WAM. The predicate execute/[1,2] on the other hand delegates to a virtual machine on the corresponding targets JavaScript, Python and Java. To speed up execution logical threads can be grouped and then run on physical threads.

The following brainfog predicates are provided:

emulate(G):
emulate(G, O):
The predicate succeeds. As a side effect it emulates G on an abstract π-WAM. The only side effects consumed or produced by the π-WAM is their input and output. The binary predicate allows specifying hack options. The following hack options are recognized:

size(S): The total number S of logical threads.

execute(G):
execute(G, O):
The predicate succeeds. As a side effect it runs G on a CPU backend for π-WAM. The only side effects consumed or produced by the π-WAM is their input and output. The binary predicate allows specifying hack options.

Use Privacy (c) 2005-2026 XLOG Technologies AG