A small educational SWI-Prolog project that demonstrates several knowledge representation techniques using Dota 2 products from Collector's Shop.
catalog.pl— the shared product, price, and property catalogue;expert-system.pl— an interactive product finder based on collection, rarity, hero, product type, and duration;semantic-network.pl— catalogue queries represented as a semantic network;frame-network.pl— property access through frames and inheritance;bayesian-network.pl— a separate example of a purchase-related Bayesian network;tests.pl— automated tests for the catalogue and knowledge models.
Prices are expressed in Russian rubles and were recorded on August 5, 2026. They may differ from the current prices on the website. The catalogue includes one-month (305 RUB), six-month (1,720 RUB), and one-year (3,210 RUB) Dota Plus subscriptions.
- SWI-Prolog 8 or newer.
From the repository root, run:
swipl -q -s expert-system.pl -g mainThe program asks you to select one value from each property group. Enter an option number without a trailing period and press Enter. The program then displays every matching product together with its price.
The pure find_matches/2 predicate can also be used without the interactive interface:
?- find_matches([collection(international_2022), rarity(mythical)], Matches).
Matches = [item(dark_behemoth, "Dark Behemoth", 1614), ...].% Semantic network
?- [semantic-network].
?- price(blue_horizons, Price).
Price = 809.
% Frame network: an item's own property
?- [frame-network].
?- value(the_strings_of_suradan, rarity, Rarity).
Rarity = immortal.
% Frame network: an inherited property
?- value(rising_glory, currency, Currency).
Currency = rub.
% Bayesian network
?- [bayesian-network].
?- prob(purchase, [discount], Probability).
Probability = 0.4.swipl -q -s tests.pl -g run_tests,haltCheck the relevant product in the Collector's Shop catalogue, replace the price in its catalog_item/4 fact, and update price_snapshot/2. Run the test suite after making changes.
This project is not affiliated with Collector's Shop and does not perform automated purchases.