Add some struct-based external functions.
Add belief propagation program using structs.