wolfe-pack / wolfe

Wolfe Language and Engine
https://wolfe-pack.github.io/wolfe
Apache License 2.0
135 stars 17 forks source link

Hooks for inference sub-routines #76

Closed riedelcastro closed 10 years ago

riedelcastro commented 10 years ago

Allow users to provide low-level inference implementations of high-level declarative modelling units. For example, create a message passing potential for a "exactlyN" constraint.

@Potential(exactlyNImpl)
def exactlyN(n:Int)(args:Seq[Boolean]) = args.count(x => x) == n
def exactlyNImpl(n:Int)(args:Seq[FactorGraph.Edge]):Potential = ...