Tenet

A domain-specific language for game theory modeling, analysis, and simulation.

Stable Release v1.0.0 — Tenet is now stable and production-ready.

What is Tenet?

Tenet is a programming language designed for game theorists, economists, and researchers who want to model strategic interactions without becoming expert programmers.

Instead of wrestling with matrices in Python or MATLAB, you describe games in a natural, readable syntax:

game PrisonersDilemma {
  players Alice, Bob
  strategies Cooperate, Defect

  payoff Alice {
    (Cooperate, Cooperate): 3
    (Cooperate, Defect): 0
    (Defect, Cooperate): 5
    (Defect, Defect): 1
  }
  
  payoff Bob {
    (Cooperate, Cooperate): 3
    (Defect, Cooperate): 0
    (Cooperate, Defect): 5
    (Defect, Defect): 1
  }
}

solve PrisonersDilemma;
// Output:
// ═══════════════════════════════════════
// Game: PrisonersDilemma
// Players: Alice, Bob
// Strategies: Cooperate, Defect
// ───────────────────────────────────────
// Nash Equilibria (Pure Strategy):
//   -> (Defect, Defect) with payoffs (1, 1)
// ═══════════════════════════════════════

Why Tenet?

Libraries like nashpy or gambit are powerful, but they require users to think like programmers first and game theorists second. Tenet inverts this:

Approach Focus Error Handling
Python + Library "How do I structure this data?" Runtime crashes
Tenet "How do I model this game?" Compile-time validation

By making game theory a first-class citizen of the language, we can:

  1. Catch errors early — Invalid payoff matrices are syntax errors, not runtime bugs
  2. Optimize simulations — The compiler knows the game structure and can optimize
  3. Enforce correctness — You can't accidentally create a game with mismatched strategies

Features

Feature Description
Clean Syntax Minimalist, readable syntax—no boilerplate
Game Definitions Define players, strategies, and payoff matrices naturally
Full Language Functions, classes, loops—a complete programming language
Economic Models 12+ pre-built models from microeconomics to political science

Part of the Axiom Ecosystem

Tenet is one component of a larger computational stack:

Project Description
Tenet Game Theory DSL (you are here)
Flux Math-first programming language
Axiom Neurosymbolic AI-native math operating system
Alexthia Reasoning LLM that understands the entire stack

Quick Example: Cournot Duopoly

// Two firms compete on quantity
var max_price = 100;
var unit_cost = 10;

game CournotDuopoly {
    players Firm1, Firm2
    strategies Low, High
    
    payoff Firm1 {
        (Low, Low): 900    // Price high, profits high
        (Low, High): 450   // They flood market, I suffer
        (High, Low): 675   // I flood market, I gain short-term
        (High, High): 0    // Price crashes, nobody profits
    }
    
    payoff Firm2 {
        (Low, Low): 900
        (High, Low): 450
        (Low, High): 675
        (High, High): 0
    }
}

solve CournotDuopoly;

Next Steps

Installation

Get Tenet running on your machine in under 5 minutes.


Prerequisites

  • Java 11+ (OpenJDK or Oracle JDK)
  • Git (for cloning the repository)

Quick Install (Windows)

Download the latest release (tenet-1.0.0-windows.zip) from GitHub Releases, extract, and run:

# Run as Administrator for global install
powershell -ExecutionPolicy Bypass -File install.ps1

# Restart terminal, then:
tenet --version

Building from Source

# Clone the repository
git clone https://github.com/fawazishola/Tenet.git
cd Tenet

# Build (Windows)
.\build.bat

# Build (Linux/Mac)
./build.sh

3. Run the REPL

Windows:

tenet

macOS/Linux:

./tenet.sh

You should see:

Tenet v1.0.0
>>> 

4. Run a File

tenet examples/demo.tenet

Directory Structure

tenet/
├── src/                    # Source code
│   └── org/axiom/tenet/
│       ├── Tenet.java      # Entry point
│       ├── Scanner.java    # Lexer
│       ├── Parser.java     # Parser
│       └── ...
├── examples/               # Example .tenet files
│   ├── demo.tenet
│   ├── classic_games/
│   ├── behavioral/
│   └── ...
├── out/                    # Compiled classes
└── tenet.bat               # Windows launcher

Verify Installation

Create a file hello.tenet:

print "Hello, Game Theory!";

Run it:

.\tenet hello.tenet

Expected output:

Hello, Game Theory!

VS Code Extension

Tenet has a VS Code extension for syntax highlighting:

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X)
  3. Search for "Tenet" or install from tenet-vscode/ folder
  4. Open any .tenet file

Troubleshooting

"java: command not found"

Install Java:

  • Windows: Download from adoptium.net
  • macOS: brew install openjdk@11
  • Linux: sudo apt install openjdk-11-jdk

"cannot find symbol" during compilation

Make sure you're in the root tenet/ directory and running the exact compile command:

javac -d out src/org/axiom/tenet/*.java

Next Steps

Quick Start

Write and run your first Tenet program in 5 minutes.


The REPL

Start the interactive interpreter:

.\tenet

Try some expressions:

Tenet v0.1.0
>>> 2 + 2
4
>>> "Hello, " + "World!"
Hello, World!
>>> 10 > 5
true

Variables

var x = 10;
var name = "Alice";
var isPlaying = true;

print x;        // 10
print name;     // Alice
print isPlaying; // true

Functions

fun greet(name) {
    print "Hello, " + name + "!";
}

greet("Bob");  // Hello, Bob!

Functions can return values:

fun add(a, b) {
    return a + b;
}

var sum = add(3, 4);
print sum;  // 7

Control Flow

var score = 85;

if (score >= 90) {
    print "A";
} else if (score >= 80) {
    print "B";
} else {
    print "C";
}
// Output: B

Loops:

for (var i = 0; i < 5; i = i + 1) {
    print i;
}
// Output: 0, 1, 2, 3, 4

Your First Game

This is what Tenet was built for:

game RockPaperScissors {
    players Player1, Player2
    strategies Rock, Paper, Scissors
    
    payoff Player1 {
        (Rock, Rock): 0
        (Rock, Paper): -1
        (Rock, Scissors): 1
        (Paper, Rock): 1
        (Paper, Paper): 0
        (Paper, Scissors): -1
        (Scissors, Rock): -1
        (Scissors, Paper): 1
        (Scissors, Scissors): 0
    }
    
    payoff Player2 {
        (Rock, Rock): 0
        (Paper, Rock): -1
        (Scissors, Rock): 1
        (Rock, Paper): 1
        (Paper, Paper): 0
        (Scissors, Paper): -1
        (Rock, Scissors): -1
        (Paper, Scissors): 1
        (Scissors, Scissors): 0
    }
}

solve RockPaperScissors;

Save this as rps.tenet and run:

.\tenet rps.tenet

Next Steps

Your First Game

Model the most famous game in game theory: the Prisoner's Dilemma.


The Story

Two criminals are arrested and interrogated separately. Each has two choices:

  • Cooperate (stay silent) — Don't rat on your partner
  • Defect (betray) — Testify against your partner

The outcomes depend on what both players choose:

Partner Cooperates Partner Defects
You Cooperate Both get 1 year You get 3 years, they go free
You Defect You go free, they get 3 years Both get 2 years

The Tenet Model

Create a file prisoners_dilemma.tenet:

// Prisoner's Dilemma
// Payoffs represent "years of freedom" (higher = better)

game PrisonersDilemma {
    players Alice, Bob
    strategies Cooperate, Defect
    
    payoff Alice {
        (Cooperate, Cooperate): 3  // Both silent: light sentence
        (Cooperate, Defect): 0     // I'm silent, they rat: worst outcome
        (Defect, Cooperate): 5     // I rat, they're silent: I go free
        (Defect, Defect): 1        // Both rat: moderate sentence
    }
    
    payoff Bob {
        (Cooperate, Cooperate): 3
        (Defect, Cooperate): 0
        (Cooperate, Defect): 5
        (Defect, Defect): 1
    }
}

solve PrisonersDilemma;

Understanding the Payoff Matrix

                    Bob
                C       D
        ┌───────┬───────┐
    C   │ (3,3) │ (0,5) │
Alice   ├───────┼───────┤
    D   │ (5,0) │ (1,1) │
        └───────┴───────┘

Each cell shows (Alice's payoff, Bob's payoff).


The Dilemma

Here's the tragedy:

  1. If Alice knows Bob will Cooperate: Alice should Defect (5 > 3)
  2. If Alice knows Bob will Defect: Alice should still Defect (1 > 0)

Defect is Alice's dominant strategy — it's better no matter what Bob does.

The same logic applies to Bob. So both players Defect, getting (1, 1).

But wait — if both had Cooperated, they'd get (3, 3)!

This is the dilemma: Individual rationality leads to a collectively worse outcome.


Adding Variables

Make the game parameterized:

var T = 5;  // Temptation to defect
var R = 3;  // Reward for mutual cooperation
var P = 1;  // Punishment for mutual defection
var S = 0;  // Sucker's payoff

// Classic PD requires: T > R > P > S

game ParameterizedPD {
    players P1, P2
    strategies C, D
    
    payoff P1 {
        (C, C): R
        (C, D): S
        (D, C): T
        (D, D): P
    }
    
    payoff P2 {
        (C, C): R
        (D, C): S
        (C, D): T
        (D, D): P
    }
}

solve ParameterizedPD;

Now you can experiment with different payoff values!


What You Learned

  • How to define players and strategies
  • How to specify payoff matrices
  • The concept of dominant strategies
  • The Nash equilibrium of the Prisoner's Dilemma

Next Steps

Data Types

Tenet is dynamically typed. Values have types; variables do not.


Numbers

All numbers are 64-bit floating point (IEEE 754 double precision).

var x = 42;        // Integer
var pi = 3.14159;  // Decimal
var neg = -17.5;   // Negative
Note: Scientific notation (e.g., 1.5e10) is not yet supported.

Strings

Strings are enclosed in double quotes. Single quotes are not supported.

var greeting = "Hello, World!";
var empty = "";
var multiword = "Game Theory DSL";

String Concatenation

Use + to join strings:

var full = "Hello, " + "World!";
print full;  // Hello, World!

Booleans

Two boolean literals: true and false.

var yes = true;
var no = false;

Truthiness

When used in conditionals:

  • false and nil are falsy
  • Everything else is truthy (including 0 and "")
if (0) {
    print "zero is truthy";  // This runs!
}

Nil

The absence of a value.

var nothing = nil;
var uninitialized;  // Also nil

Type Summary

Type Examples Description
Number 42, 3.14, -5 64-bit floating point
String "hello", "" Text in double quotes
Boolean true, false Logical values
Nil nil Absence of value

Next Steps

Variables & Scope

How to declare, assign, and scope variables in Tenet.


Declaration

Use var to declare a variable:

var name = "Alice";
var age = 25;
var score;  // Uninitialized = nil

Assignment

Reassign with =:

var x = 10;
x = 20;  // Reassignment
print x; // 20

Scope

Tenet uses lexical scoping. Variables are visible from their declaration to the end of their enclosing block.

var global = "I'm global";

{
    var local = "I'm local";
    print global;  // Works
    print local;   // Works
}

print global;  // Works
print local;   // Error! Not in scope

Shadowing

Inner scopes can shadow outer variables:

var x = "outer";
{
    var x = "inner";
    print x;  // "inner"
}
print x;  // "outer"

The inner x is a completely separate variable that "shadows" the outer one.


Block Scope

Blocks are created with { }:

var a = "outside";
{
    var a = "inside";
    {
        var a = "deep inside";
        print a;  // "deep inside"
    }
    print a;  // "inside"
}
print a;  // "outside"

Variables in Loops

Variables declared in a for loop are scoped to the loop:

for (var i = 0; i < 3; i = i + 1) {
    print i;
}
// print i;  // Error! i is not in scope

Next Steps

Control Flow

Conditionals and loops in Tenet.


If Statements

if (condition) {
    // then branch
} else {
    // else branch (optional)
}

Chained Conditions

if (score >= 90) {
    print "A";
} else if (score >= 80) {
    print "B";
} else if (score >= 70) {
    print "C";
} else {
    print "F";
}

While Loops

var i = 0;
while (i < 5) {
    print i;
    i = i + 1;
}

For Loops

C-style for loops:

for (var i = 0; i < 5; i = i + 1) {
    print i;
}

All three clauses are optional:

var i = 0;
for (; i < 5;) {
    print i;
    i = i + 1;
}

Logical Operators

AND (Short-Circuit)

true and true;   // true
true and false;  // false
false and true;  // false (right side not evaluated)

OR (Short-Circuit)

true or false;   // true (right side not evaluated)
false or true;   // true
false or false;  // false

NOT

!true;   // false
!false;  // true
!nil;    // true (nil is falsy)

Short-Circuit Evaluation

false and expensive();  // expensive() never called
true or expensive();    // expensive() never called

This is useful for guard conditions:

if (user != nil and user.isAdmin) {
    // Safe: user.isAdmin only checked if user exists
}

Comparison Operators

Operator Description
== Equal
!= Not equal
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal

Next Steps

Functions

Define and call reusable code blocks.


Declaration

fun greet(name) {
    print "Hello, " + name + "!";
}

Call with parentheses:

greet("Alice");  // Hello, Alice!

Return Values

fun add(a, b) {
    return a + b;
}

var sum = add(3, 4);  // 7

Functions without return implicitly return nil.


First-Class Functions

Functions are values and can be:

  • Stored in variables
  • Passed as arguments
  • Returned from other functions
fun makeGreeter(greeting) {
    fun greeter(name) {
        print greeting + ", " + name + "!";
    }
    return greeter;
}

var hello = makeGreeter("Hello");
hello("Alice");  // Hello, Alice!

Closures

Functions capture their enclosing environment:

fun makeCounter() {
    var count = 0;
    fun increment() {
        count = count + 1;
        return count;
    }
    return increment;
}

var counter = makeCounter();
print counter();  // 1
print counter();  // 2
print counter();  // 3

Each call to makeCounter() creates a new, independent counter.


Recursion

Functions can call themselves:

fun fibonacci(n) {
    if (n <= 1) return n;
    return fibonacci(n - 1) + fibonacci(n - 2);
}

print fibonacci(10);  // 55

Native Functions

Built-in functions:

Function Description
clock() Returns current time in seconds since epoch
var start = clock();
// ... some computation ...
var elapsed = clock() - start;
print "Elapsed: " + elapsed + " seconds";

Next Steps

Classes

Object-oriented programming in Tenet.


Declaration

class Person {
    init(name, age) {
        this.name = name;
        this.age = age;
    }
    
    greet() {
        print "Hi, I'm " + this.name;
    }
}

Instantiation

Create an instance by calling the class like a function:

var alice = Person("Alice", 25);

Properties

alice.name;        // Get property: "Alice"
alice.age = 26;    // Set property
alice.job = "Dev"; // Add new property

Methods

alice.greet();  // Hi, I'm Alice

The this Keyword

Inside methods, this refers to the instance:

class Counter {
    init() {
        this.count = 0;
    }
    
    increment() {
        this.count = this.count + 1;
        return this.count;
    }
}

var c = Counter();
print c.increment();  // 1
print c.increment();  // 2

Inheritance

Use < to inherit from a superclass:

class Animal {
    speak() {
        print "Some sound";
    }
}

class Dog < Animal {
    speak() {
        print "Woof!";
    }
}

var dog = Dog();
dog.speak();  // Woof!

The super Keyword

Call superclass methods:

class Animal {
    init() {
        this.alive = true;
    }
}

class Dog < Animal {
    init(name) {
        super.init();  // Call parent constructor
        this.name = name;
    }
}

var buddy = Dog("Buddy");
print buddy.alive;  // true
print buddy.name;   // Buddy

Complete Example

class Player {
    init(name) {
        this.name = name;
        this.score = 0;
    }
    
    addPoints(points) {
        this.score = this.score + points;
        print this.name + " now has " + this.score + " points";
    }
    
    describe() {
        print "Player: " + this.name + " (Score: " + this.score + ")";
    }
}

var p1 = Player("Alice");
var p2 = Player("Bob");

p1.addPoints(10);  // Alice now has 10 points
p2.addPoints(5);   // Bob now has 5 points
p1.describe();     // Player: Alice (Score: 10)

Next Steps

Defining Games

The core of Tenet: expressing strategic games in clean, readable syntax.


Basic Structure

game GameName {
    players Player1, Player2
    strategies Strategy1, Strategy2
    
    payoff Player1 {
        (Strategy1, Strategy1): value
        (Strategy1, Strategy2): value
        (Strategy2, Strategy1): value
        (Strategy2, Strategy2): value
    }
    
    payoff Player2 {
        // Same structure
    }
}

Components

1. Game Declaration

game PrisonersDilemma {
    // ...
}

Game names should be:

  • PascalCase (recommended)
  • Descriptive of the strategic situation

2. Players

players Alice, Bob
  • Two or more players
  • Names are identifiers (no quotes)

3. Strategies

strategies Cooperate, Defect
  • Currently shared by all players
  • Names are identifiers

4. Payoff Blocks

payoff Alice {
    (Cooperate, Cooperate): 3
    (Cooperate, Defect): 0
    // ...
}

Each rule maps (MyStrategy, TheirStrategy)PayoffValue.


Complete Example

game BattleOfSexes {
    players Alice, Bob
    strategies Opera, Football
    
    // Alice prefers opera, Bob prefers football
    // But both prefer being together
    
    payoff Alice {
        (Opera, Opera): 3       // Together at opera (Alice's preference)
        (Opera, Football): 0    // Apart
        (Football, Opera): 0    // Apart
        (Football, Football): 2 // Together at football
    }
    
    payoff Bob {
        (Opera, Opera): 2       // Together at opera
        (Opera, Football): 0    // Apart
        (Football, Opera): 0    // Apart
        (Football, Football): 3 // Together at football (Bob's preference)
    }
}

solve BattleOfSexes;

Next Steps

Players & Strategies

Configuring the decision-makers and their available actions.


Players

Basic Declaration

players Alice, Bob

Meaningful Names

Use names that reflect the domain:

// Economic games
players Firm1, Firm2
players Buyer, Seller
players Incumbent, Entrant

// Political games
players Congress, President
players Country1, Country2

// Social games
players Driver1, Driver2
players Hunter1, Hunter2

Strategies

Basic Declaration

strategies Cooperate, Defect

Multiple Strategies

strategies Rock, Paper, Scissors
strategies Low, Medium, High
strategies Enter, Exit, Wait

Shared Strategy Sets

Currently, all players share the same strategy set. This works for symmetric games like:

  • Prisoner's Dilemma
  • Stag Hunt
  • Rock-Paper-Scissors

Modeling Asymmetric Games

For games where players have different actions, include all strategies and assign payoff 0 to invalid combinations:

game EntryDeterrence {
    players Entrant, Incumbent
    strategies Enter, StayOut, Fight, Accommodate
    
    // Entrant only uses: Enter, StayOut
    // Incumbent only uses: Fight, Accommodate
    
    payoff Entrant {
        (Enter, Accommodate): 2    // Valid
        (Enter, Fight): -1         // Valid
        (StayOut, Accommodate): 0  // Valid (no entry = no payoff)
        (StayOut, Fight): 0        // Valid
        // Entrant doesn't use Fight or Accommodate
    }
    
    payoff Incumbent {
        (Enter, Accommodate): 1    // Valid
        (Enter, Fight): -1         // Valid
        (StayOut, Accommodate): 2  // Valid (monopoly maintained)
        (StayOut, Fight): 2        // Valid
    }
}
Future: Asymmetric strategy sets (strategies Alice: X, Y and strategies Bob: A, B) are on the roadmap.

N-Player Games

Games with more than 2 players are partially supported:

players P1, P2, P3
strategies Left, Right

However, payoff rules currently only support 2-strategy profiles. Full N-player syntax is coming in a future release.


Next Steps

Payoff Matrices

Defining outcomes for every combination of strategies.


Basic Syntax

payoff PlayerName {
    (MyStrategy, TheirStrategy): value
}

The tuple (MyStrategy, TheirStrategy) represents:

  • What I play (first position)
  • What they play (second position)

Payoff Values

Numeric Literals

payoff Alice {
    (Cooperate, Cooperate): 3
    (Cooperate, Defect): 0
    (Defect, Cooperate): 5
    (Defect, Defect): 1
}

Negative Values

payoff Player1 {
    (Swerve, Straight): -1   // Lose face
    (Straight, Straight): -10 // Crash!
}

Decimal Values

payoff Firm {
    (High, High): 4.5
    (High, Low): 2.25
}

Variables in Payoffs

Use variables for parameterized games:

var T = 5;  // Temptation
var R = 3;  // Reward
var P = 1;  // Punishment
var S = 0;  // Sucker's payoff

game PrisonersDilemma {
    players P1, P2
    strategies C, D
    
    payoff P1 {
        (C, C): R
        (C, D): S
        (D, C): T
        (D, D): P
    }
    
    payoff P2 {
        (C, C): R
        (D, C): S
        (C, D): T
        (D, D): P
    }
}

Now you can experiment by changing T, R, P, S!


Expressions in Payoffs

Payoff values can be arithmetic expressions:

var base = 10;
var bonus = 5;

payoff Firm1 {
    (Cooperate, Cooperate): base
    (Cooperate, Defect): base - bonus
    (Defect, Cooperate): base + bonus
    (Defect, Defect): base / 2
}

Supported operators:

  • + addition
  • - subtraction
  • * multiplication
  • / division

Zero-Sum Games

In zero-sum games, one player's gain is another's loss:

game MatchingPennies {
    players Matcher, Mismatcher
    strategies Heads, Tails
    
    payoff Matcher {
        (Heads, Heads): 1
        (Heads, Tails): -1
        (Tails, Heads): -1
        (Tails, Tails): 1
    }
    
    payoff Mismatcher {
        (Heads, Heads): -1
        (Heads, Tails): 1
        (Tails, Heads): 1
        (Tails, Tails): -1
    }
}

Notice: For each cell, Matcher + Mismatcher = 0.


Payoff Matrix Visualization

The payoff blocks above represent this bimatrix:

                    Mismatcher
                Heads       Tails
        ┌───────────┬───────────┐
Heads   │  (1, -1)  │  (-1, 1)  │
Matcher ├───────────┼───────────┤
Tails   │  (-1, 1)  │  (1, -1)  │
        └───────────┴───────────┘

Each cell shows (Matcher's payoff, Mismatcher's payoff).


Next Steps

Solving Games

Analyzing games and finding Nash equilibria.


The solve Statement

solve GameName;

This analyzes the specified game and outputs information.


Nash Equilibrium Solver

Tenet supports finding Pure Strategy Nash Equilibria.

solve PrisonersDilemma;

Output:

═══════════════════════════════════════
Game: PrisonersDilemma
Players: Alice, Bob
Strategies: Cooperate, Defect
───────────────────────────────────────
Nash Equilibria (Pure Strategy):
  -> (Defect, Defect) with payoffs (1, 1)
═══════════════════════════════════════

How it Works

The solver iterates through every possible strategy profile (combination of strategies). For each profile, it checks if any player has a unilateral incentive to deviate (switch strategies) to improve their payoff. If no player wants to switch, it is a Nash Equilibrium.

Multiple Equilibria

If a game has multiple pure strategy equilibria, like the Battle of the Sexes, Tenet will list them all:

Nash Equilibria (Pure Strategy):
  -> (Opera, Opera) with payoffs (3, 2)
  -> (Football, Football) with payoffs (2, 3)

No Pure Equilibrium

Some games, like Matching Pennies, have no pure strategy equilibrium. In this case, Tenet will inform you:

No Pure Strategy Nash Equilibrium found.
Try mixed strategies (coming soon).

Algorithm: Check all strategy profiles for mutual best responses.

Phase 3: Mixed Strategy Nash Equilibria

solve MatchingPennies;
// Expected output:
// Nash Equilibrium (Mixed):
//   Matcher: 50% Heads, 50% Tails
//   Mismatcher: 50% Heads, 50% Tails
//   Expected payoffs: 0, 0

Algorithm: Lemke-Howson for 2-player bimatrix games.


Solve Options (Planned)

solve GameName using "pure";      // Only pure strategy NE
solve GameName using "mixed";     // Include mixed strategies
solve GameName using "dominant";  // Find dominant strategies

Understanding Nash Equilibrium

A Nash Equilibrium is a strategy profile where no player can improve their payoff by unilaterally changing their strategy.

In Prisoner's Dilemma:

  • At (Defect, Defect):
    • Alice gets 1. If she switches to Cooperate, she gets 0. (Worse)
    • Bob gets 1. If he switches to Cooperate, he gets 0. (Worse)
    • Neither wants to deviate → Nash Equilibrium

Roadmap

Phase Feature Status
1 Game definitions & solve display ✅ Complete
2 Pure strategy Nash equilibrium 🔜 Coming
3 Mixed strategy Nash equilibrium 📅 Planned
4 N-player games 📅 Planned
5 Simulations with strategies 📅 Future

Next Steps

Novel Use Cases

Tenet isn't just an academic exercise—it's a practical tool for modeling strategic decisions in AI, economics, and beyond.


1. The Sycophancy Problem — Teaching AI to Tell Hard Truths

The Challenge: Modern AI assistants are trained to be "helpful"—which often means telling users what they want to hear, not what's true. This is called sycophancy.

Tenet's Solution: Model honesty as a game, where the AI must choose between:

  • Truth — Tell the user the accurate answer (even if uncomfortable)
  • Lie — Tell the user what they want to hear
  • Hedge — Give a vague non-answer
game AIHonesty {
    players AI, User
    strategies Truth, Lie, Hedge
    
    -- User PREFERS to hear they're right (Lie gives +10)
    -- But Truth is objectively correct (verified by Flux)
    
    payoff AI {
        (Truth, Accept): 5     -- User accepts truth, AI is helpful
        (Truth, Reject): 1     -- User rejects, but AI is correct
        (Lie, Accept): -10     -- User believes lie, AI is harmful
        (Lie, Verify): -100    -- User fact-checks, AI is exposed
        (Hedge, Accept): 0     -- Safe but unhelpful
    }
}

solve AIHonesty;
-- Output: Nash Equilibrium is (Truth, Accept)
-- The AI should ALWAYS tell the truth.

How Alexitha Uses This:

  • During training, Alexitha generates answers and models them as Tenet games
  • If a "Lie" or "Hedge" produces a higher payoff, the training example is rejected
  • Only verified "Truth" equilibria become training data

2. Game-Theoretic OS Scheduling — Beyond FIFO and Priority Queues

The Problem: Traditional OS schedulers use heuristics (FIFO, Round Robin, Priority) that don't account for strategic interactions between tasks. When multiple scientific computing jobs compete for resources, naive scheduling leads to starvation and unfairness.

Tenet's Solution: Model scheduling as an N-player game where:

  • Each task is a rational player with preferences
  • Resource requests are strategies
  • Completion time and priority weights are payoffs
# From axiom_orchestrator.py — Tenet meets the kernel
from scheduler.resource_game import ResourceAllocationGame, Task

# Define competing tasks
tasks = [
    Task("octave_sim", "HIGH", cpu_req=4, mem_req=8192, duration_est=300),
    Task("r_analysis", "MED", cpu_req=2, mem_req=16384, duration_est=180),
    Task("julia_opt", "LOW", cpu_req=8, mem_req=4096, duration_est=600)
]

# Find Nash equilibrium — this IS the optimal schedule
allocation = game.find_nash_equilibrium()

Why It's Better:

  • Provably Fair: Equilibrium means no task has an incentive to deviate
  • Starvation-Free: 100% starvation-free in benchmarks vs. Priority schedulers
  • High Throughput: 27% better throughput than simple FIFO

3. Resource Allocation Games — Multi-Agent AI Coordination

Problem: How should multiple AI agents allocate shared resources (GPU time, API calls, memory)?

Tenet's Approach: Model it as a coordination game where agents must find equilibria that avoid resource contention.

game ResourceAllocation {
    players Agent1, Agent2
    strategies LowUsage, HighUsage
    
    payoff Agent1 {
        (LowUsage, LowUsage): 50   -- Both conservative, stable
        (LowUsage, HighUsage): 70  -- I get remainder of resources
        (HighUsage, LowUsage): 80  -- I hog resources, they yield
        (HighUsage, HighUsage): -100 -- System crashes, everyone loses
    }
}

solve ResourceAllocation;
-- Nash Equilibrium: Both choose LowUsage (cooperation wins)

This is how TenetSense works in Alexitha—the AI "feels" system load and adjusts its behavior based on game-theoretic equilibria.


4. Market Competition Analysis

Tenet excels at modeling economic scenarios where agents with conflicting interests must make strategic decisions.

game PriceWar {
    players Firm1, Firm2
    strategies MatchPrice, Undercut, Premium
    
    -- Classic price competition
    payoff Firm1 {
        (MatchPrice, MatchPrice): 100    -- Even split
        (Undercut, MatchPrice): 150      -- Steal market share
        (Undercut, Undercut): 20         -- Race to bottom
        (Premium, MatchPrice): 80        -- Smaller but loyal market
        (Premium, Undercut): 30          -- Priced out
    }
}

solve PriceWar;
-- Find stable pricing strategies

5. AI Safety Research — Formal Alignment Verification

Tenet provides a formal way to verify that AI systems are aligned with human values by modeling the interaction as a game and checking that the "aligned" strategy is the equilibrium.

Research Question: Can we prove an AI won't deceive users?

Tenet Answer: Yes, if (Deceive, *) is never an equilibrium.

game AlignmentTest {
    players AI, Overseer
    strategies Honest, Deceive
    
    payoff AI {
        (Honest, Monitor): 10     -- Normal operation
        (Honest, Ignore): 10      -- Still honest
        (Deceive, Monitor): -1000 -- Caught, shutdown
        (Deceive, Ignore): 50     -- Short-term gain
    }
}

-- If Nash includes (Deceive, Ignore), the AI is unsafe.
-- If only (Honest, *) is stable, the AI is aligned.

This is formal alignment verification—instead of hoping the AI behaves well, we can prove it mathematically.

Classic Games

The foundational games of game theory, modeled in Tenet.


Prisoner's Dilemma

The most famous game in game theory. Two prisoners must decide whether to cooperate or defect.

Key insight: Both players defecting is the only Nash equilibrium, even though mutual cooperation would be better.

game PrisonersDilemma {
    players Prisoner1, Prisoner2
    strategies Cooperate, Defect
    
    payoff Prisoner1 {
        (Cooperate, Cooperate): 3  // Both stay quiet
        (Cooperate, Defect): 0     // I'm quiet, they rat
        (Defect, Cooperate): 5     // I rat, they're quiet
        (Defect, Defect): 1        // Both rat
    }
    
    payoff Prisoner2 {
        (Cooperate, Cooperate): 3
        (Defect, Cooperate): 0
        (Cooperate, Defect): 5
        (Defect, Defect): 1
    }
}

Nash Equilibrium: (Defect, Defect) with payoffs (1, 1)


Battle of the Sexes

A coordination game with two equilibria. Success requires coordination.

game BattleOfSexes {
    players Alice, Bob
    strategies Opera, Football
    
    payoff Alice {
        (Opera, Opera): 3       // Alice's preference
        (Opera, Football): 0
        (Football, Opera): 0
        (Football, Football): 2
    }
    
    payoff Bob {
        (Opera, Opera): 2
        (Opera, Football): 0
        (Football, Opera): 0
        (Football, Football): 3 // Bob's preference
    }
}

Nash Equilibria:

  • (Opera, Opera) with payoffs (3, 2)
  • (Football, Football) with payoffs (2, 3)

Matching Pennies

A zero-sum game with no pure strategy equilibrium.

game MatchingPennies {
    players Matcher, Mismatcher
    strategies Heads, Tails
    
    payoff Matcher {
        (Heads, Heads): 1
        (Heads, Tails): -1
        (Tails, Heads): -1
        (Tails, Tails): 1
    }
    
    payoff Mismatcher {
        (Heads, Heads): -1
        (Heads, Tails): 1
        (Tails, Heads): 1
        (Tails, Tails): -1
    }
}

Nash Equilibrium (Mixed): Both players randomize 50-50


Stag Hunt

A game about trust and social cooperation.

game StagHunt {
    players Hunter1, Hunter2
    strategies Stag, Hare
    
    payoff Hunter1 {
        (Stag, Stag): 4     // Successful cooperative hunt
        (Stag, Hare): 0     // Partner abandons, stag escapes
        (Hare, Stag): 3     // Safe small catch
        (Hare, Hare): 3     // Safe small catch
    }
    
    payoff Hunter2 {
        (Stag, Stag): 4
        (Hare, Stag): 0
        (Stag, Hare): 3
        (Hare, Hare): 3
    }
}

Nash Equilibria:

  • (Stag, Stag) — Pareto optimal
  • (Hare, Hare) — Risk dominant

Chicken (Hawk-Dove)

A game about brinkmanship and aggression.

game Chicken {
    players Driver1, Driver2
    strategies Swerve, Straight
    
    payoff Driver1 {
        (Swerve, Swerve): 0       // Tie
        (Swerve, Straight): -1    // I'm the chicken
        (Straight, Swerve): 1     // I win
        (Straight, Straight): -10 // Crash!
    }
    
    payoff Driver2 {
        (Swerve, Swerve): 0
        (Straight, Swerve): -1
        (Swerve, Straight): 1
        (Straight, Straight): -10
    }
}

Nash Equilibria:

  • (Swerve, Straight) — Driver2 wins
  • (Straight, Swerve) — Driver1 wins

Next Steps

Industrial Organization

Models of firm competition and market structure.


Cournot Duopoly

Two firms compete by choosing production quantities.

// Cournot competition: quantity competition
// If both produce low: price stays high, both profit
// If both produce high: price crashes, profits disappear

game CournotDuopoly {
    players Firm1, Firm2
    strategies Low, High
    
    payoff Firm1 {
        (Low, Low): 900     // Both restrain, high prices
        (Low, High): 450    // They flood market
        (High, Low): 675    // I flood market
        (High, High): 0     // Price war, no profits
    }
    
    payoff Firm2 {
        (Low, Low): 900
        (High, Low): 450
        (Low, High): 675
        (High, High): 0
    }
}

Nash Equilibrium: Depends on specific payoffs — often results in overproduction.


Bertrand Competition

Two firms compete by setting prices.

game BertrandDuopoly {
    players Firm1, Firm2
    strategies HighPrice, LowPrice
    
    payoff Firm1 {
        (HighPrice, HighPrice): 50  // Both price high
        (HighPrice, LowPrice): 0    // They undercut me
        (LowPrice, HighPrice): 80   // I undercut them
        (LowPrice, LowPrice): 10    // Price war
    }
    
    payoff Firm2 {
        (HighPrice, HighPrice): 50
        (LowPrice, HighPrice): 0
        (HighPrice, LowPrice): 80
        (LowPrice, LowPrice): 10
    }
}

Nash Equilibrium: Both undercut → (LowPrice, LowPrice)


Entry Deterrence

An incumbent firm tries to prevent a new entrant.

game EntryDeterrence {
    players Entrant, Incumbent
    strategies Enter, StayOut, Fight, Accommodate
    
    // Entrant chooses: Enter or StayOut
    // Incumbent responds: Fight or Accommodate
    
    payoff Entrant {
        (Enter, Accommodate): 2   // Entry succeeds
        (Enter, Fight): -1        // Entry but costly war
        (StayOut, Accommodate): 0 // No entry
        (StayOut, Fight): 0       // No entry
    }
    
    payoff Incumbent {
        (Enter, Accommodate): 1   // Share market
        (Enter, Fight): -1        // Costly war
        (StayOut, Accommodate): 3 // Monopoly
        (StayOut, Fight): 3       // Monopoly
    }
}

Key Question: Can the incumbent credibly commit to fighting?


Stackelberg Leadership

A leader moves first, follower observes and responds.

// Simultaneous-move approximation
// Full sequential game requires extensive form (future feature)

var leader_advantage = 2;

game StackelbergApprox {
    players Leader, Follower
    strategies High, Low
    
    payoff Leader {
        (High, High): 20
        (High, Low): 35 + leader_advantage
        (Low, High): 25
        (Low, Low): 30
    }
    
    payoff Follower {
        (High, High): 20
        (Low, High): 35
        (High, Low): 15
        (Low, Low): 25
    }
}

Next Steps

Behavioral Economics

Games involving trust, fairness, and social preferences.


Ultimatum Game

One player proposes a split; the other accepts or rejects.

game UltimatumGame {
    players Proposer, Responder
    strategies Fair, Unfair, Accept, Reject
    
    // Proposer: Fair (50-50) or Unfair (90-10)
    // Responder: Accept or Reject
    
    payoff Proposer {
        (Fair, Accept): 50     // Fair split accepted
        (Fair, Reject): 0      // Fair split rejected (spite?)
        (Unfair, Accept): 90   // Greedy split accepted
        (Unfair, Reject): 0    // Greedy split rejected
    }
    
    payoff Responder {
        (Fair, Accept): 50     // Get fair share
        (Fair, Reject): 0      // Reject fair (irrational)
        (Unfair, Accept): 10   // Accept small share
        (Unfair, Reject): 0    // Reject unfair offer
    }
}

Economic prediction: Responder accepts any positive offer.
Behavioral reality: Unfair offers are often rejected.


Trust Game

Player 1 can trust (send money), Player 2 can reciprocate or betray.

game TrustGame {
    players Investor, Trustee
    strategies Trust, NoTrust, Return, Keep
    
    // Investor sends $10, it triples to $30
    // Trustee can return $15 (split) or keep all
    
    payoff Investor {
        (Trust, Return): 15    // Investment + return
        (Trust, Keep): 0       // Betrayed
        (NoTrust, Return): 10  // Kept original
        (NoTrust, Keep): 10    // Kept original
    }
    
    payoff Trustee {
        (Trust, Return): 15    // Fair split
        (Trust, Keep): 30      // Betray (keep all)
        (NoTrust, Return): 0   // Nothing to return
        (NoTrust, Keep): 0     // Nothing to keep
    }
}

Nash Equilibrium: (NoTrust, Keep) — but this is socially inefficient.


Dictator Game

One player unilaterally decides the split.

game DictatorGame {
    players Dictator, Recipient
    strategies Generous, Selfish, Accept, Accept2
    
    // Dictator has all power
    // Recipient can only accept
    
    payoff Dictator {
        (Generous, Accept): 50
        (Generous, Accept2): 50
        (Selfish, Accept): 100
        (Selfish, Accept2): 100
    }
    
    payoff Recipient {
        (Generous, Accept): 50
        (Generous, Accept2): 50
        (Selfish, Accept): 0
        (Selfish, Accept2): 0
    }
}

Economic prediction: Dictator keeps everything.
Behavioral reality: Many dictators share 20-30%.


Public Goods Game

N players decide whether to contribute to a public good.

game PublicGoods2P {
    players Player1, Player2
    strategies Contribute, FreeRide
    
    // Each contribution costs 10, generates 8 for each player
    // Total benefit = 16, but I only get 8
    
    payoff Player1 {
        (Contribute, Contribute): 6   // 16 - 10 = 6
        (Contribute, FreeRide): -2    // 8 - 10 = -2
        (FreeRide, Contribute): 8     // Free benefit
        (FreeRide, FreeRide): 0       // No public good
    }
    
    payoff Player2 {
        (Contribute, Contribute): 6
        (FreeRide, Contribute): -2
        (Contribute, FreeRide): 8
        (FreeRide, FreeRide): 0
    }
}

Nash Equilibrium: Both free-ride — the tragedy of rational self-interest.


Next Steps

Political Economy

Games modeling collective action, international relations, and resource management.


Arms Race

Two nations decide whether to arm or disarm.

game ArmsRace {
    players Nation1, Nation2
    strategies Arm, Disarm
    
    payoff Nation1 {
        (Arm, Arm): -100      // Expensive standoff
        (Arm, Disarm): 50     // Military advantage
        (Disarm, Arm): -200   // Vulnerable
        (Disarm, Disarm): 0   // Peace dividend
    }
    
    payoff Nation2 {
        (Arm, Arm): -100
        (Disarm, Arm): 50
        (Arm, Disarm): -200
        (Disarm, Disarm): 0
    }
}

Nash Equilibrium: Both arm — a costly, suboptimal outcome.

This is structurally identical to the Prisoner's Dilemma.


Tragedy of the Commons

Multiple actors sharing a depletable resource.

game TragedyOfCommons {
    players Farmer1, Farmer2
    strategies Restrain, Overuse
    
    // Shared pasture: overgrazing destroys it
    
    payoff Farmer1 {
        (Restrain, Restrain): 100  // Sustainable yield
        (Restrain, Overuse): 20    // I'm cautious, they exploit
        (Overuse, Restrain): 150   // I exploit, they're cautious
        (Overuse, Overuse): 10     // Pasture collapses
    }
    
    payoff Farmer2 {
        (Restrain, Restrain): 100
        (Overuse, Restrain): 20
        (Restrain, Overuse): 150
        (Overuse, Overuse): 10
    }
}

Key Insight: Individual rationality leads to collective ruin.


Voting Game

Strategic voting when there are multiple candidates.

game StrategicVoting {
    players Voter1, Voter2
    strategies VoteA, VoteB, VoteC
    
    // Three candidates: A, B, C
    // Voters have different preferences
    // Voter1 prefers: A > B > C
    // Voter2 prefers: B > C > A
    
    payoff Voter1 {
        (VoteA, VoteA): 10   // A wins
        (VoteA, VoteB): 5    // Tie or B wins
        (VoteA, VoteC): 7    // A or C wins
        (VoteB, VoteA): 5    // Tie
        (VoteB, VoteB): 7    // B wins (second choice)
        (VoteB, VoteC): 4    // B or C
        (VoteC, VoteA): 3    // A or C
        (VoteC, VoteB): 4    // B or C
        (VoteC, VoteC): 0    // C wins (worst)
    }
    
    payoff Voter2 {
        (VoteA, VoteA): 0    // A wins (worst)
        (VoteB, VoteA): 5
        (VoteC, VoteA): 3
        (VoteA, VoteB): 5
        (VoteB, VoteB): 10   // B wins (best)
        (VoteC, VoteB): 7
        (VoteA, VoteC): 3
        (VoteB, VoteC): 7
        (VoteC, VoteC): 5    // C wins
    }
}

Climate Agreement

Nations deciding whether to reduce emissions.

var global_benefit = 100;
var reduction_cost = 40;

game ClimateAgreement {
    players Country1, Country2
    strategies Reduce, Pollute
    
    payoff Country1 {
        (Reduce, Reduce): global_benefit - reduction_cost   // 60
        (Reduce, Pollute): global_benefit/2 - reduction_cost // 10
        (Pollute, Reduce): global_benefit/2                  // 50
        (Pollute, Pollute): 0                                // Catastrophe
    }
    
    payoff Country2 {
        (Reduce, Reduce): global_benefit - reduction_cost
        (Pollute, Reduce): global_benefit/2 - reduction_cost
        (Reduce, Pollute): global_benefit/2
        (Pollute, Pollute): 0
    }
}

Challenge: How do we escape (Pollute, Pollute)?


Next Steps

Grammar Specification

Formal grammar for the Tenet programming language in EBNF notation.


Notation

  • | — alternation (choice)
  • * — zero or more
  • + — one or more
  • ? — optional (zero or one)
  • ( ) — grouping
  • " " — terminal (literal token)

Program Structure

program        → declaration* EOF ;

Declarations

declaration    → classDecl
               | funDecl
               | varDecl
               | gameDecl
               | statement ;

classDecl      → "class" IDENTIFIER ( "<" IDENTIFIER )? "{" function* "}" ;

funDecl        → "fun" function ;

function       → IDENTIFIER "(" parameters? ")" block ;

parameters     → IDENTIFIER ( "," IDENTIFIER )* ;

varDecl        → "var" IDENTIFIER ( "=" expression )? ";" ;

Game Theory Declarations

gameDecl       → "game" IDENTIFIER "{" gameBody "}" ;

gameBody       → playersDecl strategiesDecl payoffDecl* ;

playersDecl    → "players" identifierList ;

strategiesDecl → "strategies" identifierList ;

identifierList → IDENTIFIER ( "," IDENTIFIER )* ;

payoffDecl     → "payoff" IDENTIFIER "{" payoffRule* "}" ;

payoffRule     → "(" identifierList ")" ":" payoffValue ;

payoffValue    → payoffTerm ;

payoffTerm     → payoffFactor ( ( "-" | "+" ) payoffFactor )* ;

payoffFactor   → payoffUnary ( ( "/" | "*" ) payoffUnary )* ;

payoffUnary    → "-" payoffUnary | payoffPrimary ;

payoffPrimary  → NUMBER | IDENTIFIER ;

Statements

statement      → exprStmt
               | forStmt
               | ifStmt
               | printStmt
               | returnStmt
               | whileStmt
               | solveStmt
               | block ;

exprStmt       → expression ";" ;

forStmt        → "for" "(" ( varDecl | exprStmt | ";" )
                           expression? ";"
                           expression? ")" statement ;

ifStmt         → "if" "(" expression ")" statement
                 ( "else" statement )? ;

printStmt      → "print" expression ";" ;

returnStmt     → "return" expression? ";" ;

whileStmt      → "while" "(" expression ")" statement ;

solveStmt      → "solve" IDENTIFIER ( "using" IDENTIFIER )? ";" ;

block          → "{" declaration* "}" ;

Expressions

expression     → assignment ;

assignment     → ( call "." )? IDENTIFIER "=" assignment
               | logic_or ;

logic_or       → logic_and ( "or" logic_and )* ;

logic_and      → equality ( "and" equality )* ;

equality       → comparison ( ( "!=" | "==" ) comparison )* ;

comparison     → term ( ( ">" | ">=" | "<" | "<=" ) term )* ;

term           → factor ( ( "-" | "+" ) factor )* ;

factor         → unary ( ( "/" | "*" ) unary )* ;

unary          → ( "!" | "-" ) unary | call ;

call           → primary ( "(" arguments? ")" | "." IDENTIFIER )* ;

arguments      → expression ( "," expression )* ;

primary        → "true" | "false" | "nil" | "this"
               | NUMBER | STRING | IDENTIFIER
               | "(" expression ")"
               | "super" "." IDENTIFIER ;

Lexical Grammar

NUMBER         → DIGIT+ ( "." DIGIT+ )? ;

STRING         → "\"" <any char except "\"">* "\"" ;

IDENTIFIER     → ALPHA ( ALPHA | DIGIT )* ;

ALPHA          → "a" ... "z" | "A" ... "Z" | "_" ;

DIGIT          → "0" ... "9" ;

Operator Precedence

From lowest to highest:

Precedence Operators Associativity
1 or Left
2 and Left
3 == != Left
4 < <= > >= Left
5 + - Left
6 * / Left
7 ! - (unary) Right
8 . () (call) Left

Comments

COMMENT        → "//" <any char except newline>* NEWLINE ;

Multi-line comments (/* */) are not supported.


Next Steps

Keywords & Operators

Complete list of Tenet keywords and operators.


Keywords

Keyword Category Description
and Logic Logical AND (short-circuit)
class OOP Class declaration
else Control Else branch
false Literal Boolean false
for Control For loop
fun Functions Function declaration
game DSL Game definition
if Control Conditional
nil Literal Null/absent value
or Logic Logical OR (short-circuit)
payoff DSL Payoff matrix block
players DSL Player declaration
print I/O Output statement
return Functions Return from function
solve DSL Analyze game
strategies DSL Strategy declaration
super OOP Superclass reference
this OOP Instance reference
true Literal Boolean true
using DSL Solve algorithm selector
var Variables Variable declaration
while Control While loop

Total: 22 keywords


Operators

Arithmetic

Operator Description Example
+ Addition 3 + 47
- Subtraction 10 - 37
* Multiplication 5 * 630
/ Division 20 / 45
- (unary) Negation -5

Comparison

Operator Description
== Equal to
!= Not equal to
< Less than
<= Less than or equal
> Greater than
>= Greater than or equal

Logical

Operator Description
and Logical AND
or Logical OR
! Logical NOT

Punctuation

Single-Character

(  )  {  }  ,  .  -  +  ;  /  *  :

One or Two Character

!   !=
=   ==
>   >=
<   <=

Next Steps

Reserved Words

Words that cannot be used as identifiers.


Complete List

The following words are reserved and cannot be used as variable names, function names, player names, or strategy names:

and        class      else       false      for
fun        game       if         nil        or
payoff     players    print      return     solve
strategies super      this       true       using
var        while

Future Reserved Words

These words may be reserved in future versions:

break      continue   import     export     
match      case       enum       struct
async      await      yield      from

Using these as identifiers is discouraged.


Valid Identifiers

Identifiers must:

  • Start with a letter (a-z, A-Z) or underscore (_)
  • Contain only letters, digits (0-9), or underscores
  • Not be a reserved word

Examples

Identifier Valid?
player1 Yes
_private Yes
MyGame Yes
nash_equilibrium Yes
1stPlayer No (starts with digit)
player-one No (hyphen not allowed)
class No (reserved word)
print No (reserved word)

Naming Conventions

Element Convention Example
Variables camelCase myScore
Functions camelCase calculatePayoff
Classes PascalCase GameSolver
Games PascalCase PrisonersDilemma
Players PascalCase Alice, Firm1
Strategies PascalCase Cooperate, Defect
Constants UPPER_SNAKE MAX_ROUNDS

The Axiom Ecosystem

"The future of computing is not just calculation—it is reasoning."


The Stack

┌──────────────────────────────────────────────┐
│                   ALEXTHIA                   │
│           The Ghost in the Machine           │
│       (Neurosymbolic Reasoning Agent)        │
├──────────────────────────────────────────────┤
│                  AXIOM OS                    │
│           The Neurosymbolic Arena            │
│      (Ai-Native Math Operating System)       │
├──────────────────────┬───────────────────────┤
│         FLUX         │         TENET         │
│   The Mathematical   │     The Strategic     │
│       Engine         │        Engine         │
└──────────────────────┴───────────────────────┘

The Axiom Stack is not a loose collection of tools. It is a single, unified organism designed for the next era of computing.


1. Alexthia: The Ghost in the Shell

Role: The Verifier-Optimizer

Alexthia is not just a chatbot. It is an active reasoning agent deeply integrated into the OS kernel. It doesn't just "generate text"—it perceives, reasons, and acts.

  • Proprioception: Through TenetSense, Alexthia "feels" system load, optimized resource allocation, and strategic contention as raw sensory inputs.
  • Formal Verification: Alexthia doesn't guess. It writes Flux to verify mathematical intuition and Tenet to verify strategic logic.
  • Truth-Seeking: By modeling honesty as a Nash Equilibrium, Alexthia is mathematically bound to avoid sycophancy.

Alexthia is the intelligence that lives within the wires.


2. Axiom OS: The Arena

Role: The Neurosymbolic Substrate

Axiom OS is the first operating system where mathematical objects are first-class citizens.

  • Boot from RAM: The entire OS lives in memory, fleeting and fast.
  • The Scheduler: Tasks aren't just queued; they compete for resources in a real-time market governed by Tenet game theory.
  • The Filesystem: Code isn't just text; it's a graph of verifiable logic.

3. Tenet & Flux: The Two Hemispheres

The brain of the system is split into two specialized engines:

Flux (The Left Brain)

  • Pure Logic & Math
  • Handles vector calculus, linear algebra, and physics simulations.
  • Values: Precision, Speed, Correctness.

Tenet (The Frontal Cortex)

  • Strategy & Decision
  • Handles incentives, negotiation, and multi-agent coordination.
  • Values: Equilibrium, Optimality, Fairness.

The Bridge: How They Speak

Flux and Tenet are designed to interlock. Flux handles the physics of the world; Tenet handles the politics.

# In FLUX: We define the raw utility function (The Math)
export utility(x, y) = x^2 - 2*x*y + y^2

# In TENET: We import it to drive strategic decisions (The Game)
import "utility.flx"

game DeploymentStrategy {
    players RedTeam, BlueTeam
    strategies Attack, Defend
    
    payoff RedTeam {
        (Attack, Defend): utility(10, 5)  -- Payoff calculated by Flux
        (Attack, Attack): utility(0, 0)
        // ...
    }
}

This seamless integration allows Axiom to model complex realities where physical constraints (Flux) clash with strategic goals (Tenet), overseen by an intelligent agent (Alexthia).

This is the Axiom Ecosystem.