Carve two modules out of fact_table_gen.m. compiler/fact_table_check.m: New module containing the code that checks the argument types and modes of the fact table predicate. compiler/fact_table_compile.m: New module containing the code that checks the facts in the fact table against the argument types and modes, and generates the fact table's .c file. compiler/fact_table_gen.m: The remaining part of the old fact_table_gen.m, which contains the code to generate the foreign_procs implementing each procedure of the fact table predicate, mostly building on the C code put into the fact table's .c file by fact_table_compile.m. compiler/ll_backend.m: compiler/notes/compiler_design.html: Include and document the new modules. compiler/add_pragma_impl.m: Conform to the changes above.