What is Atom?


Atom is an Inductive Logic Programming (ILP) system written by me (John Ahlgren) to explore various ILP algorithms.


NrSample is an ILP algorithm described in a paper titled "Efficient Program Synthesis using Constraint Satisfaction in Inductive Logic Programming" by me and Professor Shiu Yin Yuen, and is implemented in Atom.


Atom features:

  1. An interactive Prolog environment.
  2. An optimizing Prolog compiler, supporting last call optimization, environment trimming, and various peephole optimizations.
  3. A WAM (Warren Abstract Machine) to execute the instructions, with support for additional ILP features, such as unification, depth limits, and state saving.
  4. Built-in ILP algorithms: Progol A*, enumerative search, NrSample, Minex.
  5. A Chaff like SAT solver using two literal watch and clause learning, with support for ILP clause lengths limits (used by NrSample).


How is Atom Licensed?

Under the "Attribution-NonCommercial-ShareAlike 3.0 Unported".

In short:

  1. You can share and modify it, provided the license stays the same.
  2. When sharing, attribution must be given to me for the original code (simply link to
  3. You cannot use it for any commercial purposes whatsoever (contact me).

Where do I download Atom?

For NrSample, download Atom 3.9 here.


How do I compile Atom?

Easy way, using Microsoft Visual Studio 2012:

  1. Make sure you have C++ Boost installed
  2. Download and extract Atom
  3. Click on solution file "Atom PR.sln"
  4. Include path to your Boost library in the solution.
  5. Click Build -> build solution (Make sure you're building in Release Mode)

More generally way, you'll need:

  1. Boost libraries (I used 1.53), specifically filesystem and iterator.
  2. A fairly C++11 compliant compiler (I used Microsoft Visual Studio 2012).
  3. Define NDEBUG across all files during compilation (this is crucial, as lots of expensive checks will be injected otherwise).

If you're compiling with Visual C++ without using the solution file above, you'll need to turn off "security checks" as the compiler won't be standards compliant otherwise. Also turn on optimization for fast code.


What is NrSample?

NrSample is an ILP algorithm described in J. Ahlgren and S.Y. Yuen, “Efficient program synthesis using constraint satisfaction in inductive logic programming,Journal of Machine Learning Research, vol. 14, pp. 3649-3681, 2013.


Where do I find the benchmarks used for NrSample?

They are included in the source code distribution of Atom 3.9.


How do I run the NrSample benchmarks?

Using a console ("command line"). In Windows, that's "cmd.exe".


First, check that you have the right version: "Atom PR.exe" /V

For NrSample, we used version 3.9: "Atom 3.9".


In windows:

"Atom PR.exe" /N /v 0 /X nrsample "ILP benchmarks\Individual\member"


The result is printed to standard output (the console).



  1. /N makes Atom terminate after experiment (Non-interactive).
  2. /v 0 sets verbosity to 0 (quiet mode). Printing of stuff will slow down the algorithms.
  3. /X performs cross validation: nrsample specifies the algorithm, and then comes the path to folder containing datasets.
  4. Cross validation algorithm options are: nrsample, emulate_nrsample, heuristic (Progol A*), and enumerate.
  5. The folder "Individual" contains the small datasets, "Primitive" contains the large ones.
  6. On non Windows systems: replace '/' with '-' when specifying options.

By default, functional constraints are used. To turn them on/off, use //functional 1 and //functional 0, respectively.


"Atom PR.exe" /N /v 0 //functional 0 /X nrsample "ILP benchmarks\Primitive\member"

"Atom PR.exe" /N /v 0 //functional 1 /X nrsample "ILP benchmarks\Primitive\member"

The first line turns off functional constraints ("NrS"), and the second uses them ("NrSFun").