Git Product home page Git Product logo

prolog-boycotting-guide's Introduction

Prolog-Boycotting-Guide

This is a Prolog program that helps customers who are in solidarity with Gaza by providing alternatives to boycotting companies for their involvement in Israel's oppression of Palestinians.

Getting Started

To run the program, you need to have a Prolog interpreter installed on your machine. You can download the interpreter from the following link: SWI-Prolog

Running the program

To run the program, simply open the Prolog interpreter and consult the file rules.pl. Then, you can use the predicates defined in our program to execute queries and get answers.

Predicates implemented

  1. list_orders(CustomerUsername, ListOfOrders): Predicate to list all orders of a specific customer, as a list.
  2. countOrdersOfCustomer(CustomerUsername, Count): Predicate to get the number of orders of a specific customer, given customer username.
  3. getItemsInOrderById(CustomerUsername, OrderID, Items): Predicate to list all items in a specific customer order, given customer username and order ID.
  4. getNumOfItems(CustomerUsername, OrderID, Count): Predicate to get the number of items in a specific customer order, given customer username and order ID.
  5. calcPriceOfOrder(CustomerUsername, OrderID, TotalPrice): Predicate to calculate the price of a given order, given customer username and order ID.
  6. isBoycott(Name): Predicate to determine whether we need to boycott or not, given item name or company name.
  7. whyToBoycott(Name, Justification): Predicate to find the justification why you need to boycott this company/item, given the company name or an item name.
  8. removeBoycottItemsFromAnOrder(CustomerUsername, OrderID, NewList): Predicate to remove all the boycott items from a given order, given a customer username and order ID.
  9. replaceBoycottItemsFromAnOrder(CustomerUsername, OrderID, NewList): Predicate to update the order such that all boycott items are replaced by an alternative (if exists), given a customer username and order ID.
  10. calcPriceAfterReplacingBoycottItemsFromAnOrder(CustomerUsername, OrderID, NewList, TotalPrice): Predicate to calculate the price of the order after replacing all boycott items by its alternative (if exists), given a customer username and order ID.
  11. getTheDifferenceInPriceBetweenItemAndAlternative(Item, Alternative, DiffPrice): Predicate to calculate the difference in price between the boycott item and its alternative.
  12. add/remove_item/alternative/boycott_company(Name, Brand, Price): Predicate to add/remove item/alternative/boycott company to/from the knowledge base.

prolog-boycotting-guide's People

Contributors

nadaamohhamed avatar kareemsakkary avatar nourmuhammad10 avatar hossamahmedfouad avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.