Skip to content
HALOWERK

Datenvertragswerk

minimum boolean tree formula family

For one Boolean truth function on n 0..2 input bits (truth_mask bit x equals f(x)), finds every tree formula with the minimum number of non-input gates over the basis NOT/AND/OR with constants. Prefix grammar: 0/1 constant leaves, a=variable 0, b=variable 1, N<child>=NOT, A<left><right>=AND, O<left><right>=OR; each N/A/O occurrence costs 1. Returns minimum_gates, the ASCII-lex sorted formulas family and count. No shared subexpressions, DAG reuse or XOR primitive.

POST https://datenvertrag.halowerk.com/v1/minimum-boolean-tree-formula-family

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
nSee schemaYes
truth_maskSee schemaYes
claimSee schemaYes
Show full input schema
{
  "type": "object",
  "properties": {
    "n": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 2
        },
        {
          "type": "null"
        }
      ]
    },
    "truth_mask": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 15
        },
        {
          "type": "null"
        }
      ]
    },
    "claim": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "minimum_gates": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            },
            "formulas": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 9,
                "not": {
                  "pattern": "[^01abANO]"
                }
              },
              "minItems": 0,
              "maxItems": 256
            },
            "count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 512
            }
          },
          "required": [
            "minimum_gates",
            "formulas",
            "count"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "n",
    "truth_mask",
    "claim"
  ],
  "additionalProperties": false
}

Open original schema

Published input example

{
  "n": 0,
  "truth_mask": 0,
  "claim": {
    "minimum_gates": 0,
    "formulas": [
      "0"
    ],
    "count": 1
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’