Documentation

LeanPool.OrderMaintenance.Machine.Syntax

@[reducible, inline]

Local variable names.

Equations
Instances For
    @[reducible, inline]

    Array names: numbers, so that distinct arrays are told apart by arithmetic.

    Equations
    Instances For

      Natural-number arithmetic, shifts, comparisons and Boolean binary primitives.

      Instances For
        @[instance_reducible]
        Equations
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Boolean negation and most-significant-bit primitives.

          Instances For
            @[instance_reducible]
            Equations
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              RAM expressions over natural-number locals and named array cells.

              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  RAM instructions with bounded loops, guarded failure and framed procedure calls.

                  • skip : Stmt
                  • assign (x : Reg) (e : Expr) : Stmt
                  • store (a : Arr) (i e : Expr) : Stmt
                  • alloc (a : Arr) (n : Expr) : Stmt

                    Give array a capacity n (the value of the expression), all cells reading 0. One step: constant-time-initializable arrays.

                  • seq (s t : Stmt) : Stmt
                  • ite (c : Expr) (s t : Stmt) : Stmt
                  • loop (x : Reg) (n : Expr) (body : Stmt) : Stmt

                    for x < n do s: n is evaluated once; iteration k sets x := k first.

                  • call (name : String) (params : List Reg) (body : Stmt) (rets : List Reg) (args : List Expr) (dsts : List Reg) : Stmt

                    Call a procedure with formal parameters params, body body and result locals rets. The arguments are evaluated in the caller's frame, the body runs in a fresh frame, and the results are copied back to dsts.

                  • fail : Stmt

                    A failed algorithmic guard: aborts up to the nearest catch.

                  • catch (s h : Stmt) : Stmt

                    catch s h: run s; if it executes fail, run the handler h on the state reached.

                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      A procedure declaration; Proc.invoke turns it into a call statement.

                      • name : String

                        Diagnostic name carried by a procedure call.

                      • params : List Reg

                        Local registers receiving the argument values.

                      • rets : List Reg

                        Local registers whose final values are returned.

                      • body : Stmt

                        Statement executed in the procedure’s local frame.

                      Instances For

                        Build a RAM procedure call with argument expressions and destination registers.

                        Equations
                        Instances For

                          Concrete syntax #

                          Comparisons return 1 or 0.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Non-strict comparison of two machine expressions.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Equality comparison of two machine expressions.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Boolean conjunction of two machine expressions.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  Boolean disjunction of two machine expressions.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Boolean negation of a machine expression.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Read an indexed cell of a named machine array.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Sequential composition of two machine statements.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          Assignment of a machine expression to a local register.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For