This Prolog project was created as part of an AI course assignment.
It analyzes football league data using logic-based queries.
league_data.pl: Contains facts about teams, players, matches, and goals.league_analysis.pl: Contains Prolog predicates that solve and analyze the league data.AI - Assignment 1 [Spring 2025].pdf: The original assignment description provided by the course.
π View Assignment Description
- Get all players in a specific team
?- players_in_team(barcelona, L). - Count how many teams are from a specific country
?- team_count_by_country(spain, N). - Find the team with the most championship titles
?- most_successful_team(T). - List all matches where a specific team participated
?- matches_of_team(barcelona, L). - Count all matches where a specific team participated
?- num_matches_of_team(barcelona, N). - Find the top goal scorer in the tournament
?- top_scorer(P). - Find the most common position in a specific team
?- most_common_position_in_team(barcelona, Pos). - Bonus Task: Eliminate unneeded backtracking for accurate results
- Make sure all files are in the same folder.
- Open your Prolog environment (e.g., SWI-Prolog).
- Load both files using:
?- consult('league_data').
?- consult('league_analysis').- Israa Mohamed
- Amany Mohamed
- Salma Mohamed