TamaraThe specification

TCS taxonomy v0.8

Triple Cut

Experimental: structure may change in a subsequent edition. This page is pinned to v0.8.

An honest cut that divides a packet into three segments and reassembles them in a stated order

Source fragment

The following is documentation data, not a standalone document or validation schema. Resolve references against the original source schema.

{
  "id": "triple-cut",
  "description": "An honest cut that divides a packet into three segments and reassembles them in a stated order",
  "labels": {
    "en": "Triple Cut"
  },
  "atlas_ref": "technique:triple-cut",
  "family_ref": "true-cuts",
  "requires": [
    "target"
  ],
  "parameters": {
    "cut_plan": {
      "required": true,
      "description": "Ordered top-first sizes for the upper, middle and lower segments; the last may be rest",
      "domain": "array",
      "items": "integer >= 1 | rest",
      "min_items": 3,
      "max_items": 3
    },
    "order": {
      "required": true,
      "description": "A permutation of upper, middle, lower (top first) giving the reassembly order",
      "domain": "array",
      "items": [
        "upper",
        "middle",
        "lower"
      ],
      "min_items": 3,
      "max_items": 3,
      "unique_items": true
    }
  },
  "locals": [
    "middle",
    "lower"
  ],
  "body": [
    {
      "verb": "registry:cut-into-packets",
      "source": "target",
      "arguments": {
        "piles": 3,
        "cut_plan": {
          "param": "cut_plan"
        }
      },
      "yields": [
        "upper",
        "middle",
        "lower"
      ]
    },
    {
      "verb": "registry:collect",
      "target": "target",
      "arguments": {
        "order": {
          "param": "order"
        }
      }
    }
  ],
  "net_contract": {
    "post_state_invariant": "target splits into three top-first segments per cut_plan, then reassembles as one packet stacked top to bottom per order.",
    "post_state": {
      "state_schema_ref": "https://tamaraspec.org/schema/tcs-playing-cards-state-0.1.json",
      "effects": [
        {
          "op": "split",
          "subject": "target",
          "into": 3,
          "sizes": {
            "param": "cut_plan"
          }
        },
        {
          "op": "merge",
          "sources": {
            "param": "order"
          },
          "into": "target"
        }
      ]
    }
  },
  "examples": [
    {
      "arguments": {
        "cut_plan": [
          3,
          3,
          "rest"
        ],
        "order": [
          "lower",
          "middle",
          "upper"
        ]
      },
      "piles": {
        "target": [
          "1",
          "2",
          "3",
          "4",
          "5",
          "6",
          "7",
          "8",
          "9"
        ]
      },
      "expect": {
        "piles": {
          "target": [
            "7",
            "8",
            "9",
            "4",
            "5",
            "6",
            "1",
            "2",
            "3"
          ]
        }
      }
    }
  ]
}

Verbatim JSON · Source: schemas/tcs-taxonomy-0.8.json/composites/triple-cut

See also