Solving weighted CSPs with meta-constraints by reformulation into satisfiability modulo theories