Skip to content

Commit 16a1c1c

Browse files
committed
refactor!: Remove unused helper functions
1 parent b5d874a commit 16a1c1c

File tree

3 files changed

+2
-88
lines changed

3 files changed

+2
-88
lines changed

tasm-lib/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ pub fn execute_bench_deprecated(
169169

170170
/// Execute a Triton-VM program and test correct behavior indicators.
171171
/// Modify stack and memory. Panic if anything goes wrong.
172-
#[allow(clippy::too_many_arguments)]
173-
pub fn execute_test(
172+
pub(crate) fn execute_test(
174173
code: &[LabelledInstruction],
175174
stack: &mut Vec<BFieldElement>,
176175
expected_stack_diff: isize,
@@ -254,7 +253,7 @@ pub fn maybe_write_debuggable_vm_state_to_disk(vm_state: &VMState) {
254253
}
255254

256255
/// Prepare state and run Triton VM
257-
pub fn execute_with_terminal_state(
256+
pub(crate) fn execute_with_terminal_state(
258257
program: Program,
259258
std_in: &[BFieldElement],
260259
stack: &[BFieldElement],
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
pub mod array;
22
pub mod claim;
33
pub mod dyn_malloc;
4-
pub mod input;
54
pub mod list;
6-
7-
/// Count the number of non-leaf nodes that were inserted *prior* to
8-
/// the insertion of this leaf.
9-
pub fn non_leaf_nodes_left(leaf_index: u64) -> u64 {
10-
// This formula is derived as follows:
11-
// To get the heights of peaks before this leaf index was inserted, bit-decompose
12-
// the number of leaves before it was inserted.
13-
// Number of leaves in tree of height h = 2^h
14-
// Number of nodes in tree of height h = 2^(h + 1) - 1
15-
// Number of non-leaves is `#(nodes) - #(leaves)`.
16-
// Thus: f(x) = sum_{h}(2^h - 1)
17-
18-
// An upper limit for the loop iterator is the log_2_floor(leaf_index)
19-
let log_2_floor_plus_one = u64::BITS - leaf_index.leading_zeros();
20-
let mut h = 0;
21-
let mut ret = 0;
22-
while h != log_2_floor_plus_one {
23-
let pow = (1 << h) & leaf_index;
24-
if pow != 0 {
25-
ret += pow - 1;
26-
}
27-
h += 1;
28-
}
29-
30-
ret
31-
}

tasm-lib/src/rust_shadowing_helper_functions/input.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)