LTN objects

In LTNtorch, non-logical symbols (constants and variables) and the output of logical symbols (predicates, functions, formulas, connectives, and quantifiers) are wrapped inside ltn.core.LTNObject instances.

An LTNObject represents a generic symbol (non-logical or logical) used by LTNtorch. Every LTNObject instance is defined by two important attributes:

  1. value, which contains the grounding of the symbol (LTNObject). For example, if the grounding of variable \(x\) is \(\mathcal{G}(x) = [1., 2., 3.]\), then the value attribute for variable \(x\) will contain the vector \([1., 2., 3.]\);

  2. free_vars, which contains the list of the labels of the free variables contained in the LTNObject instance. For example, if we have the formula \(\forall x P(x, y)\), the free_vars attribute for this formula will be [‘y’]. In fact, \(x\) is quantified by \(\forall\), while \(y\) is not quantified, namely it is a free variable.

For those unfamiliar with logic, a free variable is a variable which is not quantified by a universal (\(\forall\)) or existential (\(\exists\)) quantifier.