Class PredVarInst

java.lang.Object
com.articulate.sigma.PredVarInst

public class PredVarInst extends Object
  • Field Details

    • DOUBLE_PREDICATE_AXIOM

      public static final String DOUBLE_PREDICATE_AXIOM
      See Also:
    • predVarArity

      public static Map<String,Integer> predVarArity
    • debug

      public static boolean debug
    • rejectDoubles

      public static boolean rejectDoubles
    • doublesHandled

      public static boolean doublesHandled
  • Constructor Details

    • PredVarInst

      public PredVarInst()
  • Method Details

    • init

      public static void init()
    • addExplicitTypes

      protected static Map<String,Set<String>> addExplicitTypes(KB kb, Formula input, Map<String,Set<String>> types)
      There are two type conditions: one type condition is extracted from domain expression; second type condition is specifically defined in the antecedent of a rule with an instance or subclass expression
      Parameters:
      kb - the current knowledge base
      input - formula
      types - type condition extracted from domain expression. This is a HashMap in which the keys are predicate variables, and the values are HashSets containing one or more class names that indicate the type constraints that apply to the variable
      Returns:
      add explicit type condition into types
    • handleDoubles

      protected static Set<Formula> handleDoubles(KB kb)
      A bit of a hack to produce the statements that would result from the only two axioms in SUMO with two predicate variables
    • instantiatePredVars

      public static Set<Formula> instantiatePredVars(Formula input, KB kb)
      Parameters:
      input - formula
      kb - knowledge base
      Returns:
      A list of formulas where predicate variables are instantiated; There are three possible returns: return null if input contains predicate variables but cannot be instantiated; return empty if input contains no predicate variables; return a list of instantiated formulas if the predicate variables are instantiated;
    • hasCorrectArity

      public static String hasCorrectArity(Formula f, KB kb)
      If arity is correct, return null, otherwise, return the predicate that has its arity violated in the given formula.
    • gatherPredVarRecurse

      protected static Set<String> gatherPredVarRecurse(KB kb, Formula f)
      Get a set of all the predicate variables in the formula. If the argument list has a row variable, return 0 as the value, meaning any possible arity of 1 - maxArity
    • findPredVarTypes

      protected static Map<String,Set<String>> findPredVarTypes(Formula f, KB kb)
      Get a set of all the types for predicate variables in the formula.
      Returns:
      a HashMap in which the keys are predicate variables, and the values are HashSets containing one or more class names that indicate the type constraints that apply to the variable. If no predicate variables can be gathered from the Formula, the HashMap will be empty. Note that predicate variables must logically be instances (of class Relation).
    • gatherPredVars

      public static Set<String> gatherPredVars(KB kb, Formula f)
      Collect and return all predicate variables for the given formula
    • arityTest

      public static void arityTest()
    • test

      public static void test()
    • main

      public static void main(String[] args)