{"id":18470860,"url":"https://github.com/inria/zelus","last_synced_at":"2026-03-01T22:02:01.299Z","repository":{"id":44406561,"uuid":"268159323","full_name":"INRIA/zelus","owner":"INRIA","description":"A synchronous language with ODEs","archived":false,"fork":false,"pushed_at":"2026-03-01T16:00:26.000Z","size":65527,"stargazers_count":57,"open_issues_count":0,"forks_count":14,"subscribers_count":8,"default_branch":"main","last_synced_at":"2026-03-01T18:23:23.638Z","etag":null,"topics":["hybrid-systems","ocaml","odes","synchronous-language","zelus"],"latest_commit_sha":null,"homepage":"http://zelus.di.ens.fr","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/INRIA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-05-30T21:02:52.000Z","updated_at":"2026-02-17T14:20:20.000Z","dependencies_parsed_at":"2024-01-23T17:21:22.799Z","dependency_job_id":"fcbe433a-18fb-4f9f-b7d8-0541e81333c8","html_url":"https://github.com/INRIA/zelus","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/INRIA/zelus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INRIA%2Fzelus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INRIA%2Fzelus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INRIA%2Fzelus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INRIA%2Fzelus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/INRIA","download_url":"https://codeload.github.com/INRIA/zelus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/INRIA%2Fzelus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29986240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T21:06:37.093Z","status":"ssl_error","status_checked_at":"2026-03-01T21:05:45.052Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hybrid-systems","ocaml","odes","synchronous-language","zelus"],"created_at":"2024-11-06T10:15:04.790Z","updated_at":"2026-03-01T22:01:56.289Z","avatar_url":"https://github.com/INRIA.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Actions Status](https://github.com/INRIA/zelus/workflows/Build/badge.svg)](https://github.com/INRIA/zelus/actions)\n[![Actions Status](https://github.com/INRIA/zelus/workflows/Opam/badge.svg)](https://github.com/INRIA/zelus/actions)\n\n# Zelus: A Synchronous Language with ODEs\n\nZélus is a synchronous language extended with Ordinary Differential Equations (ODEs) to program hybrid systems that mix discrete-time and continuous-time models.\nAn example is a (discrete-time) model of a control software paired with a (continuous-time) model of the plant.\nThe language shares the basic principles of the synchronous languages [Lustre](https://www-verimag.imag.fr/DIST-TOOLS/SYNCHRONE/lustre-v6/) with modularity features from [Lucid Synchrone](http://www.di.ens.fr/~pouzet/lucid-synchrone/) (type inference, hierarchical automata, and higher-order functions).\nIt is conservatively extended to write continuous-time models expressed by ODEs and zero-crossing events.\nThe compiler is written in [OCaml](https://ocaml.org/) and is structured as a series of source-to-source and traceable transformations that ultimately yield statically scheduled sequential code.\nContinuous-time models are simulated using an off-the-shelf numerical solver (here [Sundials CVODE](https://computation.llnl.gov/casc/sundials/description/description.html#descr_cvode) and, for the moment, the two built-in solvers ode23 and ode45).\n\n## Getting Started\n\nThe easiest way to install Zelus is via [Opam](https://opam.ocaml.org/), the OCaml package manager.\n\n```\n$ opam install zelus\n```\n\nYou can then test your installation with:\n```\n$ zeluc -version\n```\n\nThe manual, examples, and research papers can be found at http://zelus.di.ens.fr\n\n### Optional Dependencies\n\nBy default Zelus relies on the built-in solvers.\nTo switch to Sundials CVODE you need to install sundialsml (which requires sundials).\nSome examples also depend on the zelus gtk library (which requires gtk2.0)\n\n```\n$ opam install sundialsml zelus-gtk\n```\n\n### Docker\n\nWe also provide a dockerfile to setup an environment with all the dependencies.\nBuild the image with (you might need to increase available memory in docker preferences):\n```\n$ make docker-build\n```\n\nRun with:\n```\n$ make docker-run\n```\n\n\n##  A Simple Example\n\nConsider the example of a bouncing ball.\nThe zelus code is the following:\n\n```ocaml\nlet loose = 0.8\nlet     g = 9.81\nlet    x0 = 0.0 \nlet    y0 = 10.0\nlet   x'0 = 1.0\nlet   y'0 = 0.0\n\nlet hybrid main () = () where\n  rec der x  =  x' init x0\n  and der y  =  y' init y0\n  and der x' = 0.0 init x'0\n  and der y' = -.g init y'0 reset up(-.y) -\u003e -.loose *. last y'\n  and present up(-.y) -\u003e local cpt in\n    do  cpt = 0 fby cpt + 1\n    and  () = print_endline (string_of_int cpt) done\n```\n\nThe dynamics of the ball is expressed with four ODEs defining the position `(x, y)` and the speed `(x', y')` of the ball given an initial position `(x0, y0)` and an initial speed `(x'0, y'0)`.\nWhenever the ball hits the ground `up(-. y)` the discrete time code of the body of the `present` construct is executed (here incrementing a simple counter).\n\n### Compilation\n\nThe zeluc compiler takes a zelus file (e.g., `bouncing.zls`) and compile it to OCaml code (e.g., `bouncing.ml`).\n\n```\n$ zeluc bouncing.zls\n```\n\nYou can also specify a simulation node.\nThe compiler then generates an additional file containing the simulation code (e.g., `main.ml`).\n\n```\n$ zeluc -s main bouncing.zls\n```\n\nTo build an executable, the last thing to do is to compile the OCaml code using the `zelus` library.\n\n```\n$ ocamlfind ocamlc -linkpkg -package zelus bouncing.ml main.ml -o bouncing\n```\n\n## Other Examples\n\nThis repository includes runnable examples demonstrating different aspects of the language. \nThe source code for several of the examples can be found in the `examples` directory.\nTo build most of the examples:\n\n```\n$ cd examples \u0026\u0026 make\n```\n\nThe executables can be found in each example directory (e.g., `horloge/horloge_main.exe`).\n\n## Development (inslallation from the sources)\n\n### First, you need to install [opam] (https://opam.ocaml.org) and\n[dune] (https://dune.readthedocs.io/en/stable/).\n\nInstall sundials \u003c= 6.1 (https://computing.llnl.gov/projects/sundials/sundials-software).\nInstall sundialsml 6.1 from the source (https://inria-parkas.github.io/sundialsml/). \nWarning: as of Nov. 2023, sundialsml only works with sundials \u003c= 6.1. We hare\nworking on updating it with the latest version. Moreover, sundialsml only works with OCaml up to version 4.14.1. It does not work yet with OCaml version \u003e= 5.0.\n\nEverything should work then!\n\n### Compiler\n\nWe use [dune](https://dune.readthedocs.io/en/stable/) to build the compiler, the libraries, and the examples.\nTo build the project:\n\n```\n$ ./configure\n$ dune build\n```\n\nThis produces two executables (and some tools in `./tools`):\n- `compiler/zeluc.exe`: native code\n- `compiler/zeluc.bc`: byte code (can be used with ocamldebug)\n\nLibraries are split in two packages:\n- `zelus`: the standard libraries\n- `zelus-gtk`: additional libraries that depend on lablgtk (only built if lablgtk is installed)\n\nThe build automatically detects if sundialsml is installed and updates the librairies accordingly.\n\nThe main Makefile contains useful commands to build the project of install zelus as an opam development package from source.\n\n```\n$ make help\nUsage:\n  make all                 #  Build the compiler and libraries\n  make test                #  Launch the tests via dune\n  make examples            #  Build all the examples\n  make tools               #  Build the tools\n  make install             #  Install as an opam development package pinned to this directory\n  make uninstall           #  Remove opam pin\n  make clean               #  Clean the entire project\n  make docker-build        #  Build the Docker image\n  make docker-run          #  Launch a terminal in the Docker image\n  make help                #  Print this help\n```\n\n### Test\n\nTo run all the tests you can use dune. \n\n```\n$ dune runtest\n```\n\nOr alternatively, the Makefile of the test directory.\n\n```\n$ cd test\n$ make\n```\n\nTests are split into 3 categories: `good`, `bad`, and `run`.\nTo launch a single subset (e.g., `good`):\n```\n$ cd good\n$ make\n```\n\nTo clean generated files:\n```\n$ make clean\n```\n\n## Citing Zelus\n\n```\n@inproceedings{Zelus2013HSCC,\n  author = {Timothy Bourke and Marc Pouzet},\n  title = {Zélus: A Synchronous Language with {ODEs}},\n  booktitle = {16th International Conference on Hybrid Systems: Computation and Control (HSCC'13)},\n  pages = {113--118},\n  month = mar,\n  year = 2013,\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finria%2Fzelus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finria%2Fzelus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finria%2Fzelus/lists"}