Tôi đã viết hàm được sử dụng để phân tách hàm Boolean, vấn đề là biên dịch tôi nhận được điều này: "Cảnh báo 5: ứng dụng chức năng này là một phần, có thể một số đối số bị thiếu". Làm cách nào để giải quyết vấn đề này? Tôi đã thiết lập sai khớp patter hoặc tôi không thể chạy hoạt động này với mô hình phù hợp vớiVấn đề với đối sánh mẫu trong ocaml
Mã này là như sau:
let rec decomposition state_init state prec formula =
match formula with
And form -> (fun() ->
let f1 = List.hd form in
let f2 = And(List.tl form)in
let new_state = Forms (state_init,f1) in
decomposition state_init new_state state f1;
decomposition state_init new_state state f2;
Hashtbl.add graph new_state (("",false,state :: []) , []) ;
let x = Hashtbl.find graph state in
let succ = state :: snd x in
let (desc,last,ptrs) = fst x in
Hashtbl.replace graph state (("And-node",last,ptrs) , succ))