# Inference Rule (IR):

An inference rule, also known as a logical rule or a deductive rule, is a principle or guideline used in logical reasoning to derive new statements or conclusions from existing statements or premises. Inference rules form the foundation of deductive reasoning and are employed in various fields such as mathematics, philosophy, and computer science.

Inference rules typically have the form of “If A, then B,” where A represents the given premises or statements, and B represents the conclusion that can be logically derived from A. These rules are based on the principles of logic and aim to ensure that the conclusions drawn are valid and sound.

There are several commonly used inference rules, each with its own specific form and purpose. Some examples include:

1. Modus Ponens: If A implies B and A is true, then B is true. Example: If it is raining (A), then the ground is wet (B). It is raining (A), therefore the ground is wet (B).
2. Modus Tollens: If A implies B and B is false, then A is false. Example: If it is raining (A), then the ground is wet (B). The ground is not wet (not B), therefore it is not raining (not A).
3. Disjunctive Syllogism: If A or B is true, and A is false, then B is true. Example: It is either sunny (A) or cloudy (B). It is not sunny (not A), therefore it must be cloudy (B).
4. Conjunction: If A is true and B is true, then A and B are both true. Example: It is raining (A) and the ground is wet (B), therefore it is raining and the ground is wet (A and B).

These are just a few examples of inference rules, and there are many more depending on the logical system or framework being used. Inference rules provide a systematic way of drawing valid conclusions based on given premises, facilitating logical reasoning and analysis.

### The Functional dependency has 6 types of inference rule:

Functional dependencies in a relational database describe the relationships between attributes or sets of attributes. While functional dependencies do not directly correspond to inference rules, they can be used in conjunction with inference rules to derive new functional dependencies. Here are six types of inference rules commonly used with functional dependencies:

1. Reflexivity: If Y is a subset of X, then X → Y is a valid functional dependency. Example: If {A} ⊆ {A, B}, then {A, B} → {A} is a valid functional dependency.
2. Augmentation: If X → Y is a valid functional dependency and Z is a set of attributes, then XZ → YZ is also a valid functional dependency. Example: If {A} → {B} is a valid functional dependency and {C} is a set of attributes, then {AC} → {BC} is also a valid functional dependency.
3. Transitivity: If X → Y and Y → Z are valid functional dependencies, then X → Z is also a valid functional dependency. Example: If {A} → {B} and {B} → {C} are valid functional dependencies, then {A} → {C} is also a valid functional dependency.
4. Union: If X → Y and X → Z are valid functional dependencies, then X → YZ is also a valid functional dependency. Example: If {A} → {B} and {A} → {C} are valid functional dependencies, then {A} → {B, C} is also a valid functional dependency.
5. Decomposition: If X → YZ is a valid functional dependency, then X → Y and X → Z are also valid functional dependencies. Example: If {A} → {B, C} is a valid functional dependency, then {A} → {B} and {A} → {C} are also valid functional dependencies.
6. Pseudotransitivity: If X → Y and WY → Z are valid functional dependencies, then WX → Z is also a valid functional dependency. Example: If {A} → {B} and {BC} → {D} are valid functional dependencies, then {ABC} → {D} is also a valid functional dependency.

These inference rules can be applied to functional dependencies to derive new functional dependencies or to simplify existing ones. They help in analyzing the dependencies within a relational database and ensuring data integrity and consistency.