cana.function_generation.rof module

Syntactic read-once (ROF) expression builders.

Builders produce variables a0…a{k-1} with symbolic & / |. Each variable appears once.

cana.function_generation.rof.and_chain(k)[source]
Parameters:

k (int)

Return type:

str

cana.function_generation.rof.or_chain(k)[source]
Parameters:

k (int)

Return type:

str

cana.function_generation.rof.half_or_half_and(k)[source]

(a0 | … | a{k/2-1}) & a{k/2} & … & a{k-1} (even k).

Parameters:

k (int)

Return type:

str

cana.function_generation.rof.pairwise_and_or(k)[source]

(a0 & a1) | (a2 & a3) | … (even k).

Parameters:

k (int)

Return type:

str

cana.function_generation.rof.pairwise_or_and(k)[source]

(a0 | a1) & (a2 | a3) & … (even k).

Parameters:

k (int)

Return type:

str

cana.function_generation.rof.makino_ibaraki(k)[source]

Makino–Ibaraki-style product-of-sums: (a0|a1|a2) & (a3|a4|a5) & ….

Width-3 rows give the classic O(3^{k/3}) prime-implicant growth for this unate / read-once family. Requires k divisible by 3.

Parameters:

k (int)

Return type:

str

cana.function_generation.rof.random_rof(k, seed=None)[source]

Random read-once formula over a0…a{k-1} (each var once).

Parameters:
  • k (int)

  • seed (int | None)

Return type:

str