---
library: "bootstrap"
slug: "Select"
name: "Select"
ref: "Select#decf"
hash: "sema:Select#mh:SHA-256:decf9c05490dc5e6b372c5dbb7d89d2285fdd832714fc992b10fdbd6b7c2c2e3"
type: "Primitives"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/Select"
---

# Select

Generic selection of items from a set based on criteria

Infrastructure · Primitives

## Mechanism

Deterministic Filter. Applies a Predicate Function P(x) to every element in Input Set S. Returns a new Subset S' containing only elements where P(x) is True. It filters a set based on specific inclusion criteria.

## Invariants

- Predicate Truth: For all x in Output, Criterion(x) must be True.
- Subset Property: Output must be a subset of Input (no new items created).
- Determinism: Same input set + same criteria = same output set.

## Parameters

- limit: type=Integer, range=[1, 10000], description=Max items to return
- strategy: type=Enum, range={Filter, First}, description=Default: Filter. Random sampling is excluded — it would violate the Determinism invariant.

## Preconditions

- Criterion is decidable for item type
- Input set is iterable

## Postconditions

- Subset returned

## Failure modes

- Empty Result: No items satisfy the criterion (returns empty set).
- Predicate Error: The criterion function fails or throws an error for specific inputs.

## Where this came from

—

## Used by

- [Act](https://semahash.org/vocabularies/bootstrap/patterns/Act.md) (references)
- [Ballot](https://semahash.org/vocabularies/bootstrap/patterns/Ballot.md) (references)
- [BeamSearch](https://semahash.org/vocabularies/bootstrap/patterns/BeamSearch.md) (references)
- [Card](https://semahash.org/vocabularies/bootstrap/patterns/Card.md) (composes_with)
- [DataMinimization](https://semahash.org/vocabularies/bootstrap/patterns/DataMinimization.md) (references)
- [Decision](https://semahash.org/vocabularies/bootstrap/patterns/Decision.md) (references)
- [OODA](https://semahash.org/vocabularies/bootstrap/patterns/OODA.md) (composes_with)
- [Rally](https://semahash.org/vocabularies/bootstrap/patterns/Rally.md) (composes_with)
- [Rank](https://semahash.org/vocabularies/bootstrap/patterns/Rank.md) (composes_with)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: Select#decf
- Hash: sema:Select#mh:SHA-256:decf9c05490dc5e6b372c5dbb7d89d2285fdd832714fc992b10fdbd6b7c2c2e3

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/Select
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/Select.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
