Next: 6.4 Weight Learning
Up: 6 Notes on Code
Previous: 6.2 Parser
6.3 Logic
The logic/ directory contains classes related to first-order logic.
PredicateTemplate represents a predicate declaration, while a
Predicate is its definition. Likewise for FunctionTemplate
and Function. Observe that the code for Predicate
and Function is similar, and we could have made one the superclass
of the other. However, we avoided polymorphism
for the sake of inlining their functions. A Term represents a constant,
a variable or a function. A Predicate contains one or more Terms.
Clause is an array of Predicates, and contains the important
functions for counting the number of true groundings of a clause,
and for finding unknown ground clauses.
ClauseFactory creates clauses for structure
learning. It includes a function validClause() in which you can specify
rules to restrict the kinds of clauses created. ClauseSampler contains
an algorithm that estimates the number of true groundings of a clause by
sampling the clause's groundings. It uses TrueFalseGroundingsStore to
store groundings of predicates. MLN represents
a Markov Logic Network with a set of Clauses.
clausehelper.h and mlnhelper.h contains
the auxiliary data structures used by Clause and MLN respectively.
Database provides the truth values of ground Predicates
(ground atoms), and keeps the truth values of all ground atoms in memory.
GroundPreds is a data structure for holding ground Predicates,
and is mainly used for testing purposes. A Domain contains the
declared types, constants, predicates, and functions, and provides information
about them (e.g., the number of constants of a type). It also holds a pointer
to a Database.
Next: 6.4 Weight Learning
Up: 6 Notes on Code
Previous: 6.2 Parser
Marc Sumner
2006-06-26