Translate an R call to a prolog compound and pretty print it
portray(
query = call("member", expression(X), list(quote(a), "b", 3L, 4, TRUE, expression(Y))),
options = NULL
)
character string with the prolog syntax of the call
an R call. The R call consists of symbols, integers and real numbers, character strings, boolean values, expressions and lists, and other calls. Vectors of booleans, integers, floating point numbers, and strings with length N > 1 are translated to prolog compounds !/N, %/N, #/N and $$/N, respectively. The names can be modified with the options below.
This is a list of options controlling translation from and to prolog.
boolvec (see option rolog.boolvec
, default is !) is the name of the
prolog compound for vectors of booleans.
intvec, realvec, charvec define the compound names for vectors of integers, doubles and strings, respectively (defaults are %, # and $$).
If scalar is TRUE
(default), vectors of length 1 are translated to
scalar prolog elements. If scalar is FALSE
, vectors of length 1 are
also translated to compounds.
The R elements are translated to the following prolog citizens:
numeric -> real (vectors of size N -> #/N)
integer -> integer (vectors -> %/N)
character -> string (vectors -> $$/N)
symbol/name -> atom
expression -> variable
call/language -> compound
boolean -> true, false (atoms)
list -> list
rolog_options()
for fine-grained control over the translation