Skip to content

Commit

Permalink
exists, vector interface
Browse files Browse the repository at this point in the history
  • Loading branch information
CopperCableIsolator committed Nov 28, 2024
1 parent f018a06 commit 70dbf4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/cdomains/affineEquality/sparseImplementation/sparseVector.ml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module SparseVector: AbstractVector =
failwith "TODO"

let map2_with f v v' =
failwith "TODO"
failwith "deprecated"

let findi f v =
failwith "TODO"
Expand Down Expand Up @@ -173,9 +173,14 @@ module SparseVector: AbstractVector =
{entries = entries'; len = v.len + v'.len}

let exists f v =
failwith "TODO"

let rev v =
let c = v.len in
let rec exists_aux at f v =
match v with
| [] -> if at = 0 then false else f A.zero
| (xi, xv)::xs -> if f xv then true else exists_aux (at - 1) f xs
in (exists_aux c f v.entries)

let rev v =
failwith "TODO"

let rev_with v =
Expand Down
2 changes: 2 additions & 0 deletions src/cdomains/affineEquality/vector.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ sig

val insert_val_at: int -> num -> t -> t

val map_preserve_zero: ((int * num) -> (int * num)) -> t -> t
val map2_preserve_zero: ((int * num) -> (int * num) -> (int * num)) -> t -> t -> t
val apply_with_c: (num -> num -> num) -> num -> t -> t

val apply_with_c_with: (num -> num -> num) -> num -> t -> unit
Expand Down

0 comments on commit 70dbf4d

Please sign in to comment.