Your first program
1
Write the program
Create a file named This query asks: starting from node
reachability.xlog. It declares two relations, lists three
edges, and defines what “reachable” means — including the recursive case, where
reaching Z means you can already reach some Y that has an edge to Z. The
last line, starting with ?-, is the question you want answered.1, which nodes N can I reach?2
Run it
3
Confirm it worked
XLOG prints the answer as a table. Starting from node If you get these three rows, your program ran correctly.
1 you can reach 2, 3,
and 4, so those are the rows you should see:The language reference covers the full surface, and the
repository’s
examples/ directory contains annotated programs for lists and
meta-predicates, magic sets, probabilistic aggregates, approximate inference,
epistemic reasoning (examples/epistemic/), and Python neural-symbolic
training (examples/python/).CLI at a glance
Once your first program runs, the samexlog command gives you other ways to
execute and inspect a program. Each block below is a self-contained example; the
comment says what it is for.
Run a program and compute exact answers:
exact_ddnnf computes exact probabilities; mc estimates them by
Monte Carlo sampling (repeated random trials — faster, approximate):
Next steps
- Installation — supported platform, source builds, PyPI, crates.io, and the CUDA kernel artifact model
- Language reference — types, predicates, rules, modules, UDFs, aggregations, and pragmas