> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sensecode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Values & Types

> Sense's value model — the deterministic core, plus how it extends to model/answer/agent/action values.

## The deterministic value set

<Frame>
  | Sense type | Example                       | Notes                                           |
  | ---------- | ----------------------------- | ----------------------------------------------- |
  | `Int`      | `42`                          | whole numbers                                   |
  | `Float`    | `3.14`                        | `/` always produces a `Float`, even `Int / Int` |
  | `String`   | `"hi\n"`                      | escapes: `\n \t \" \\ \r`                       |
  | `Bool`     | `true`, `false`               | distinct from `Int` — `true == 1` is `false`    |
  | `Nil`      | `nil`                         | absence of a value                              |
  | `Array`    | `[1, 2, 3]`                   | heterogeneous, 0-indexed, mutable               |
  | `Function` | `def square(x): return x * x` | closes over its defining scope                  |
</Frame>

These are the values every Sense program can use with zero AI involvement
and zero network access — the deterministic core is a complete, ordinary
programming language on its own. See [Non-Goals](/philosophy/non-goals)
for why that's a deliberate design commitment, not an implementation detail.

## Values that extend the model

As you move into Sense's AI-native and safety features, a few more value
kinds appear — each documented in depth on its own page:

<CardGroup cols={2}>
  <Card title="Model" icon="server" href="/ai-native/model-ask-answer">
    A runtime reasoning resource — never a raw API handle.
  </Card>

  <Card title="Answer" icon="circle-question" href="/ai-native/model-ask-answer">
    The result of `ask(...)`: a value, a confidence, and a source —
    never silently just "a string."
  </Card>

  <Card title="Agent" icon="robot" href="/ai-native/agents">
    A runtime entity with identity, persistent state, and a lifecycle.
  </Card>

  <Card title="Action" icon="shield-check" href="/safety/actions">
    A prepared-but-not-yet-executed world-changing operation.
  </Card>
</CardGroup>

## Truthiness

`nil`, `false`, `0`, `0.0`, `""`, and `[]` are falsy. Everything else —
including any non-empty string or array — is truthy:

```sns theme={null}
if "":
    print("not reached")
if "x":
    print("reached")
if []:
    print("not reached")
```

## Operators

<Tabs>
  <Tab title="Arithmetic">
    `+ - * / %` — standard precedence. `/` is always true (float) division;
    there's no separate integer-division operator yet.

    ```sns theme={null}
    print(7 / 2)   # 3.5
    print(7 % 2)   # 1
    ```
  </Tab>

  <Tab title="Comparison">
    `== != < <= > >=` — these stay symbolic on purpose. Arithmetic and
    comparison operators are already the same notation math uses; there's
    no "more natural" alternative worth reaching for, unlike logic words
    (see next tab).

    `==`/`!=` never conflate `Bool` with `Int`/`Float`, even though many
    languages let `true == 1`:

    ```sns theme={null}
    print(true == 1)   # false
    print(1 == 1)      # true
    ```
  </Tab>

  <Tab title="Logic">
    `and`, `or`, `not` — words, not symbols (`&&`/`||`/`!`), because these
    are exactly the place where a natural-language word reads more clearly
    than a symbol without losing precision.

    ```sns theme={null}
    if age >= 18 and has_id:
        allow()
    if not verified:
        deny()
    ```
  </Tab>

  <Tab title="String / Array +">
    `+` concatenates two `String`s or two `Array`s. Mixing a `String` with
    a non-`String` is a runtime error — use `str(x)` to convert explicitly;
    Sense never silently stringifies for you.

    ```sns theme={null}
    print("a" + "b")     # "ab"
    print([1] + [2])     # [1, 2]
    print("x" + 1)        # error — use "x" + str(1)
    ```
  </Tab>
</Tabs>

## Type annotations are a runtime check, not static inference

```sns theme={null}
x: Int = 5
def square(n: Int) -> Int:
    return n * n
```

Annotations are checked with `values.matches_type()` at the point of
assignment, call, and return — a shallow, honest runtime check, not a real
type system. `Array<T>` checks element types recursively; `Any` accepts
anything; an unrecognized type name is currently unenforced.

<Info>
  Real static type checking — including how the type system should represent
  `Answer<T>`'s reliability — is an open research question in Sense's design
  log, deliberately deferred rather than bolted on twice. See
  [Roadmap](/roadmap).
</Info>

## Continue

<CardGroup cols={2}>
  <Card title="Variables & scope" icon="brackets-curly" href="/language/variables-and-scope">
    The one assignment rule, and how `local` gives you intentional
    shadowing.
  </Card>

  <Card title="Functions" icon="function" href="/language/functions">
    `def`/`->` — the one concept shaped just like Python's own.
  </Card>
</CardGroup>
