zoukankan      html  css  js  c++  java
  • (原)在ubuntu 中安装 swi prolog 和 简单的使用

    1. 参考网址:http://www0.cs.ucl.ac.uk/staff/mahmed/teaching/intro.html
    2. 参考网址:http://www.swi-prolog.org/build/Debian.html
    3. 安装
    % sudo apt-add-repository ppa:swi-prolog/stable
    % sudo apt-get update
    % sudo apt-get install swi-prolog
    

           2. 检测ubuntu 版本的方法 :打开 terminal 输入 swipl --version

           3. 检索方法:

    by loading a database (your program) holding the facts and rules you want to use with; ['progName.pl'] or compile('progName.pl') or consult('progName.pl'), for example

    ?- ['family.pl'].
    ?- compile('family.pl').
    ?- consult('family.pl').

    注意:一定在结尾处有 "."

            4. 退出方法:

    ?- halt.
    <Ctrl>+<D>

            5.查询方法:

    The listing command can be used to list the predicates that you have specified in your program or those in to the built in the interpreter, for example: 

    ?- listing(grandparent).
    
    grandparent(X, Y) :-
            parent(X, Z),
            parent(Z, Y).
    
    Yes
  • 相关阅读:
    WPF--常用布局介绍
    NUGET常用命令
    WPF 3D变换应用
    WPF MeshGeometry3D
    一组西门子S7 报文
    西门子与三菱PLC报文比较
    西门子S7报文解析
    C#与西门子PLC通讯
    Django之model admin自定义后台管理
    django ajax
  • 原文地址:https://www.cnblogs.com/assassin/p/3520093.html
Copyright © 2011-2022 走看看