ch08ex01.pro

来自「prolog,人工智能推理程序,运行环境prolog」· PRO 代码 · 共 24 行

PRO
24 行
字号
/*
   Turbo Prolog 2.0 Chapter 8, Example Program 1
   
   Copyright (c) 1986, 88 by Borland International, Inc
   
*/
   
domains
   list = integer* /* or whatever type you wish to use */

predicates
   write_a_list(list)

clauses
   write_a_list([]). /* If the list is empty, do nothing more. */

   write_a_list([H|T]) :- /* Match the head to H and the tail to
T, then... */
      write(H), nl,
      write_a_list(T).

goal
   write_a_list([1, 2, 3]).

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?