SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.07227 · 2020

Qualitative Controller Synthesis for Consumption Markov Decision Processes

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2005.07227.json · badge: /api/ran/2005.07227.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xblahoud/FiMDP canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
argmin Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/energy_solvers.py
code served (permissive licence) · get_code("9e877129d4b97851")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from math import inf

torch.manual_seed(0)

# The argmin function takes:
# 1. items: an iterable of items
# 2. func: a callable that takes an item and returns a numeric value

# We'll create simple test data:
# - items: a list of small integers or tensors
# - func: a function that computes some metric on each item

items = [5, 2, 8, 1, 9]

def func(item):
    """A simple function that returns the item itself as the value to minimize."""
    return item

ARGS = {
    "items": items,
    "func": func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_MECs Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/explicit.py
code served (permissive licence) · get_code("98b883dc2d6331ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Analyze the function to understand what's needed
# get_MECs(mdp) takes an MDP object
# The function calls:
# - mdp.num_states
# - mdp.actions_for_state(s)
# - a.get_succs() (returns something with .intersection() method - set-like)
# - mdp.state_succs(s) (returns iterable of successor states)

class Action:
    """Represents an action in the MDP with successors"""
    def __init__(self, succs):
        self.succs = succs
    
    def get_succs(self):
        return self.succs


class SimpleMDP:
    """Minimal MDP implementation for testing get_MECs"""
    def __init__(self, num_states, transitions, actions_by_state):
        """
        num_states: number of states
        transitions: dict mapping state -> set of successor states
        actions_by_state: dict mapping state -> list of Action objects
        """
        self.num_states = num_states
        self.transitions = transitions
        self.actions_by_state = actions_by_state
    
    def state_succs(self, s):
        """Return successor states for a given state"""
        return self.transitions.get(s, set())
    
    def actions_for_state(self, s):
        """Return list of actions available at state s"""
        return self.actions_by_state.get(s, [])


# Create a simple test MDP
# Simple cycle: 0 -> 1 -> 2 -> 0 (one MEC)
# Plus a sink state 3
num_states = 4

transitions = {
    0: {1},
    1: {2},
    2: {0},
    3: set()
}

actions_by_state = {
    0: [Action({1})],
    1: [Action({2})],
    2: [Action({0})],
    3: [Action(set())]
}

mdp = SimpleMDP(num_states, transitions, actions_by_state)

ARGS = {
    "mdp": mdp
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_state_name Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/io.py
code served (permissive licence) · get_code("513fefd6171c94a2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import json

class State:
    def __init__(self, state_id):
        self.id = state_id

class MockStateValuations:
    def get_json(self, state):
        # Return a JSON string with some key-value pairs
        data = {
            "property1": "value1",
            "property2": "value2",
            "property3": 42
        }
        return json.dumps(data)

class MockModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.state_valuations = MockStateValuations()

# Create instances
model = MockModel()
state = State(state_id=123)

ARGS = {
    "model": model,
    "state": state
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_distribution Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/distribution.py
code served (permissive licence) · get_code("7abcf5a7af87d296")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# The function expects a mapping (dict-like object) with a .values() method
# that returns probabilities which sum to 1
distribution = {
    0: 0.2,
    1: 0.3,
    2: 0.5
}

ARGS = {
    "distribution": distribution
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pick_best_action Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/energy_solvers.py
code served (permissive licence) · get_code("1d8d5beb49283e72")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from math import inf

torch.manual_seed(0)

# Define a simple function that takes an action and returns (value, prob)
def value_prob_func(action):
    """
    Maps an action to a tuple of (value, probability).
    For demonstration, we'll use the action's properties to compute these.
    """
    if isinstance(action, dict):
        # Simple computation based on action dict
        value = action.get('cost', 1.0)
        prob = action.get('confidence', 0.5)
    elif isinstance(action, torch.Tensor):
        # If action is a tensor, compute value and prob from it
        value = float(action.sum().item())
        prob = float(torch.sigmoid(action.mean()).item())
    else:
        value = float(action)
        prob = 0.5
    return (value, prob)

# Define actions as a list of different types
actions = [
    {'cost': 2.0, 'confidence': 0.8},
    {'cost': 1.5, 'confidence': 0.9},
    {'cost': 1.5, 'confidence': 0.7},
    {'cost': 3.0, 'confidence': 0.95},
]

ARGS = {
    'actions': actions,
    'func': value_prob_func,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
uniform Ran
ran on a synthesized input
xblahoud/FiMDP/fimdp/distribution.py
code served (permissive licence) · get_code("52bf5d683852b10b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function `uniform` takes `destinations` which should be an iterable of states.
# It calls len() on destinations, accesses destinations[-1], and iterates over destinations.
# The destinations appear to be used as dictionary keys, so they should be hashable.
# Looking at the function logic, destinations should be a sequence of distinct identifiers.

torch.manual_seed(0)

# Create a simple list of state identifiers (integers work well as hashable keys)
destinations = [0, 1, 2, 3, 4]

ARGS = {
    "destinations": destinations
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dot_to_svg Not yet run
unverified (harvested, no recorded run)
xblahoud/FiMDP/fimdp/dot.py
code served (permissive licence) · get_code("2851043c9e6a4305")
How it ran

no invocation recorded.

product_energy Not yet run
unverified (harvested, no recorded run)
xblahoud/FiMDP/fimdp/explicit.py
code served (permissive licence) · get_code("6395581ce64e8947")
How it ran

no invocation recorded.

storm_sparsemdp_to_consmdp Not yet run
unverified (harvested, no recorded run)
xblahoud/FiMDP/fimdp/io.py
code served (permissive licence) · get_code("b5675ffa514a2d33")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Consumption Markov Decision Processes (CMDPs) are probabilistic decision-making models of resource-constrained systems. In a CMDP, the controller possesses a certain amount of a critical resource, such as electric power. Each action of the controller can consume some amount of the resource. Resource replenishment is only possible in special reload states, in which the resource level can be reloaded up to the full capacity of the system. The task of the controller is to prevent resource exhaustion, i.e. ensure that the available amount of the resource stays non-negative, while ensuring an additional linear-time property. We study the complexity of strategy synthesis in consumption MDPs with almost-sure Büchi objectives. We show that the problem can be solved in polynomial time. We implement our algorithm and show that it can efficiently solve CMDPs modelling real-world scenarios.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2005.07227")
get_code_for_paper("2005.07227")
have("2005.07227")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2005.07227.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2005.07227.svg)](https://syntology.ai/paper/2005.07227)

Connect an agent — have() is free.