KURNIAWAN, TRI BAGUS KURNIAWAN
Unknown Affiliation

Published : 1 Documents Claim Missing Document
Claim Missing Document
Check
Articles

Found 1 Documents
Search

Implementation of Constraint Satisfaction Problem Approach for Solving the Zebra Puzzle with Prolog KURNIAWAN, TRI BAGUS KURNIAWAN; NURYANA, MUHAMMAD RISQI; BIJOKANGKO, RESI SUJIWO
EPIC Journal of Electrical Power Instrumentation and Control Vol 8 No 2 (2025): EPIC
Publisher : Universitas Pamulang, Prodi teknik Elektro

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.32493/epic.v8i2.58721

Abstract

Constraint Satisfaction Problem (CSP) Is a fundamental concept in artificial intelligence used to solve combinatorial problems by satisfying a set of constraints. The Zebra Puzzle is a classical example that involves assigning attributes such as nationality, house color, pet, drink, and candy to five houses based on logical clues. This study aims to implement CSP techniques using the Prolog programming language to solve the Zebra Puzzle. The methodology includes classifying all relevant attributes, encoding constraints into Prolog predicates, and applying helper functions to represent adjacency and ordering relationships. The puzzle is modeled as a list of structured facts, and Prolog’s inference engine is used to derive consistent solutions. The program successfully assigns all attributes to the correct house positions. For example, the Englishman lives in the red house, the Spaniard owns the dog, and the Ukrainian drinks tea. The Norwegian lives in the first house and drinks water, while the Japanese owns the zebra. These results confirm the effectiveness of Prolog in solving structured logic puzzles using CSP. The study concludes that logic programming is a reliable tool for modeling and solving constraint-based problems. This implies broader applicability of CSP in intelligent systems.