diff --git a/chb/invariants/XConstant.py b/chb/invariants/XConstant.py index ef26854a..ea5dbd24 100644 --- a/chb/invariants/XConstant.py +++ b/chb/invariants/XConstant.py @@ -243,6 +243,13 @@ def mk_instance(xd: "FnXprDictionary", value: bool) -> XConstant: index = xd.index_xcst(["bc"], [1 if value else 0]) return xd.xcst(index) + def to_json_result(self) -> JSONResult: + content: Dict[str, Any] = {} + content["value"] = self.args[0] == 1 + content["kind"] = "bcst" + content["txtrep"] = str(self) + return JSONResult("xconstant", content, "ok") + def __str__(self) -> str: return "true" if self.is_true else 'false'