XHAIL
System for eXtended Hybrid Abductive Inductive Learning
Install / Use
/learn @stefano-bragaglia/XHAILREADME
XHAIL
XHAIL (eXtended Hybrid Abductive Inductive Learning) is a nonmonotonic ILP (Inductive Logic Programming) system that combines deductive (consequence-based), abductive (assumption-based) and inductive (generalisation-based) inference types within a common logical framework.
The system takes a background theory B and a set of examples E as input to return a set of hypotheses H that entail E with respect to B as output. The hypothesis space is constrained by a set of user-defined mode declarations and is filtered by a compression heuristic that prefers hypotheses with fewer literals.

The picture shows the answer to the well-known problem of penguins as computed by XHAIL.
In this problem, we know that penguins are a species of birds.
We have 4 individuals: some birds (a, b and c) and a penguin (d).
This information is called background knowledge, or simply background.
All the evidences show that a and b fly, c is very likely to fly and d is rather likely not to fly.
This information is commonly referred to as examples.
Last but not least, we know that birds typically fly and birds may (or may not) be penguins.
This information is known as mode declarations.
The answer provided by XHAIL suggests that each bird that is not a penguin flies.
The problem is encoded by the following statements:
%% penguins_weighted.lp
%%%%%%%%%%%%%%%%%%%%%%%
#display flies/1.
#display penguin/1.
%% B. Background
bird(X):-penguin(X).
bird(a;b;c).
penguin(d).
%% E. Examples
#example flies(a) @2.
#example flies(b) @2.
#example flies(c) =5 @2.
#example not flies(d) =3 @2.
%% M. Modes
#modeh flies(+bird) :0-100 =4.
#modeb penguin(+bird) :1 @2.
#modeb not penguin(+bird) :3.
%% Answer:
% flies(V1):-not penguin(V1),bird(V1).
Requirements
This repository contains the source code and some dataset with problems for XHAIL. To run these and other problems, the application must be properly compiled and figured. The following sections describe the steps required to use the XHAIL procedure to solve a problem.
Prerequisites
XHAIL is a Java application, thus a Java environment -- or Java Virtual Machine (JVM) -- must be installed on the target machine to run or edit it. There are two kinds of JVMs: Java Runtime Environment (JRE) and Java Development Kit (JDK). If you already have a compiled version of XHAIL and you only want to run the application, just install a JRE. If you want to compile or modify and rebuild XHAIL, you have to install a JDK. We targeted Java 8 (namely Java version 1.8, the most recent version available at the time of publication), to take advantage of the new features that were introduced with this version. With a few minor changes to the source code, the application should also run on older JVMs.
Many operative systems already have a JVM installed. You can check if your machine already has one by running the command java -version from the command line or terminal. If you get the following output, your machine is already equipped with the right version of Java to run XHAIL:
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
If no Java environment is installed or the one available is of the wrong type or version, you need to install a new one. Multiple JVMs can coexist on the same machine. The JVM appropriate for your machine can be downloaded from the Oracle web site. Follow the instructions that you can find there to complete the installation. Even if it is not strictly needed to run the application, it is highly suggested that you set some environment variables for Java. If you need instructions, you can find several guides online with specific instructions for your own operative system.
Obtaining XHAIL
Download XHAIL v0.5.1: xhail.jar
You can obtain XHAIL by downloading it from the above link (you still need to configure it, see below) or by issuing the command git clone https://github.com/stefano-bragaglia/XHAIL.git on the command line or terminal to download and compile the sources. We recommend to use the latter procedure which requires the git tool to be installed on your machine. If it doesn't, you can find the latest git version for your operative system on the official website. Alternatively, you can use one of the several GUI applications for git (there are a few free, open source applications). If you have some problems dealing with git, we recommend to read this simple guide.
Compiling XHAIL
The files in this repository are organised in a hierarchy of folders that is typical of any Apache Maven project. Any tool that supports such a directories structure can be used to compile XHAIL. We specifically use Gradle and we highly recommend you to do the same.
At the time of writing, the stable release of Gradle is 2.0 and it is available here. Unzip the binaries package in a folder of your choice and add an environment variable that points to that location as you should have done for Java. More detailed instructions can be found in the Gradle documentation on the same site. Run the command gradle -version from the command line or terminal. If you get the following output, you have properly configured Gradle on your machine:
------------------------------------------------------------
Gradle 2.0
------------------------------------------------------------
Build time: 2014-07-01 07:45:34 UTC
Build number: none
Revision: b6ead6fa452dfdadec484059191eb641d817226c
Groovy: 2.3.3
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_11 (Oracle Corporation 25.11-b03)
OS: Mac OS X 10.9.4 x86_64
Open a command prompt or a terminal and enter the folder where you downloaded the source code of XHAIL. Be sure to be in the root folder of the project: if the folder contains the file build.gradle, then you are in the proper directory.
Now simply issue the command gradle installApp to build and install XHAIL on you machine.
Be sure to be online because this procedure is going to download a few packages that are required by the application. The procedure might fail if you don't have enough privileges: on Mac or Linux, you can raise your privileges by preceding the above command with sudo and typing your password when requested. On Windows, run the command prompt with administrator privileges by right-clicking on its icon and choosing the appropriate menu item. The procedure will install XHAIL in /usr/local/XHAIL-0.5.1/, so if you wish to change this path, modify the value of destinationDir in build.gradle accordingly.
You should be now able to run XHAIL. Launch the command java -jar /usr/local/XHAIL-0.5.1/xhail.jar --version from the command line or terminal. If you get the following output, the installation completed successfully:
xhail version 0.5.1
Copyright (c) Stefano Bragaglia
Copyright (c) Oliver Ray
GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
'xhail' is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
To save you time when typing the command, we recommend to add the following alias to your shell profile:
alias xhail='java -jar /usr/local/XHAIL-0.5.1/xhail.jar'
so that next time you want to run XHAIL, you can simply type xhail --version. On Windows you can achieve a similar result by creating a batch file xhail.bat which passes all the arguments it receives to XHAIL:
java -jar C:\Program Files\XHAIL-0.5.1\xhail.jar %*
Be sure to save the batch script in a folder which is included in the PATH environment variable.
Modifying XHAIL
This implementation of XHAIL is still young and, even if we did our best to remove any bug, there might still be some. If you find any, please report them and we will do our best to correct them. We highly encourage you to fix them yourself, to experiment with the application and ultimately to contribute to it. If you plan to do so, you might need some additional information about the tools that we used to write XHAIL.
This repository also contains the configuration files for Eclipse, one of the most common and popular Java Integrated Development Environment (IDE). We recommend you to use Eclipse to work on XHAIL. You can download the latest version, Luna which already supports Java 8, from its official web site. Once you downloaded the archive most appropriate for your machine, extract it and simply run the Eclipse application. To start working on XHAIL, just import the source code as a Java project. You might want to move the source files inside Eclipse's workspace directory.
Gradle IDE is a plugin that supports Gradle directly from Eclipse (available here). Minimalist Gradle Editor adds an editor for Gradle files to your Eclipse distribution (available here).
Configuring XHAIL
XHAIL delegates some of the reasoning tasks it performs to an external ASP engine, which is therefore required to make it work properly. The ASP pl
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
research_rules
Research & Verification Rules Quote Verification Protocol Primary Task "Make sure that the quote is relevant to the chapter and so you we want to make sure that we want to have it identifie
groundhog
398Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
