Linux command
gprolog 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Start GNU Prolog interpreter
gprolog
Load and run file
gprolog --consult-file [program.pl]
Compile to executable
gplc [program.pl] -o [program]
Run query from command line
gprolog --query-goal "[goal]"
说明
GNU Prolog is a Prolog compiler with constraint solving over finite domains. It compiles Prolog to native code and provides an interactive interpreter. GNU Prolog supports ISO Prolog with extensions for constraint logic programming, making it suitable for combinatorial problems, scheduling, and AI applications.
参数
- --consult-file _file_
- Load Prolog file at startup.
- --query-goal _goal_
- Execute goal after loading.
- --init-goal _goal_
- Execute initialization goal.
- --entry-goal _goal_
- Entry point goal.
- --no-top-level
- Exit after executing goals.
FAQ
What is the gprolog command used for?
GNU Prolog is a Prolog compiler with constraint solving over finite domains. It compiles Prolog to native code and provides an interactive interpreter. GNU Prolog supports ISO Prolog with extensions for constraint logic programming, making it suitable for combinatorial problems, scheduling, and AI applications.
How do I run a basic gprolog example?
Run `gprolog` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --consult-file _file_ do in gprolog?
Load Prolog file at startup.