Download

kLog sources are distributed under the GPL3 license. The current release may be downloaded from this webpage. The development version can be accessed from the Bitbucket git repository. See install for details on how to install kLog on your system.


 

Install

Dependencies:
  • YAP Prolog 6.2.2 or later. In order to build kLog, the YAP development files must be properly installed. Tabling should be enabled. We use the following to build Yap:
              cd ~/Documents/Software/yap-6.2.2 # or any other directory of your choice
              mkdir $ARCH
              cd $ARCH
              ../configure --with-readline=no --enable-chr --enable-tabling --enable-clpqr --prefix=~/local
              make
              make install
            
  • AUCCalculator is required to perform ROC analysis
  • A Java runtime environment is required for AUCCalculator
Install from sources:
  • Clone/fork or download sources from https://bitbucket.org/paolo-f/klog/.
            cd ~/Documents/Software # or any other directory of your choice
            git clone https://bitbucket.org/paolo-f/klog
            
  • Compile the shared library
            cd klog/src/C
            make
            
    The YAP include directory should be automatically detected, if not edit by hand the variable $YAP_INCLUDE in the Makefile.
  • Inform YAP of the kLog path by adding the following line to $HOME/.yaprc (change $PARENT as appropriate).
              :- add_to_path('$PARENT/klog/src').
            
  • kLog scripts need to include at the beginning
              :- use_module(klog).
            
  • See the documentation for more details.

kLog has been only tested on Linux and MacOS X. Most likely the above procedure also works on Windows under cygwin but we have not tested it.

Editing kLog scripts


kLog scripts are best edited by a Prolog-aware text editor. If you use Emacs the following snippet can be added to your init.el file to highlight kLog special constructs:

;; kLog syntax highlighting
(font-lock-add-keywords
 'prolog-mode
 '(("\\(signature\\)[[:blank:]\n]+\\([a-z0-9_]*\\)(" 1 font-lock-keyword-face)
   ("\\(signature\\)[[:blank:]\n]+\\([a-z0-9_]*\\)(" 2 font-lock-type-face)
   ("\\(begin_domain\\>\\)" 0 font-lock-keyword-face)
   ("\\(end_domain\\>\\)" 0 font-lock-keyword-face)
   ("\\(::\\)" 0 font-lock-keyword-face)
   ("\\(::\\)\\(intensional\\)" 2 font-lock-preprocessor-face)
   ("\\(::\\)\\(extensional\\)" 2 font-lock-preprocessor-face)
   ("\\(::\\)\\(property\\)" 2 font-lock-constant-face)
   ("\\(::\\)\\(self\\)" 2 font-lock-type-face)
   ("\\(::\\)\\([a-z0-9_]*\\)" 2 font-lock-type-face)
   ("\\(@\\)\\([a-z0-9_]*\\)" 0 font-lock-builtin-face)))