#Programming_paradigms : #Logic programming
Based on formal logic.
Any program is a set of sentences in logical form, expressing facts and rules about some problem domain.
Major logic programming language families include #Prolog, Answer set programming (#ASP) and #Datalog.
In all of these languages, rules are written in the form of clauses:
Facts are rules that have no body.
Based on formal logic.
Any program is a set of sentences in logical form, expressing facts and rules about some problem domain.
Major logic programming language families include #Prolog, Answer set programming (#ASP) and #Datalog.
In all of these languages, rules are written in the form of clauses:
H if B1 and … and Bn.H is called the head of the rule and B1, …, Bn is called the body.Facts are rules that have no body.