Documentation

CslibFrontier.Algorithms.WordRAM.TreeDecomposition.Scan

Shared memory-block and bag-scan primitives for tree-decomposition algorithms #

Certified Memory.Prog routines over allocated memory blocks, shared by the Word-RAM dynamic programs over tree decompositions (CslibFrontier.Algorithms.WordRAM.TreeDecomposition.IndependentSet and CslibFrontier.Algorithms.WordRAM.TreeDecomposition.CSP):

Main definitions #

Main results #

Bounded-word exponentiation (powProg) #

Arguments (base, exp) for powProg.

  • base : ℕ

    Base word.

  • exp : ℕ

    Exponent count.

Instances For

    Compute args.base ^ args.exp by repeated multiplication.

    powProg as a framed triple: it only reads, returns base ^ exp and leaves the state unchanged.

    Linear bag membership scan (bagMemProg) #

    Arguments (target, base, len) for bagMemProg.

    • target : ℕ

      Element sought.

    • base : ℕ

      Base address of the bag list in memory.

    • len : ℕ

      Length of the bag list.

    Instances For

      Return 1 if args.target occurs in the args.len-word slice at args.base, else 0.

      bagMemProg as a framed triple: it only reads, returns the membership flag and leaves the state unchanged.