GSOC 2008 - PLN - Cesar work log

From OpenCog

Phase 0

Opencog Mac OS 10.4 porting
     Compilation of the open source dependencies
     Create an initial port (workaround) to work on Mac OS
     Main problem is related to the __strtok_r declared within
             #ifdef WIN32 blocks in some places and
             not blocked in other places, since MacOS doesn't have
             it natively, it doesn't compile
     Compilation primitive -stack-protector doesn't work on Mac c++
     Added /opt/local directory inside FindXXX files in dir /lib

Phase 1

Created sub-directory reasoning for the project
Created CMake file to compile the sub-directory
Created a launchpad opencog branch at
     bzr branch lp:~cesar-cs/opencog/main
     very active throughout the Summer
Added FindGSL.cmake and compiled GSL libraries in Mac OS 10.4
Indefinite Probabilities
     Read a number of papers about the Indefinite Probabilities
     Arbitrary number precision using typedefs
     Separate Monte Carlo Sampler from Formulas
             Sampler can receive a function as parameter
             allows flexibility to extend to many different
             Monte Carlo simulation distributions i.e.
             Beta-binomial (the default), Normal, etc.
     Sampler can be set to an arbitrary sampling vector size
     Create a generic FormulaGenerator for SimpleTruthValue and
             IndefiniteTruthValue, template can be configured
             to any formula name, thus no need for special method
             signature for every formula possible
             Didn't test with Simple Truth Values yet
     Separate the diff calculations inside the IndefiniteTruth
             in order to obtain the _upper and _lower
             based on the evidence. Using a simple binary search
             of the integrand that achieves the correct confidence
             interval range
     Changed the precision and test using Mathematica results by
             Matthew Ikle, results agree.
     Designed changes in the consistency check to avoid re-sampling

Phase 2

Studied standard template library STL in-depth
Obtained a reduced copy of the Novamente PLN system
Read the PLN book (cordially shared by the authors
     due to the nature of my contribution)
Study extensively the PLN code
Commented heavily the PLN (63 files, 26453 lines of code)
     to compile under Opencog system, succeed partially to the point
     of Ptlatom.h missing some functions, during linkage
     The result was the base for a second launchpad branch
     (joint work along with Joel Pitt)

Phase 3

Proposed a new design to PLN based on the current understanding
Public discussion with Ari and Joel about the underpinnings of PLN
Working on PLN documentation based on my study of the code
After several code hackings Tester, PLNShell seems to be working
Watched a couple of videos sent by Ari and Ben about PLN usage
Re-checked the PLN XML parsing (seem broken with the tests/XMLs)
Installing Linux on another machine for a better
     cross-compilation and verification w/ Mac OS port
     old-laptop no CD-rom, no floppy-disk and no USB,
     used an unused partition mount with a iso image and boot (success)

Phase 4

Splitting Rules and Formulas
Combining Phase 1 code with the current PLN implementation
Allow PLN to use general OpenCog XML loader instead of it's own special one
Debugging feature using Graphviz (dumpAtomGraph) inside CogServer