Showing posts with label logic programming. Show all posts
Showing posts with label logic programming. Show all posts
Monday, April 30, 2018
Boolean formulas
Boolean formulas can be used to express constraint satisfaction problems in general, among other things. The manner in which we solve boolean formulas is defined by resolution. Assuming that a given boolean formula is effectively expressed in conjunctive normal formula we can apply resolution to any two clauses in the boolean formula which have complementary literals, which will get us a new clause which contains all literals that do not have complements. Well applying the resolution rule, if we get a clause that is simpler then some larger clause that contains it, we can eliminate the larger clauses. This is one way we can use deduction to solve logic problems.
Friday, October 18, 2013
FRIL
The FRIL language (Fuzzy Relation Inference Language) combines logic programming with uncertainity. FRIL combines support for classical logic with support for fuzzy logic and probability unified by mass assingments. FRIL has a list based syntax so in a way it is a dialect of Lisp:
(less-than
(1 2)
(2 3)
(3 4))
FRIL supports both discrete and continuous fuzzy sets each with their own syntactic representations. The extension of classical logic with fuzzy sets makes FRIL a much more general and powerful language then Prolog.
Thursday, October 17, 2013
Extensions to classical logic
An intelligent reasoning system must be able to effectively handle information that is uncertain, imprecise, and vague. This implies that an intelligent reasoning system should have a much richer system of logic then the boolean algebraic logic which is used to define mathematics.
Extensions to the classical logic system including fuzzy logic which has degrees of belief, paraconsistent logic which has both belief and doubt, and probablistic logic which uses probability distributions. A reasoning system which uses such advanced logics may play a significant role in the construction of an AI.
Extensions to the classical logic system including fuzzy logic which has degrees of belief, paraconsistent logic which has both belief and doubt, and probablistic logic which uses probability distributions. A reasoning system which uses such advanced logics may play a significant role in the construction of an AI.
Tuesday, August 20, 2013
Four valued logic
Given a preordering relation there are four possible results of a comparison between two elements: they are incomparable, the first value is less then the second, the first value is greater then the second, and they are both equal. Given that the comparison is less then there are four possible logical values corresponding to these comparison results: none, false, true, and both.
There is a knowledge order corresponding to these four truth values [#{none}, #{false true} #{both}]. We can intersect the comparison results of preorders under the knowledge ordering to get another preorder. When we cannot produce an exact comparison like with irrational numbers the none value can be used to represent our uncertainity.
In general the values of none, false, true, and both can be used to deal with uncertain and/or non-monotonic reasoning. One advantage of four valued logic over three valued logic is that it is still binary so each truth value can be represented as two bits in this system.
There is a knowledge order corresponding to these four truth values [#{none}, #{false true} #{both}]. We can intersect the comparison results of preorders under the knowledge ordering to get another preorder. When we cannot produce an exact comparison like with irrational numbers the none value can be used to represent our uncertainity.
In general the values of none, false, true, and both can be used to deal with uncertain and/or non-monotonic reasoning. One advantage of four valued logic over three valued logic is that it is still binary so each truth value can be represented as two bits in this system.
Monday, August 15, 2011
Basic predicate functions
After discussing sets and predicates in my previous post I have come up with some basic predicate functions:
(def every-true? (partial every? true?))
(def some-true? (comp not nil? (partial some #{true})))
(defn union
[& predicates]
(fn [& obj]
(every-true? (map (fn [predicate] (apply predicate obj)) predicates))))
(defn intersection
[& predicates]
(fn [& obj]
(some-true? (map (fn [predicate] (apply predicate obj)) predicates))))
(defn cartesian-product
[& predicates]
(fn [& obj]
(and
(= (count obj) (count predicates))
(every-true?
(map
(fn [i]
(apply (nth predicates i) (nth obj i)))
(range 0 (count obj)))))))
Saturday, August 13, 2011
Sets and predicates
Set theory doesn't make any distinction between sets defined extensionally (sets) or sets defined intensionally (predicates). Here are some sets:
#{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
#{0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20}
Here are the same things as predicates:
(fn [n] (<= 0 n 10))
(fn [n] (and (even? n) (<= 0 n 20)))
Some means must be developed to deal with these two different presentations of classes.
Subscribe to:
Posts (Atom)