I'm curious if Logic Programs can do algebra

前端 未结 4 1453
陌清茗
陌清茗 2021-01-02 06:32

I read a brief article about Prolog and Logic Programming. I\'m curious if Logic Programs can do algebra. Like would you be able to ask what the Variable of X is in the equa

4条回答
  •  無奈伤痛
    2021-01-02 07:25

    Yes, Prolog can do algebra.

    If you Google for Prolog and CAS (Computer algebra system) you will get lots of results.

    e.g. Using Prolog as a CAS

    If you understand that Prolog = Syntactic unification + backward-chaining + REPL,

    then realize that it is the unification that is the heart of solving the problems/equations, you may run into equational reasoning which is used for solving problems that contain equals (=). This same logic is also used with automated theorem provers and proof assistants.

    If you look here you will find prolog.ml which implements the unification and backward-chaining in this automated theorem prover.

    You should also check out term rewriting and search Google for term rewriting to learn more about the science of solving equations using terms.

提交回复
热议问题