code: function buildConstraints(ctx) {
      const res = [];
  
      function fillLC(dst, src) {
          if (src.type != "LINEARCOMBINATION") throw new Error("Constraint is not a LINEARCOMBINATION");
          for (let s in src.values) {
              const v = src.values[s].toString();
              const id = ctx.signalName2Idx[s];
              dst[id] = v;
          }
      }
  
      for (let i=0; i<ctx.constraints.length; i++) {
          const A = {};
          const B = {};
          const C = {};
  
          fillLC(A, ctx.constraints[i].a);
          fillLC(B, ctx.constraints[i].b);
          fillLC(C, lc.negate(ctx.constraints[i].c));
  
          res.push([A,B,C]);
      }
  
      return res;
  }
docs: /*
  Build constraints
  
  A constraint like this
  
  [s1 + 2*s2 + 3*s3] * [ s2 + 5*s4] - [s0        ] = 0
  [     5*s2 + 6*s3] * [ s2 +     ] - [s0 + 2* s2] = 0
  [s1 +          s3] * [ s2 + 5*s3] - [s4        ] = 0
  
  is converted to
  
  [
  [{"1":"1","2":"2","3":"3"} , {"2":"1","4":"5"} , {"0":"1"         }],
  [{        "2":"5","3":"6"} , {"2":"1"        } , {"0":"1", "2":"2"}],
  [{"1":"1",        "3":"1"} , {"2":"1","3":"5"} , {"4":"1"         }]
  ]
  ^                            ^                  ^
  |                            |                  |
  A                            B                  C