エイリアンソースからの非常に巨大なocamlプログラムを修正する必要があります。問題の1つは、プログラムが一見無害な行でクラッシュすることです。
Hashtbl.mem loc_to_no loc
「メモリ不足」の例外があります。重要なのは、そこには確かに十分なメモリがあり、この行は他の入力に対しては問題なく実行され、問題のある入力の処理中はさらに早い段階で実行されます。
で実行するとOCAMLRUNPARAM="v=63"
、クラッシュの直前に印刷される行が表示されます。
構造比較におけるスタックオーバーフロー
関連する構造を以下に定義します。 loc
タイプlocation
です。
type ('a, 'b, 'c) automaton = {
aut_id : int ;
mutable start_location : (('a, 'b, 'c) location) option ;
mutable end_location : (('a, 'b, 'c) location) option ;
mutable aut_attributes : 'a ;
}
and ('a, 'b, 'c) location = {
loc_id : int ;
mutable succs : ('c * ('a, 'b, 'c) location) list ;
mutable preds : ('c * ('a, 'b, 'c) location) list ;
automaton : ('a, 'b, 'c) automaton ;
mutable loc_attributes : 'b ;
}
コードを実行するにはどうすればよいですか?