Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
96f5f82
WIP: fIMDP
Zinoex Aug 29, 2025
0db849f
WIP: IMC kernels working
Zinoex Aug 31, 2025
b23c389
Remove unused sub2ind
Zinoex Aug 31, 2025
1af647b
Add IMDP constructor, fix strategies, fix indexing order, reenable an…
Zinoex Sep 1, 2025
482d14b
Fix Data module after model restructurings
Zinoex Sep 3, 2025
fa07953
Fix size checks
Zinoex Sep 3, 2025
b5f90ed
Add and test bellman kernel for products of IntervalAmbiguitySets
Zinoex Sep 4, 2025
060b394
HolyTraits :chefskiss:
Zinoex Sep 11, 2025
5270528
Test sparse
Zinoex Sep 11, 2025
5fdc8f3
Add recursive OMax for fIMDPs
Zinoex Sep 11, 2025
87f6525
Fix and test dense CUDA
Zinoex Sep 11, 2025
dc6d857
Prettify output of FactoredRMDPs including inferred properties
Zinoex Sep 12, 2025
dc406c8
Fix valuetype
Zinoex Sep 15, 2025
889e65c
Switch to 1 warp per state (rather than per state/action pair) for Cu…
Zinoex Sep 15, 2025
092acb0
Merge branch 'fm/fimdp' of https://github.com/Zinoex/IntervalMDP.jl i…
Zinoex Sep 15, 2025
daf718a
Add pretty printing of problems
Zinoex Sep 15, 2025
8668f0f
Fix regression
Zinoex Sep 15, 2025
932f7b5
Fix policy device conversion
Zinoex Sep 15, 2025
91d1e6b
Fix strategy synthesis for CUDA
Zinoex Sep 15, 2025
430d216
Fix strategy validity check for CUDA
Zinoex Sep 15, 2025
b1c1c6e
Fix Base.show for Property
Zinoex Sep 15, 2025
d5cadd8
Add vertex enumeration bellman update algorithm
Zinoex Sep 17, 2025
ee7a479
Optimize vertex enumeration
Zinoex Sep 18, 2025
21b89b8
Test sparse vertex enumeration
Zinoex Sep 18, 2025
6ed1d40
Begin updating the documentation
Zinoex Sep 18, 2025
e4cf63f
Start adding documentation to all these changes
Zinoex Sep 18, 2025
f32d6df
Fix mathematical definition of fIMDPs
Zinoex Sep 18, 2025
61a6572
Add eprint where available
Zinoex Sep 18, 2025
c2e88cf
Clarify specification
Zinoex Sep 18, 2025
05ef452
Add construction examples to models.md
Zinoex Sep 18, 2025
a7298d9
Add implicit self-loop example
Zinoex Sep 18, 2025
4dcc23b
Print outputs in docs
Zinoex Sep 19, 2025
c97abe3
Begin documenting specifications
Zinoex Sep 20, 2025
78f73f1
Merge branch 'fm/fimdp' of github.com:Zinoex/IntervalMDP.jl into fm/f…
Zinoex Sep 20, 2025
3c15a17
Fix error in describing safety via duality
Zinoex Sep 20, 2025
2caa749
Document complex properties
Zinoex Sep 22, 2025
e9b6237
Reduce references heading to not show up in list
Zinoex Sep 22, 2025
365421e
Fix citation indentation issues
Zinoex Sep 22, 2025
b8ef39e
Document bellman algorithms
Zinoex Sep 25, 2025
7abb7cf
Fix a todo in test/base/imdp.jl
Zinoex Sep 25, 2025
582ca5f
Fix typo
Zinoex Sep 25, 2025
c5a8169
Fix math mode in documentation of complex properties
Zinoex Sep 25, 2025
ee61bb0
Clarify
Zinoex Sep 25, 2025
32c5c67
Narrow the exposed interface
Zinoex Sep 25, 2025
76985d8
WIP: Adding doctests
Zinoex Sep 27, 2025
5a5a275
Populate docstring for FactoredRobustMarkovDecisionProcess
Zinoex Sep 27, 2025
cd10ad8
Add doctest output
Zinoex Sep 27, 2025
ab9e89e
Populate docstrings for IMCs and IMDPs
Zinoex Sep 27, 2025
3c8f57a
Improve docstrings for IMCs and IMDPs
Zinoex Sep 27, 2025
facd2fb
Move TODOs of DFA
Zinoex Sep 27, 2025
4373ac5
Fix O-max bellman for small CuSparse.
Zinoex Sep 28, 2025
fe25251
WIP large CuSparse kernel
Zinoex Sep 28, 2025
92dd8f1
Fix CuSparse O-max kernel
Zinoex Sep 28, 2025
2db8ac7
Re-add bellman documentation
Zinoex Sep 29, 2025
c6405ae
Update property docstrings
Zinoex Sep 29, 2025
252942b
Fix maxsupportsize
Zinoex Sep 30, 2025
e04c70f
Make type parameters consistent for specifications
Zinoex Sep 30, 2025
c65a4cf
Update usage.md
Zinoex Oct 1, 2025
39cb48f
Format
Zinoex Oct 1, 2025
5831fa2
Update FormatCheck.yml
Zinoex Oct 1, 2025
deb5651
Update compat bounds for StyledStrings
Zinoex Oct 1, 2025
9b72a99
Fix tests
Zinoex Oct 1, 2025
ac220f1
Bump compat of Julia to 1.11 (due to the use of the public kw)
Zinoex Oct 1, 2025
9a28d75
Test specification.jl more thoroughly
Zinoex Oct 1, 2025
c5c6fcd
Test show for AbstractSafety and Specification
Zinoex Oct 1, 2025
4de5afa
Test IntervalAmbiguitySets
Zinoex Oct 1, 2025
108b31b
Remove length checks from Marginal (already encoded in parametric tup…
Zinoex Oct 1, 2025
9d239e6
Fix and improve sanity checks for sparse IntervalAmbiguitySets
Zinoex Oct 1, 2025
ef5dffe
Add DFA Safety properties
Zinoex Oct 13, 2025
b4c37ca
Fix initialization of extract_strategy!
Zinoex Oct 15, 2025
4160d8d
Add appropriate tolerances to tests
Zinoex Oct 15, 2025
40be71f
Fix extract_strategy! for StationaryStrategyCache
Zinoex Oct 15, 2025
c154410
Change CUDA compat bounds
Zinoex Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.10'
- '1.11'
- 'nightly'
os:
- ubuntu-latest
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: [1.10.0]
julia-version: [1.11.0]
julia-arch: [x86]
os: [ubuntu-latest]
steps:
Expand All @@ -23,11 +23,8 @@ jobs:

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="1.0.62"))'
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="2.1.6"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.10'
version: '1.11'
- uses: julia-actions/cache@v2
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
Expand Down
10 changes: 8 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ version = "0.6.0"

[deps]
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"

[weakdeps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand All @@ -21,13 +24,16 @@ IntervalMDPCudaExt = ["Adapt", "CUDA", "GPUArrays", "LLVM"]

[compat]
Adapt = "4"
CUDA = "5.1"
CUDA = "5.9.1"
CommonSolve = "0.2.4"
GPUArrays = "10, 11"
HiGHS = "1.19.0"
JSON = "0.21.4"
JuMP = "1.29.0"
LLVM = "7, 8, 9"
NCDatasets = "0.13, 0.14"
julia = "1.9"
StyledStrings = "1.0.3"
julia = "1.11"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,28 @@
[![Build Status](https://github.com/zinoex/IntervalMDP.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/zinoex/IntervalMDP.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Codecov](https://codecov.io/gh/Zinoex/IntervalMDP.jl/graph/badge.svg?token=K62S0148BK)](https://codecov.io/gh/Zinoex/IntervalMDP.jl)

IntervalMDP.jl is a Julia package for modeling and certifying Interval Markov Decision Processes (IMDPs) via Value Iteration.
for modeling
and verifying properties of various subclasses of factored Robust Markov Decision Processes (fRMDPs), in particular
Interval Markov Decision Processes (IMDPs) and factored IMDPs (fIMDPs) via Value Iteration.

IMDPs are a generalization of Markov Decision Processes (MDPs) where the transition probabilities
are represented by intervals instead of point values, to model uncertainty. IMDPs are also frequently
chosen as the model for abstracting the dynamics of a stochastic system, as one may compute upper
and lower bounds on transitioning from one region to another.
RMDPs are an extension of Markov Decision Processes (MDPs) that account for uncertainty in the transition
probabilities, and the factored variant introduces state and action variables such that the transition model
is a product of the transition models of the individual variables, allowing for more compact representations
and efficient algorithms. This package focuses on different subclasses of fRMDPs for which value iteration
can be performed efficiently including Interval Markov Chains (IMCs), IMDPs, orthogonally-decoupled IMDPs
(odIMDPs), and fIMDPs.

The aim of this package is to provide a user-friendly interface to solve value iteration for IMDPs
with great efficiency. Furthermore, it provides methods for accelerating the computation of the
certificate using CUDA hardware.
The aim of this package is to provide a user-friendly interface to solve verification and control synthesis
problems for fRMDPs with great efficiency, which includes methods for accelerating the computation using
CUDA hardware, pre-allocation, and other optimization techniques.

## Features
- Value iteration (Bellman operator via O-maximization)
- Dense and sparse matrix support
- Parametric probability and value types for customizable precision including rationals and floating-point numbers
- Multithreaded CPU and CUDA-accelerated value iteration
- Data loading and writing in formats by various tools (PRISM, bmdp-tool, IMDP.jl)
- Value iteration over IMCs, IMDPs, odIMDPs, and fIMDPs.
- Multithreaded CPU and CUDA-accelerated value iteration.
- Dense and sparse matrix support.
- Parametric probability types (`Float64`, `Float32`, `Rational{BigInt}`) for customizable precision. Note that
`Rational{BigInt}` is not supported for CUDA acceleration.
- Data loading and writing in formats by various tools (PRISM, bmdp-tool, IntervalMDP.jl)

## Installation

Expand All @@ -44,7 +49,7 @@ The goal is to compute the maximum pessimistic probability of reaching state 3 w
using IntervalMDP

# IMC
prob = IntervalProbabilities(;
prob = IntervalAmbiguitySets(;
lower = [
0.0 0.5 0.0
0.1 0.3 0.0
Expand Down
10 changes: 8 additions & 2 deletions benchmark/imdp/execute.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
using Revise, BenchmarkTools
using IntervalMDP, CUDA

V_conv, _, u = value_iteration(prob)
display(@benchmark value_iteration(prob))
cu_prob = IntervalMDP.cu(prob)

function test()
CUDA.@sync solve(cu_prob)
end

test() # Warm-up
display(@benchmark test())
12 changes: 10 additions & 2 deletions benchmark/imdp/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ using IntervalMDP, IntervalMDP.Data, SparseArrays, CUDA, Adapt

path = joinpath(@__DIR__, "multiObj_robotIMDP.txt")
mdp, terminal_states = read_bmdp_tool_file(path)
prop = InfiniteTimeReachability(terminal_states, 1e-6)

marginal = marginals(mdp)[1]
amb = IntervalAmbiguitySets(
Array(ambiguity_sets(marginal).lower),
Array(ambiguity_sets(marginal).gap),
)

mdp = IntervalMarkovDecisionProcess(amb, num_actions(mdp), initial_states(mdp))
prop = FiniteTimeReachability(terminal_states, 100)
spec = Specification(prop, Pessimistic, Maximize)
prob = Problem(mdp, spec)
prob = VerificationProblem(mdp, spec)
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[deps]
Clarabel = "61c947e1-3e6d-4ee4-985a-eec8c727bd6e"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
IntervalMDP = "051c988a-e73c-45a4-90ec-875cac0402c7"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
20 changes: 13 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using IntervalMDP, IntervalMDP.Data
using Documenter
using Documenter, DocumenterCitations

push!(LOAD_PATH, "../src/")
DocMeta.setdocmeta!(IntervalMDP, :DocTestSetup, :(using IntervalMDP); recursive = true)

bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib"); style = :numeric)

makedocs(;
modules = [IntervalMDP, IntervalMDP.Data],
authors = "Frederik Baymler Mathiesen <frederik@baymler.com> and contributors",
Expand All @@ -12,24 +14,28 @@ makedocs(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://www.baymler.com/IntervalMDP.jl",
edit_link = "main",
assets = String[],
assets = String["assets/citations.css"],
),
pages = [
"Home" => "index.md",
"Usage" => "usage.md",
"Data formats" => "data.md",
"Theory" => "theory.md",
"Models" => "models.md",
"Specifications" => "specifications.md",
"Algorithms" => "algorithms.md",
"Reference" => Any[
"API reference" => Any[
"Systems" => "reference/systems.md",
"Specifications" => "reference/specifications.md",
"Solve Interface" => "reference/solve.md",
"Data Storage" => "reference/data.md",
"Index" => "api.md",
],
"Index" => "api.md",
"Data formats" => "data.md",
"Developer docs" => "developer.md",
"References" => "references.md",
],
doctest = false,
doctest = true,
checkdocs = :exports,
plugins = [bib],
)

deploydocs(; repo = "github.com/Zinoex/IntervalMDP.jl", devbranch = "main")
Loading
Loading