fix atom ordering issue in truth table generation