zoukankan      html  css  js  c++  java
  • Prolog 逻辑推导语言

    Prolog

    https://en.wikipedia.org/wiki/Prolog

    Prolog is a general-purpose logic programming language associated with artificial intelligence and computational linguistics.[1][2][3]

    Prolog has its roots in first-order logic, a formal logic, and unlike many other programming languages, Prolog is declarative: the program logic is expressed in terms of relations, represented as facts and rules. A computation is initiated by running a query over these relations.

    Prolog是一种通用目的的 逻辑编程 语言, 与人工智能 和 计算语言学有关。

    Prolog源于一阶逻辑,一种形式逻辑学,所以和其他很多编程语言不通。 其实 声明式的, 程序逻辑被以关系表达, 表述为 fact 和 rule。

    使用查询,触发程序的计算,计算的目标在这些关系中搜索答案。

    学习

    http://www.learnprolognow.org/lpnpage.php?pageid=online

    http://www.cnblogs.com/zhanjindong/p/3329647.html

    http://www.learnprolognow.org/slides/official/LPNchapter1.pdf

    demo

    苏格拉底三段论:

    是人就会死,苏格拉底是人

    结论:苏格拉底会死

    知识库:

    die(X):-person(X).
    person(socrates).

    查询语句:

    die(socrates).

    线上运行环境:

    https://swish.swi-prolog.org/

  • 相关阅读:
    bzoj3211 花神游历各国
    bzoj1010
    day8
    day6&7
    bzoj1087
    noi同步赛day1
    bzoj1076
    day3&4&5
    bzoj1079 dp
    cholesky分解
  • 原文地址:https://www.cnblogs.com/lightsong/p/7538150.html
Copyright © 2011-2022 走看看