package swipl
Install
Dune Dependency
Authors
Maintainers
Sources
md5=a4ea377afe5c52496bf445621ad2e02b
sha512=bcb55c99ae6a2308028d813c78e512901e4ab4f1bb6f054a95de044abee9e420ff9100e4bb6e00520977b800039e8e5338739a4b2ace28cbf8961ba415e33230
doc/swipl.swipl/Swipl/Syntax/index.html
Module Swipl.Syntax
Source
The Syntax
module provides a useful set of combinators for constructing prolog terms using idiomatic OCaml syntax.
As the operators in this module shadow common OCaml ones (&&, ||
), typically you want to locally open this module:
Swipl.Syntax.(app ("consult" /@ 1) [! file])
fn /@ arity
mirrors the prolog syntax ./pred/arity
and declares a prolog function named fn
with arity arity
.
Note: If you call this function before initialise
you will segfault.
! atom
creates a prolog term representing the atom atom
.
Note: If you call this function before initialise
you will segfault.
app ?module_ fn args
creates a prolog term that represents the symbolic expression module_:fn(args...)
.
t1 && t2
creates a prolog term that represents the conjunction of two prolog queries - i.e the prolog expression t1,t2
.