Logic of Prolog
Prolog is based on First Order Predicate Logic
The scope rule for Prolog is that two uses of an identical name for a logical variable only refer to the same object if the uses are within a single clause.
Programming in Prolog consists of 1)declaring some facts about objects and their relationships. 2) Defining rules about objects and their relationships and 3) asking questions about objects and their relationships
Prolog Relies on pattern matching to provide a semblance of type checking. There is active research on adapting type checking systems for prolog.