Package com.articulate.sigma.trans
Class THFnew
java.lang.Object
com.articulate.sigma.trans.THFnew
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic intstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FormulaadjustArity(KB kb, Formula f) Adding the world argument messes up pre-processing for variable arity relations, so we have to decrement the numerical suffix as a hack.static voidanalyzeBadUsages(KB kb) static booleanDecide whether to exclude a formula from THF export.static booleanexcludeForTypedef(String pred, Writer out) Predicates that denote formulas that shouldn't be included in type definitions of the translation.static booleanexcludeNonModal(Formula f, KB kb, Writer out) static booleanexcludePred(String pred, Writer out) Predicates that denote formulas that shouldn't be included in the translation.static Stringstatic Stringstatic StringMap a KIF variable to a THF type, based on its inferred SUMO types.static voidstatic StringmakeWorldVar(KB kb, Formula f) static voidoneTrans(KB kb, Formula f, PrintWriter bw) static voidoneTransNonModal(KB kb, Formula f, Writer bw) static StringThis is the primary method of the class.static Stringstatic Stringstatic Stringstatic Stringstatic booleanstatic voidshowHelp()static StringBuild a THF type string from a SUMO signature.static StringsigStringNonModal(String pred, List<String> sig, KB kb, boolean function) static voidstatic voidtransModalTHF(KB kb) static voidtransPlainTHF(KB kb) static booleanvariableArity(KB kb, String pred) static voidwriteIntegerTypes(KB kb, Writer out) static voidwriteTypes(KB kb, Writer out) static voidwriteTypesNonModal(KB kb, Writer out)
-
Field Details
-
debug
public static boolean debug -
axNum
public static int axNum -
badUsageSymbols
-
predicateTerms
-
-
Constructor Details
-
THFnew
public THFnew()
-
-
Method Details
-
processLogOp
-
processEquals
-
processRecurse
-
getTHFtype
Map a KIF variable to a THF type, based on its inferred SUMO types. - Formula variables become (w > $o) so they can be applied as F @ W. - World variables become w. - Modal variables become m. - Everything else collapses to $i. -
generateQList
-
generateQListNonModal
-
process
This is the primary method of the class. It takes a SUO-KIF formula and returns a THF formula. -
processNonModal
-
variableArity
-
adjustArity
Adding the world argument messes up pre-processing for variable arity relations, so we have to decrement the numerical suffix as a hack. (s__partition__4 @ s__PsychologicalAttribute @ s__StateOfMind @ s__TraitAttribute @ V__W1) ) needs to be s__partition__3 -
makeWorldVar
-
oneTrans
- Throws:
IOException
-
oneTransNonModal
- Throws:
IOException
-
protectedRelation
-
exclude
Decide whether to exclude a formula from THF export. This filter: - removes unsupported syntactic constructs (quotes, $true/$false), - removes meta-logical axioms about the class Formula and bare variables in formula position, - enforces constraints on how modal/HOL symbols may be used (never as ordinary individuals in non-modal heads), - drops a small set of known-bad SUMO terms (problematic_terms). NOTE: Pure arithmetic functions such as AdditionFn, MultiplicationFn, LogFn, SquareRootFn, etc. are NOT excluded here. They are treated as world-free functions and handled via THFnew's type system.- Throws:
IOException
-
excludePred
Predicates that denote formulas that shouldn't be included in the translation.- Throws:
IOException
-
excludeForTypedef
Predicates that denote formulas that shouldn't be included in type definitions of the translation.- Throws:
IOException
-
sigString
Build a THF type string from a SUMO signature.- Parameters:
functor- the predicate / function symbol whose type we buildsig- the list of SUMO argument/result types (as strings)kb- the KB, used for isInstanceOf checksfunction- true if this is a function symbol (first entry in sig is range) NOTE: - For "modal" predicates in Modals.formulaPreds / regHOLpred we treat Formula arguments as (w > $o) (e.g. confersObligation, desires, ...). - KappaFn is a special case: although it appears in formulaPreds, in the existing SUMO axioms its Formula argument is used as a *plain* proposition (already world-instantiated), so we type that argument as $o instead.
-
sigStringNonModal
-
writeIntegerTypes
- Throws:
IOException
-
writeTypes
- Throws:
IOException
-
writeTypesNonModal
- Throws:
IOException
-
analyzeBadUsages
-
transModalTHF
-
transPlainTHF
-
excludeNonModal
- Throws:
IOException
-
test
-
showHelp
public static void showHelp() -
main
-