Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.52 KB

File metadata and controls

47 lines (36 loc) · 1.52 KB

AI-Football-League 🤖

This Prolog project was created as part of an AI course assignment.
It analyzes football league data using logic-based queries.

📁 Files

  • 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

✅ Tasks Covered

  1. Get all players in a specific team
    ?- players_in_team(barcelona, L).
  2. Count how many teams are from a specific country
    ?- team_count_by_country(spain, N).
  3. Find the team with the most championship titles
    ?- most_successful_team(T).
  4. List all matches where a specific team participated
    ?- matches_of_team(barcelona, L).
  5. Count all matches where a specific team participated
    ?- num_matches_of_team(barcelona, N).
  6. Find the top goal scorer in the tournament
    ?- top_scorer(P).
  7. Find the most common position in a specific team
    ?- most_common_position_in_team(barcelona, Pos).
  8. Bonus Task: Eliminate unneeded backtracking for accurate results

🚀 How to Run

  1. Make sure all files are in the same folder.
  2. Open your Prolog environment (e.g., SWI-Prolog).
  3. Load both files using:
?- consult('league_data').
?- consult('league_analysis').

👥 Team Members

  • Israa Mohamed
  • Amany Mohamed
  • Salma Mohamed