From 28788207bce027c5ffbad46a255f3e66e0bd9b78 Mon Sep 17 00:00:00 2001 From: Samidh Talsania Date: Fri, 2 Dec 2016 02:58:12 -0700 Subject: [PATCH] The output of unsat atoms now support probability calculation of the model using python sympy lib --- src/lpmln2wc_src/lpmln2wc.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lpmln2wc_src/lpmln2wc.cpp b/src/lpmln2wc_src/lpmln2wc.cpp index a8bbf2a..fe49e2f 100644 --- a/src/lpmln2wc_src/lpmln2wc.cpp +++ b/src/lpmln2wc_src/lpmln2wc.cpp @@ -178,6 +178,7 @@ int main(int argc, char **argv){ // W H. or H. split(splitVecSpace, splitVec[0], is_any_of(" "), token_compress_on); + //Process soft rules of form W H. try{ weight = (int)(stof(splitVecSpace[0])); @@ -202,6 +203,9 @@ int main(int argc, char **argv){ trim(newStr); newStr.pop_back(); + vars = ",0,"+ to_string(weight) + vars ; + + tempstr = "unsat(" + to_string(unsatcount) + vars + ") :-"; tempstr += "not " + newStr + ".\n" + newStr + ":-" ; @@ -213,6 +217,7 @@ int main(int argc, char **argv){ cout<