(String[] args)
| 11 | |
| 12 | public class Init { |
| 13 | public static void main(String[] args) throws Exception { |
| 14 | // CLI options: https://www.swi-prolog.org/pldoc/man?section=cmdline |
| 15 | // https://www.swi-prolog.org/FAQ/FindResources.html |
| 16 | |
| 17 | |
| 18 | if (System.getenv("SWI_HOME_DIR") != null || |
| 19 | System.getenv("SWI_EXEC_FILE") != null || |
| 20 | System.getenv("SWIPL_BOOT_FILE") != null) { |
| 21 | String init_swi_config = |
| 22 | String.format("%s %s %s -F swipl -g true -q --no-signals --no-packs", |
| 23 | System.getenv("SWI_EXEC_FILE") == null ? "swipl" : |
| 24 | System.getenv("SWI_EXEC_FILE"), |
| 25 | System.getenv("SWIPL_BOOT_FILE") == null ? "" : |
| 26 | String.format("-x %s", System.getenv("SWIPL_BOOT_FILE")), |
| 27 | System.getenv("SWI_HOME_DIR") == null ? "" : |
| 28 | String.format("--home=%s", System.getenv("SWI_HOME_DIR"))); |
| 29 | System.out.println(String.format("\nSWIPL initialized with: %s", init_swi_config)); |
| 30 | |
| 31 | JPL.setDefaultInitArgs(init_swi_config.split("\\s+")); // initialize SWIPL engine |
| 32 | } else |
| 33 | System.out.println("No explicit initialization done: no SWI_HOME_DIR, SWI_EXEC_FILE, or SWIPL_BOOT_FILE defined"); |
| 34 | |
| 35 | // JPL.setTraditional(); |
| 36 | JPL.init(); |
| 37 | System.out.println("Prolog engine actual init args: " + Arrays.toString(Prolog.get_actual_init_args())); |
| 38 | |
| 39 | System.out.println(); |
| 40 | System.out.println("=========================================================="); |
| 41 | report_selected_flags(); |
| 42 | System.out.println("=========================================================="); |
| 43 | report_versions(); |
| 44 | System.out.println("=========================================================="); |
| 45 | report_all_flags(); |
| 46 | |
| 47 | |
| 48 | } |
| 49 | |
| 50 | public static void report_selected_flags() { |
| 51 | System.out.println("REPORTING SELECTED FLAGS: \n"); |
nothing calls this directly
no test coverage detected