rules
Class AppRule

java.lang.Object
  extended byrules.Rule
      extended byrules.AppRule
All Implemented Interfaces:
java.lang.Cloneable

public class AppRule
extends Rule


Field Summary
static int ARGS
           
static boolean constsAllowed
           
static boolean crazyDebug
           
static boolean cutExamples
           
static boolean debug
           
static boolean defNoise
           
static int DEICTIC
           
static double epsilon
           
static boolean fixedNoise
           
static boolean globalHash
           
static boolean localCache
           
static double noiseProbBound
           
static int NONE
           
static double penalRatio
           
static boolean ruleNoise
           
static int sampleSize
           
static boolean trim
           
static int varLevel
           
 
Constructor Summary
AppRule()
           
AppRule(Action act, Conj con, java.util.List egs)
           
AppRule(Action act, Conj con, java.util.List refs, java.util.List egs)
           
AppRule(Action act, Conj con, java.util.List refs, java.util.List egs, Lit l, Term t, DeicticRef dr, int o)
           
AppRule(AppRule other)
           
AppRule(java.lang.String r, Lang l)
           
 
Method Summary
 AppRule addLit(Lit lit, java.util.List egs)
           
 AppRule addRefLit(DeicticRef r, Lit l, java.util.List egs)
           
 AppRule addVar(DeicticRef d, java.util.List egs)
           
 AppRule buildRefLit(Var v, Lit l, java.util.List egs)
           
 AppRule buildRefLitPlusContext(Var v, Lit l, java.util.List egs)
           
 void cacheUpdate(java.lang.Object r)
           
 void calcScore()
           
 void calcScoreOld()
           
 void clearCache()
           
 void clearRule()
           
 java.lang.Object clone()
           
 java.util.List cloneRefsReplace(DeicticRef rold, DeicticRef rnew)
           
 void completeRule(AppRule newrule, java.util.List egs)
           
 void considerDebug(Change result, Change tempChange)
           
 Change considerDroppingRule(Change bestChange, AppRuleSet rs)
           
 Change considerNewRule(AppRule rule, Change bestChange, AppRuleSet rs)
           
 Change considerNewRuleList(java.util.List ruleL, Change bestChange, AppRuleSet rs)
           
 java.util.LinkedList contextToRef(Lit l, java.util.List egs)
           
 boolean coversSameExamples(AppRule other)
           
 AppRule createGeneralRule(Action act, java.util.List egs)
           
 void debugSearchOp(AppRule newrule)
           
 AppRule dropLit(Lit lit, java.util.List egs)
           
 AppRule dropRefLit(DeicticRef r, Lit l, java.util.List egs)
           
 AppRule dropVar(DeicticRef r, java.util.List egs)
           
 void fillOutcomeHash(Outcome o)
           
 void findExamples(java.util.List egs)
           
 boolean getCoversSame()
           
 java.util.List getExamples()
           
 Lang getLang()
           
 double getScore()
           
 Change greedyGen(AppRuleSet rs)
           
static void h(int id)
           
 boolean hasExample(Example e)
           
 void help(int id)
           
 void induceOutcomes()
           
 void induceOutcomesNew()
           
 void induceOutcomesOld()
           
 void initCache()
           
 void initCounts()
           
 void initRuleParams()
           
 boolean isUselessOutcome(Outcome o)
           
 Var latestVar(Lit l)
           
 int latestVarLoc(Lit l)
           
 AppRule liftConst(Const c, java.util.List egs)
           
static AppRule makeBadRule()
           
 AppRule makeContextToRef(DeicticRef r, Lit l, java.util.List egs)
           
 void makeInitialOutcomes()
           
 DeicticRef makeRef(java.lang.String name, Const c, Subs s, Example eg)
           
static AppRule makeSpecificAppRule(Example eg)
           
static AppRule makeSpecificDeicticAppRule(Example eg)
           
 AppRule makeSplitVar(Term v, Term c, java.util.List egs)
           
 AppRule moveRange(Lit newlit, Lit oldlit, java.util.List egs)
           
 int numChangedExamples()
           
 boolean outcomeCoversAll(Outcome o, Outcome oldO, java.util.List egs)
           
 boolean outcomeCoversMore(Outcome o, Outcome oldO, java.util.List egs)
           
 boolean outcomeCoversSome(Outcome o, java.util.List egs)
           
 void outcomesApply(Subs s)
           
 void outputCounts()
           
static void outputCounts(java.util.Map cts)
           
 boolean overlaps(java.util.List egs)
           
 AppRule partialClone()
           
 double penalty()
           
 void prepareStub()
           
 AppRule raiseDefaultEg(Example eg, java.util.List egs)
           
 Change randGen(AppRuleSet rs)
           
 int refsActualSize()
           
 int refsSize()
           
 AppRule refToContext(DeicticRef r, Lit l, java.util.List egs)
           
 java.util.Set removeOverlaps(java.util.Set egs)
           
 java.util.LinkedList splitLit(Lit lit, java.util.List egs)
           
 java.util.LinkedList splitLit(Lit lit, Term t, java.util.List egs)
           
 java.util.LinkedList splitRefLit(Lit l, java.util.List egs)
           
 java.util.LinkedList splitRefLit(Lit l, Term t, java.util.List egs)
           
 java.util.LinkedList splitVar(Var v, java.util.List egs)
           
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 void trimContext(java.util.List egs)
           
 AppRule trimRule(AppRule r, Example eg, java.util.List egs)
           
 AppRule trimRuleOld(AppRule r, Example eg, java.util.List egs)
           
 void trimUselessOutcomes()
           
 void trimZeroes()
           
 java.util.List uncoveredExamples(java.util.List egs)
           
 Var unusedVar(Lit l)
           
 boolean varIsDefined(Var v)
           
 boolean varIsUsed(Var v)
           
 
Methods inherited from class rules.Rule
actionName, actionSubs, actionSubs, actionSubsDeictic, actionSubsDeicticList, actionSubsList, actionSubsList, applicable, applicable, applicableList, applicableList, apply, cloneOutcomes, cloneOutcomesWithout, cloneOutcomesWithout, covers, getAction, getConsts, getContext, getDist, getNumPoss, getOutcomes, getRef, getRef, getVAHelper, getValidActions, getVariables, hasLit, hasLitsEquals, hasOutcomeFor, initVariables, lprob, lprob, main, makeSpecificRule, numRefs, refIterator, refNum, toFileString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

varLevel

public static int varLevel

NONE

public static int NONE

ARGS

public static int ARGS

DEICTIC

public static int DEICTIC

defNoise

public static boolean defNoise

constsAllowed

public static boolean constsAllowed

ruleNoise

public static boolean ruleNoise

cutExamples

public static boolean cutExamples

epsilon

public static double epsilon

noiseProbBound

public static double noiseProbBound

sampleSize

public static int sampleSize

trim

public static boolean trim

debug

public static boolean debug

crazyDebug

public static boolean crazyDebug

penalRatio

public static double penalRatio

fixedNoise

public static boolean fixedNoise

localCache

public static boolean localCache

globalHash

public static boolean globalHash
Constructor Detail

AppRule

public AppRule()

AppRule

public AppRule(AppRule other)

AppRule

public AppRule(java.lang.String r,
               Lang l)

AppRule

public AppRule(Action act,
               Conj con,
               java.util.List refs,
               java.util.List egs)

AppRule

public AppRule(Action act,
               Conj con,
               java.util.List refs,
               java.util.List egs,
               Lit l,
               Term t,
               DeicticRef dr,
               int o)

AppRule

public AppRule(Action act,
               Conj con,
               java.util.List egs)
Method Detail

prepareStub

public void prepareStub()

clone

public java.lang.Object clone()
Overrides:
clone in class Rule

makeBadRule

public static AppRule makeBadRule()

partialClone

public AppRule partialClone()

trimRule

public AppRule trimRule(AppRule r,
                        Example eg,
                        java.util.List egs)

trimRuleOld

public AppRule trimRuleOld(AppRule r,
                           Example eg,
                           java.util.List egs)

makeSpecificAppRule

public static AppRule makeSpecificAppRule(Example eg)

makeSpecificDeicticAppRule

public static AppRule makeSpecificDeicticAppRule(Example eg)

initCache

public void initCache()

clearCache

public void clearCache()

calcScoreOld

public void calcScoreOld()

getCoversSame

public boolean getCoversSame()

getLang

public Lang getLang()
Overrides:
getLang in class Rule

outputCounts

public void outputCounts()

outputCounts

public static void outputCounts(java.util.Map cts)

calcScore

public void calcScore()

penalty

public double penalty()

refsSize

public int refsSize()

refsActualSize

public int refsActualSize()

getScore

public double getScore()

getExamples

public java.util.List getExamples()

numChangedExamples

public int numChangedExamples()

h

public static void h(int id)

help

public void help(int id)

fillOutcomeHash

public void fillOutcomeHash(Outcome o)

outcomeCoversSome

public boolean outcomeCoversSome(Outcome o,
                                 java.util.List egs)

outcomeCoversAll

public boolean outcomeCoversAll(Outcome o,
                                Outcome oldO,
                                java.util.List egs)

outcomeCoversMore

public boolean outcomeCoversMore(Outcome o,
                                 Outcome oldO,
                                 java.util.List egs)

trimUselessOutcomes

public void trimUselessOutcomes()

isUselessOutcome

public boolean isUselessOutcome(Outcome o)

induceOutcomes

public void induceOutcomes()

induceOutcomesNew

public void induceOutcomesNew()

makeInitialOutcomes

public void makeInitialOutcomes()

induceOutcomesOld

public void induceOutcomesOld()

initRuleParams

public void initRuleParams()

trimZeroes

public void trimZeroes()

findExamples

public void findExamples(java.util.List egs)

hasExample

public boolean hasExample(Example e)

initCounts

public void initCounts()

outcomesApply

public void outcomesApply(Subs s)

trimContext

public void trimContext(java.util.List egs)

uncoveredExamples

public java.util.List uncoveredExamples(java.util.List egs)

coversSameExamples

public boolean coversSameExamples(AppRule other)

removeOverlaps

public java.util.Set removeOverlaps(java.util.Set egs)

overlaps

public boolean overlaps(java.util.List egs)

randGen

public Change randGen(AppRuleSet rs)

considerDroppingRule

public Change considerDroppingRule(Change bestChange,
                                   AppRuleSet rs)

considerNewRule

public Change considerNewRule(AppRule rule,
                              Change bestChange,
                              AppRuleSet rs)

considerNewRuleList

public Change considerNewRuleList(java.util.List ruleL,
                                  Change bestChange,
                                  AppRuleSet rs)

considerDebug

public void considerDebug(Change result,
                          Change tempChange)

greedyGen

public Change greedyGen(AppRuleSet rs)

cacheUpdate

public void cacheUpdate(java.lang.Object r)

varIsUsed

public boolean varIsUsed(Var v)

varIsDefined

public boolean varIsDefined(Var v)

unusedVar

public Var unusedVar(Lit l)

moveRange

public AppRule moveRange(Lit newlit,
                         Lit oldlit,
                         java.util.List egs)

splitLit

public java.util.LinkedList splitLit(Lit lit,
                                     Term t,
                                     java.util.List egs)

splitLit

public java.util.LinkedList splitLit(Lit lit,
                                     java.util.List egs)

addLit

public AppRule addLit(Lit lit,
                      java.util.List egs)

dropLit

public AppRule dropLit(Lit lit,
                       java.util.List egs)

dropRefLit

public AppRule dropRefLit(DeicticRef r,
                          Lit l,
                          java.util.List egs)

latestVarLoc

public int latestVarLoc(Lit l)

latestVar

public Var latestVar(Lit l)

splitRefLit

public java.util.LinkedList splitRefLit(Lit l,
                                        Term t,
                                        java.util.List egs)

splitRefLit

public java.util.LinkedList splitRefLit(Lit l,
                                        java.util.List egs)

buildRefLitPlusContext

public AppRule buildRefLitPlusContext(Var v,
                                      Lit l,
                                      java.util.List egs)

buildRefLit

public AppRule buildRefLit(Var v,
                           Lit l,
                           java.util.List egs)

addRefLit

public AppRule addRefLit(DeicticRef r,
                         Lit l,
                         java.util.List egs)

refToContext

public AppRule refToContext(DeicticRef r,
                            Lit l,
                            java.util.List egs)

contextToRef

public java.util.LinkedList contextToRef(Lit l,
                                         java.util.List egs)

makeContextToRef

public AppRule makeContextToRef(DeicticRef r,
                                Lit l,
                                java.util.List egs)

splitVar

public java.util.LinkedList splitVar(Var v,
                                     java.util.List egs)

makeSplitVar

public AppRule makeSplitVar(Term v,
                            Term c,
                            java.util.List egs)

dropVar

public AppRule dropVar(DeicticRef r,
                       java.util.List egs)

makeRef

public DeicticRef makeRef(java.lang.String name,
                          Const c,
                          Subs s,
                          Example eg)

addVar

public AppRule addVar(DeicticRef d,
                      java.util.List egs)

liftConst

public AppRule liftConst(Const c,
                         java.util.List egs)

raiseDefaultEg

public AppRule raiseDefaultEg(Example eg,
                              java.util.List egs)

createGeneralRule

public AppRule createGeneralRule(Action act,
                                 java.util.List egs)

clearRule

public void clearRule()

completeRule

public void completeRule(AppRule newrule,
                         java.util.List egs)

debugSearchOp

public void debugSearchOp(AppRule newrule)

cloneRefsReplace

public java.util.List cloneRefsReplace(DeicticRef rold,
                                       DeicticRef rnew)

toString

public java.lang.String toString()
Overrides:
toString in class Rule

toShortString

public java.lang.String toShortString()