Class Sortals

java.lang.Object
com.articulate.sigma.parsing.Sortals

public class Sortals extends Object
  • Field Details

    • debug

      public boolean debug
    • disjointTime

      public long disjointTime
  • Constructor Details

    • Sortals

      public Sortals(KB kbin)
  • Method Details

    • addSortals

      public String addSortals(FormulaAST f, Map<String,Set<String>> types)
      Add type guards to a formula by making it the consequent of a rule and making type tests into a new antecedent
    • mostSpecificType

      public String mostSpecificType(Set<String> types)
      Find the most specific type in a list of types. This assumes that the list has already been tested for disjointness
    • removeExplicitTypes

      public Map<String,Set<String>> removeExplicitTypes(Map<String,Set<String>> typesMap, Map<String,Set<String>> explicit)
      If a type is already specified for a variable in a rule with an instance or subclass statement, remove it from the type list so that it won't be added as a type guard
    • elimSubsumedTypes

      public void elimSubsumedTypes(FormulaAST f)
      Eliminate more general types in favor of their more specific subclasses (if any)
    • winnowAllTypes

      public void winnowAllTypes(FormulaAST f)
      Find the most specific type constraint for each variable
    • addSortals

      public String addSortals(FormulaAST f)
      Find the most specific type constraint for each variable and create a new String of the formula with type guards