User-defined predicates and functions is the standard way of using predicates and functions in MLNs. The process consists of declaration, definition and usage. Declaration must occur first. This is done by listing all predicates and functions in the .mln file with the following syntax:
Predicate definitions, or ground atoms, are defined in a.db (database) file. Each line in the file can have one or more ground atoms. Empty lines are permitted. False ground atoms are specified with a preceding ! (e.g., !advisedBy(Alice,Bob)), and unknown ones are specified with a preceding ? (e.g., ?advisedBy(Alice,Bob)). True ground atoms are specified without any preceding symbol (e.g., advisedBy(Alice,Bob)). Note that if a closed-world assumption is made for a predicate, you only need to specify the true ground atoms in a.db file. All other unspecified ground atoms are false. (You can specify the false ground atoms too, if you wish.) Likewise, if an open world assumption is made, you only need to specify the true and false ground atoms. All other unspecified ground atoms are unknown. (Again, you can specify the unknown ground atoms, if you wish.)
Similarly, the user supplies function definitions in a .db file. Each line contains exactly one definition of the form <returnvalue> = <functionname>(<constant1>, ... , <constantn>), e.g., Alice = motherOf(Bob). The mappings given are assumed to be the only ones present in the domain.