package jasmin

  1. Overview
  2. Docs
Compiler for High-Assurance and High-Speed Cryptography

Install

dune-project
 Dependency

Authors

Maintainers

Sources

jasmin-compiler-v2025.06.2.tar.bz2
sha256=aa0d21f532c1560a0939244cfd1c8414ba2b42c9d1403960f458500446cb1ebb

doc/jasmin.linter/Linter/BackwardAnalyser/Make/index.html

Module BackwardAnalyser.Make

Functor used to create a module implementing forward analysis.

It takes a module implementing the Logic interface and returns a module implementing the S signature.

Each instruction is annotated with its OUT domain and the IN domain is passed to the next instruction. Domain are updated using the functions provided by the Logic module. Control flow is handled as follow :

  • if bloc : * we analyse blocs then and else with the input domain d, producing two annotations a_then a_else * we merge the two annotations using the Logic.account function
  • while bloc (b1, condition, b2) : * we account the condition with OUT annotation (corresponding to the out of while loop) and an Empty annotation (corresponding to the body of while loop) * we loop and analyse the body of the while bloc (b1,b2,condition) until we reach a fixpoint * we return the corresponding domain
  • for bloc : * we convert the for loop to a while loop using a proxy variable for the loop variable : inline int i; for i = 0 to 10 { ... }

becomes :

inline int i; inline int i_proxy = 0; while (i_proxy < 10) { i = i_proxy; ... i_proxy++; } * we analyse the while loop with the while loop logic * we forget the proxy variable introduced by the for loop

Parameters

module L : Logic

Signature

type domain = L.domain
val analyse_function : ('info, 'asm) Jasmin.Prog.func -> (domain Annotation.annotation, 'asm) Jasmin.Prog.func

Entrypoint for analysis. args :

  • ('info,'asm) Prog.func (function to analyse) returns :d
  • (domain Annotation.annotation, 'asm) Prog.func (annotated function)