felix.compiler
Class StaticAnalyzer

java.lang.Object
  extended by felix.compiler.StaticAnalyzer

public class StaticAnalyzer
extends java.lang.Object

The class of static analyzer that parses a given MLN program. It takes as input the whole MLN program, and assign properties to each predicate. Properties include whether a predicate is SYMM, REFLEX, TRANS etc., or whether a clause specifies a CRF chain etc.

Author:
Ce Zhang

Constructor Summary
StaticAnalyzer(FelixQuery _fq, FelixCommandOptions _opt)
          The constructor.
 
Method Summary
 java.util.HashSet<java.util.ArrayList<java.lang.String>> generateAllPermutations(java.util.HashSet<java.lang.String> terms)
          Generates all permutations of the given terms.
 boolean isSymmetric(tuffy.mln.Literal Head, java.util.HashSet<tuffy.mln.Literal> body)
          Returns true if this set of literals is symmetric.
 void parse()
          Analyze the input MLN program and assign properties to each predicate.
 void parseChainRecursiveRelation()
          Parse clause which specifies a CRF chain rule.
 void parseEmbededWeightRule()
          Parse clause whose weights are specified by embedded weight.
 void parseKeyConstraintRelation()
          Parse predicate with key constraints.
 void parseNonRecursiveRelation()
          Parse clause which specifies non-recursive rules.
 void parseOtherRecursiveRelation()
          Parse clause which does NOT specify 1) NON-RECURSIVE rule and 2) Chain rule.
 void parseReflexiveRelation()
          Parse predicate which is reflexive.
 void parseSpecialPredicate()
          Parse the predicate serves as the linear-representation of COREF.
 void parseSymmetricRelation()
          Parse predicate which is symmetric.
 void parseSymmetricRelationPi2P()
          Parse predicate which is symmetric.
 void parseTransitiveRelation()
          Parse predicate which is transitive.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticAnalyzer

public StaticAnalyzer(FelixQuery _fq,
                      FelixCommandOptions _opt)
The constructor.

Parameters:
_fq -
_opt -
Method Detail

parse

public void parse()
Analyze the input MLN program and assign properties to each predicate.


parseSpecialPredicate

public void parseSpecialPredicate()
Parse the predicate serves as the linear-representation of COREF.


parseKeyConstraintRelation

public void parseKeyConstraintRelation()
Parse predicate with key constraints.


generateAllPermutations

public java.util.HashSet<java.util.ArrayList<java.lang.String>> generateAllPermutations(java.util.HashSet<java.lang.String> terms)
Generates all permutations of the given terms.

Parameters:
terms -
Returns:

isSymmetric

public boolean isSymmetric(tuffy.mln.Literal Head,
                           java.util.HashSet<tuffy.mln.Literal> body)
                    throws java.lang.CloneNotSupportedException
Returns true if this set of literals is symmetric. This set of literals decide a conjunctive query:
body => head
For EXP only!

Parameters:
Head -
body -
Returns:
Throws:
java.lang.CloneNotSupportedException

parseSymmetricRelationPi2P

public void parseSymmetricRelationPi2P()
Parse predicate which is symmetric.


parseSymmetricRelation

public void parseSymmetricRelation()
Parse predicate which is symmetric.


parseReflexiveRelation

public void parseReflexiveRelation()
Parse predicate which is reflexive.


parseTransitiveRelation

public void parseTransitiveRelation()
Parse predicate which is transitive.


parseChainRecursiveRelation

public void parseChainRecursiveRelation()
Parse clause which specifies a CRF chain rule.


parseOtherRecursiveRelation

public void parseOtherRecursiveRelation()
Parse clause which does NOT specify 1) NON-RECURSIVE rule and 2) Chain rule.


parseNonRecursiveRelation

public void parseNonRecursiveRelation()
Parse clause which specifies non-recursive rules.


parseEmbededWeightRule

public void parseEmbededWeightRule()
Parse clause whose weights are specified by embedded weight.