Products of Weighted Logic Programs