Prolog - Access Control?

395 views Asked by At

I am currently using interprolog - which is basically java with a prolog backend, allowing both java and prolog calls from each other respectively.

Now If i had say a frontend GUI coded in java swing, say a login dialog, which requested a username and password, instead of using java code to authenticate and store passwords, could I somehow use prolog to check the passwords instead? I've searched the term "access control prolog" and found nothing.

Sorry, i understand this question is a big vague and foggy but any help would be appreciated.

2

There are 2 answers

13
Vincent Ramdhanie On BEST ANSWER

You need to get an instance of a Prolog engine and execute any prolog command. I suppose you will have the prolog database set up in advance and you can create the prolog command that will evaluate to true when a username/password pair authenticates.

Calling this from Java is then easy. You obtain a Prolog Engine implementation say SWISubprocessEngine, and execute your prolog command with the command() method.

This article How can I make a Java program that calls Prolog ? will be most helpful.

0
gmhk On

Yes you can use that