Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

Repository files navigation

Collector's Shop expert system

A small educational SWI-Prolog project that demonstrates several knowledge representation techniques using Dota 2 products from Collector's Shop.

Project structure

  • 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.

Requirements

  • SWI-Prolog 8 or newer.

Running the expert system

From the repository root, run:

swipl -q -s expert-system.pl -g main

The 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), ...].

Model query examples

% 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.

Tests

swipl -q -s tests.pl -g run_tests,halt

Updating prices

Check 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.

About

Educational SWI-Prolog expert system demonstrating rule-based reasoning, semantic and frame networks, and Bayesian inference with Dota 2 product data

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages