AFTD Auto-Formalizing Theoretical Domains

word_block_exchange_transport_forward

def

Given a block exchange E = (X, A, B, Y) and a binary mask M of type List Bool, word_block_exchange_transport_forward E M is the binary mask defined by M.take E.X.length ++ (M.drop (E.X.length + E.A.length)).take E.B.length ++ (M.drop E.X.length).take E.A.length ++ M.drop (E.X.length + E.A.length + E.B.length).

Statement

def word_block_exchange_transport_forward {α : Type*} (E : WordBlockExchange α) (M : List Bool) : List Bool
Defined in
arXiv:2610.39941, Section 4
Verified
31 Oct 2026
Axioms
none listed
Built on 1
  • WordBlockExchangeA word block exchange consists of four words X, A, B, Y over an alphabet.
Used by 1
  • word_block_exchange_is_pureAn exchange E = (X, A, B, Y) swaps adjacent pure blocks of opposite sources from mask M if A and B are nonempty, either the slice of M for…

Read back from the Lean

A definition of a function word_block_exchange_transport_forward that takes a type α, a WordBlockExchange α record E (having components X, A, B, Y : List α), and a list of booleans M. It returns the list of booleans obtained by concatenating: 1. The first E.X.length elements of M (M.take E.X.length), 2. The slice of length E.B.length starting at index E.X.length + E.A.length in M, 3. The slice of length E.A.length starting at index E.X.length in M, 4. The remaining elements of M starting after index E.X.length + E.A.length + E.B.length. Effectively, if M is decomposed into contiguous blocks corresponding to lengths |E.X|, |E.A|, |E.B|, and the remainder, this swaps the blocks corresponding to E.A and E.B.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- Transport a mask M of XABY forward to XBAY. -/
def word_block_exchange_transport_forward {α : Type*} (E : WordBlockExchange α) (M : List Bool) : List Bool :=
  M.take E.X.length ++
  (M.drop (E.X.length + E.A.length)).take E.B.length ++
  (M.drop E.X.length).take E.A.length ++
  M.drop (E.X.length + E.A.length + E.B.length)
See it in the graphDiscuss this resultChallenge it