1 / 9

INF 1771 – Inteligência Artificial

INF 1771 – Inteligência Artificial. Aula 10 – Utilizando o SWI-Prolog em C++. Edirlei Soares de Lima. SWI-Prolog. http://www.swi-prolog.org/download/stable. Configuração. Control Panel -> System -> Advanced -> Environment Variables

tori
Download Presentation

INF 1771 – Inteligência Artificial

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INF 1771 – Inteligência Artificial Aula 10 – Utilizando o SWI-Prolog em C++ Edirlei Soares de Lima

  2. SWI-Prolog • http://www.swi-prolog.org/download/stable

  3. Configuração • ControlPanel -> System ->Advanced-> EnvironmentVariables • Adicionar o diretório “C:\Program Files\pl\bin” a variável “PATH” do sistema.

  4. Configuração – Visual Studio • Include Directory: “C:\Program Files\pl\include”

  5. Configuração – Visual Studio • Library Directory: “C:\Program Files\pl\lib\”

  6. Configuração – Visual Studio • Dependência: swipl.lib

  7. Exemplo de Programa progenitor(sara,isaque). progenitor(abraao,isaque). progenitor(abraao,ismael). progenitor(isaque,esau). progenitor(isaque,jaco). progenitor(jaco,jose). mulher(sara). homem(abraao). homem(isaque). homem(ismael). homem(esau). homem(jaco). homem(jose). filho(Y,X) :- progenitor(X,Y). mae(X,Y) :- progenitor(X,Y), mulher(X). avo(X,Z) :- progenitor(X,Y), progenitor(Y,Z). irmao(X,Y) :- progenitor(Z,X), progenitor(Z,Y). ancestral(X,Z) :- progenitor(X,Z). ancestral(X,Z) :- progenitor(X,Y), ancestral(Y,Z).

  8. Exemplo de Programa #include <SWI-cpp.h> #include <iostream> using namespace std; int main(){ char* argv[] = {"swipl.dll", "-s", "D:\\teste.pl", NULL}; PlEngine e(3,argv); PlTermv av(2); av[1] = PlCompound("jose"); PlQuery q("ancestral", av); while (q.next_solution()) { cout << (char*)av[0] << endl; } cin.get(); return 1; }

  9. Manual • http://www.swi-prolog.org/pldoc/index.html

More Related