Booking Service

From UBC Wiki

Booking Service

Authors:

Xiaojie Li, Eric Xie, Youssef Farag.

What is the problem?

We are trying to efficiently implement a holiday booking service, and we would like to do it using Prolog. This would allow for the rapid construction of a knowledge base, when can then be queried and added to as requests are made.

What is the something extra?

We have implemented a clean GUI for this program in Java, to avoid terminal input/output. Learning to incorporate Prolog into a Java program was difficult and required careful consideration. We had to use plugins to successfully import the prolog file and functionality into Java. We then wrapped our Prolog code with a GUI which allowed for straightforward interaction with the software. We were hoping to attempt to add NLP, however we found a Java GUI to be a reasonable replacement.

What did we learn from doing this?

We learned how to construct a KB, top to bottom, and query it successfully. It was difficult creating the right structure for the service; Prolog required many functions to take, as input, the parameter we were hoping to find (so that it is replaced by a variable and all values that make the function body true are returned as the result). This type of structure forced us to consider code differently; we start with the output and work our way back towards the function body, rather than the other way around as with most languages. We needed to minimize the number of facts in the initializing of the codebase, to reduce hard-coding and to make the program as flexible as possible. This meant making most of our "types" as dynamic rather than static, allowing for multiple rooms returned and having it handle large itineraries.

Prolog program design turned out to be a very bottom-up process that required a lot of consideration for how to structure our types and the information we needed to represent, to allow for easy querying. Such a language was well suited for a booking service project, because once we had built a KB effectively, it was relatively straightforward to surround it with the relevant architectures.

Links to code etc:

Note, the java maybe(I'm not sure) only work if you have set up the environment variable :

Windows: https://jpl7.org/DeploymentWindows

Mac: https://jpl7.org/DeploymentMacos

Our final work is java.zip in th link. Final .pl file is in the src/ folder in the .zip .

https://drive.google.com/drive/mobile/folders/1GQLnVUD6E2_htXWW2BqSv1-5zNXUTkkf?usp=sharing