Skip to content
Handwritten Equations Decipherment with Abductive Learning
Python C++ Prolog
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Abductive Learning for Handwritten Equation Decipherment

This is the code repository of the abductive learning framework for handwritten equation decipherment experiments in Bridging Machine Learning and Logical Reasoning by Abductive Learning in NeurIPS 2019.

Environment dependency

This code is only tested in Linux environment.

  1. Swi-Prolog
  2. Python3 with Numpy, Tensorflow and Keras
  3. ZOOpt (as a submodule)

Install Swipl

Install python3

Install required package

#install numpy tensorflow keras
pip3 install numpy
pip3 install tensorflow
pip3 install keras
pip3 install zoopt

Set environment variables(Should change file path according to your situation)

# cd to ABL-HED
git submodule update --init --recursive

export ABL_HOME=$PWD
cp /usr/local/lib/swipl/lib/x86_64-linux/ $ABL_HOME/src/logic/lib/
export LD_LIBRARY_PATH=$ABL_HOME/src/logic/lib
export SWI_HOME_DIR=/usr/local/lib/swipl/

# for GPU user
export LD_LIBRARY_PATH=$ABL_HOME/src/logic/lib:/usr/local/cuda:$LD_LIBRARY_PATH

Install Abductive Learning code

First change the swipl_include_dir and swipl_lib_dir in to your own SWI-Prolog path.

cd src/logic/prolog
python3 install

Demo for arithmetic addition learning

Change directory to ABL-HED, and run equaiton generator to get the training data

cd src/

Run abductive learning code

cd src/


python3 --help

To test the RBA example, please specify the src_data_name and src_data_file together, e.g.,

python --src_data_name random_images --src_data_file


You can’t perform that action at this time.