tuffy.main
Class Infer

java.lang.Object
  extended by tuffy.main.Infer
Direct Known Subclasses:
GroundingTest, InferenceTest, Learner, NonPartInfer, PartInfer

public abstract class Infer
extends java.lang.Object

Common routines to inference procedures.


Field Summary
protected  RDB db
          The DB.
protected  DataMover dmover
           
protected  Grounding grounding
          Grounding worker.
protected  MarkovLogicNetwork mln
          The MLN.
protected  CommandOptions options
          Command line options.
 
Constructor Summary
Infer()
           
 
Method Summary
protected  void cleanUp()
          Clean up temporary data: the schema in PostgreSQL and the working directory.
protected  void ground()
          Ground the MLN into an MRF.
protected  void loadMLN(MarkovLogicNetwork mln, RDB adb, CommandOptions opt)
          Load the rules and data of the MLN program.
protected  void setUp(CommandOptions opt)
          Set up MLN inference, including the following steps: 1) loadMLN loadMLN(tuffy.mln.MarkovLogicNetwork, tuffy.db.RDB, tuffy.parse.CommandOptions); 2) store symbols and evidence MarkovLogicNetwork.materializeTables(); 3) run KBMC; 4) apply scoping rules; 5) mark query atoms in the database MarkovLogicNetwork.storeAllQueries().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

db

protected RDB db
The DB.


dmover

protected DataMover dmover

mln

protected MarkovLogicNetwork mln
The MLN.


options

protected CommandOptions options
Command line options.


grounding

protected Grounding grounding
Grounding worker.

Constructor Detail

Infer

public Infer()
Method Detail

ground

protected void ground()
Ground the MLN into an MRF.


setUp

protected void setUp(CommandOptions opt)
Set up MLN inference, including the following steps: 1) loadMLN loadMLN(tuffy.mln.MarkovLogicNetwork, tuffy.db.RDB, tuffy.parse.CommandOptions); 2) store symbols and evidence MarkovLogicNetwork.materializeTables(); 3) run KBMC; 4) apply scoping rules; 5) mark query atoms in the database MarkovLogicNetwork.storeAllQueries().

Parameters:
opt - command line options.

cleanUp

protected void cleanUp()
Clean up temporary data: the schema in PostgreSQL and the working directory.


loadMLN

protected void loadMLN(MarkovLogicNetwork mln,
                       RDB adb,
                       CommandOptions opt)
Load the rules and data of the MLN program. 1) MarkovLogicNetwork.loadPrograms(String[]); 2) MarkovLogicNetwork.loadQueries(String[]); 3) MarkovLogicNetwork.parseQueryCommaList(String); 4) Mark closed-world predicate specified by CommandOptions.cwaPreds; 5) MarkovLogicNetwork.prepareDB(RDB); 6) MarkovLogicNetwork.loadEvidences(String[]).

Parameters:
mln - the target MLN
adb - database object used for this MLN
opt - command line options