Prolog insert, modify and delete facts on a separated database text file

前端 未结 2 1962
逝去的感伤
逝去的感伤 2021-01-13 22:37

I have a prolog database file with lots of facts knowledge.pl. For example:

father_of(joe,paul).
father_of(joe,mary).
mother_of(jane,paul).
moth         


        
2条回答
  •  我在风中等你
    2021-01-13 22:58

    If you are using SWI-Prolog there are several choices:

    Searching for prolog persistence I stumped into persistency: a module that at first glance could be useful.

    Then there is a library for 'external tables', i.e. stored in files and indexed. You should use that if you have data that doesn't fit in memory, or if loading/saving the entire data set takes too long.

    Otherwise, the answer from thanosQR suggest the 'old fashioned' way to handle persistence.

提交回复
热议问题