MCPcopy Create free account
hub / github.com/docknetwork/crypto / get_responses_to_skip

Method get_responses_to_skip

proof_system/src/prover.rs:1166–1188  ·  view source on GitHub ↗

Get indices of witnesses of statement index `s_id` for which response should not be generated since it already exists. If the response didn't exists, then the given `resp_generated` will be updated

(
        s_id: usize,
        total_msgs: usize,
        disjoint_equalities: &[EqualWitnesses],
        resp_generated: &mut BTreeSet<usize>,
    )

Source from the content-addressed store, hash-verified

1164 /// Get indices of witnesses of statement index `s_id` for which response should not be generated since it already exists.
1165 /// If the response didn't exists, then the given `resp_generated` will be updated
1166 fn get_responses_to_skip(
1167 s_id: usize,
1168 total_msgs: usize,
1169 disjoint_equalities: &[EqualWitnesses],
1170 resp_generated: &mut BTreeSet<usize>,
1171 ) -> BTreeSet<usize> {
1172 let mut skip_responses_for = BTreeSet::new();
1173 for w_id in 0..total_msgs {
1174 let wit_ref = (s_id, w_id);
1175 for (i, eq) in disjoint_equalities.iter().enumerate() {
1176 if eq.has_wit_ref(&wit_ref) {
1177 if resp_generated.contains(&i) {
1178 skip_responses_for.insert(w_id);
1179 } else {
1180 resp_generated.insert(i);
1181 }
1182 // Exit loop because equalities are disjoint
1183 break;
1184 }
1185 }
1186 }
1187 skip_responses_for
1188 }
1189
1190 fn update_resp_generated(
1191 s_id: usize,

Callers

nothing calls this directly

Calls 2

has_wit_refMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected