Browse Source

Small fix

master
engboris 3 years ago
parent
commit
32122cbae7
  1. 7
      ocaml/Circuits.ml

7
ocaml/Circuits.ml

@ -28,10 +28,11 @@ let get_inputs circ node =
let get_op circ node = let get_op circ node =
let (_, op) = get_node_info circ node in op let (_, op) = get_node_info circ node in op
(* extracts the two first inputs in a list of inputs *)
let extract_bin_ins = function let extract_bin_ins = function
| [] -> failwith "Error extract_bin_ins: no input." | [] -> failwith "Error extract_bin_ins: no input."
| h1::h2::t -> (h1, h2) | h1::h2::t -> (h1, h2)
| _ -> failwith "Error extract_bin_ins: inputs does not match." | _ -> failwith "Error extract_bin_ins: inputs do not match."
(* _________ Evaluation _________ *) (* _________ Evaluation _________ *)
@ -60,8 +61,8 @@ let rec value circ concl =
let rec eval (circ : circuit) : int = let rec eval (circ : circuit) : int =
let (_, _, concl) = let (_, _, concl) =
List.hd (List.filter (fun (_, o, _) -> o = COut) circ) in List.hd (List.filter (fun (_, o, _) -> o = COut) circ)
value circ concl in value circ concl
(* _________ Examples _________ *) (* _________ Examples _________ *)

Loading…
Cancel
Save