{"id":1232,"date":"2018-04-08T16:55:09","date_gmt":"2018-04-08T21:55:09","guid":{"rendered":"http:\/\/haleyai.com\/wordpress\/?p=1232"},"modified":"2018-07-13T18:27:38","modified_gmt":"2018-07-13T23:27:38","slug":"is-business-logic-too-much-for-classical-logic","status":"publish","type":"post","link":"http:\/\/haleyai.com\/wordpress\/2018\/04\/08\/is-business-logic-too-much-for-classical-logic\/","title":{"rendered":"Is business logic too much for classical logic?"},"content":{"rendered":"<p>Business logic is not limited to mathematical logic, as in <a href=\"https:\/\/en.wikipedia.org\/wiki\/First-order_logic\" target=\"_blank\">first-order predicate calculus<\/a>.<\/p>\n<p>Business logic commonly requires &#8220;aggregation&#8221; over sets of things, like summing the value of claims against a property to subtract it from the value of that property in order to determine the equity of the owner of that property.<\/p>\n<ul>\n<li>The equity of the owner of a property in the property is the excess of the value of the property over the value of claims against it.<\/li>\n<\/ul>\n<p>There are various ways of describing such extended forms of classical logic.\u00a0 The most relevant to most enterprises is the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Relational_algebra\" target=\"_blank\">relational algebra<\/a> perspective, which is the base for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Relational_database\" target=\"_blank\">relational databases<\/a> and <a href=\"https:\/\/en.wikipedia.org\/wiki\/SQL\" target=\"_blank\">SQL<\/a>.\u00a0 Another is the notion of generalized quantifiers.<\/p>\n<p>In either case, it is a practical matter to be able to capture such logic in a rigorous manner.\u00a0 The example below shows how that can be accomplished using English, producing the following axiom in extended logic:<\/p>\n<ul>\n<li>\u2200(?x15)(property(?x15)\u2192\u2200(?x10)(owner(of)(?x10,?x15)\u2192\u2203(?x31)(value(of(?x15))(?x31)\u2227\u2211(?x44)(\u2200(?x49)(claim(against(?x15))(?x49)\u2192value(of(?x49))(?x44))\u2192\u2203(?x26)(excess(of(?x31))(over(?x44))(?x26)\u2227equity(in(?x15))(of(?x10))(?x26))))))<\/li>\n<\/ul>\n<p>This logic can be realized in various ways, depending on the deployment platform, such as:<!--more--><\/p>\n<ul>\n<li>In in <a href=\"https:\/\/linguist.haleyai.com\/LogicProgrammingUsingProlog.html\" target=\"_blank\">Flora<\/a>, for example, (and in most Prolog&#8217;s) there are aggregation operations that will build a list of answers (e.g., bindings of ?x44 above).\u00a0 Then a simple predicate would compute the desired aggregate.<\/li>\n<li>In SQL, a &#8220;SELECT SUM (value) WHERE &#8230; statement\u00a0 might be issued as an inner join given an outer selection of properties and their owners (or the specification of either or both in the query).<\/li>\n<\/ul>\n<p><a href=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/EquityofOwnerinPropertyExcessofValueofPropertyoverValueofClaimsagainstProperty1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1235\" title=\"Equity(of(Owner))(in(Property))=Excess(of(Value(of(Property))))(over(Value(of(Claims(against(Property))))))\" src=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/EquityofOwnerinPropertyExcessofValueofPropertyoverValueofClaimsagainstProperty1.png\" alt=\"\" width=\"1259\" height=\"461\" srcset=\"http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/EquityofOwnerinPropertyExcessofValueofPropertyoverValueofClaimsagainstProperty1.png 1259w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/EquityofOwnerinPropertyExcessofValueofPropertyoverValueofClaimsagainstProperty1-300x109.png 300w, http:\/\/haleyai.com\/wordpress\/wp-content\/uploads\/EquityofOwnerinPropertyExcessofValueofPropertyoverValueofClaimsagainstProperty1-1023x374.png 1023w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>A competent business rules management system (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Business_rule_management_system\" target=\"_blank\">BRMS<\/a>) should be able to handle even more than classical logic and relational algebra.\u00a0 It should be able to handle exceptions and preferences, as in the Semantics of Business Vocabulary and Rules standard (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Semantics_of_Business_Vocabulary_and_Business_Rules\" target=\"_blank\">SBVR<\/a>).<\/p>\n<p>SBVR is a good specification, if you ignore its suggestions regarding stilted English. The fact that SBVR has not been more widely adopted is due to limitations of BRMS vendors&#8217; technology, not its awkward English, however.<\/p>\n<p>For more details, see the Confessions of a Production Rule Vendor pages (<a href=\"http:\/\/haleyai.com\/wordpress\/2013\/06\/22\/confessions-of-a-production-rule-vendor-part-1\/\">part 1<\/a> and <a href=\"http:\/\/haleyai.com\/wordpress\/2018\/04\/02\/confessions-of-a-production-rule-vendor-part-2\/\">part 2<\/a>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Business logic is not limited to mathematical logic, as in first-order predicate calculus. Business logic commonly requires &#8220;aggregation&#8221; over sets of things, like summing the value of claims against a property to subtract it from the value of that property in order to determine the equity of the owner of that property. The equity of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/haleyai.com\/wordpress\/2018\/04\/08\/is-business-logic-too-much-for-classical-logic\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Is business logic too much for classical logic?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,10,21],"tags":[29,133,543,871,232,238,796,870,869],"class_list":["post-1232","post","type-post","status-publish","format-standard","hentry","category-business-rules-management","category-formal-logic","category-rules-engines","tag-aggregation","tag-first-order-logic","tag-flora","tag-generalized-quantifiers","tag-predicate-calculus","tag-prolog","tag-relational-algebra","tag-relational-database","tag-sql"],"_links":{"self":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1232"}],"version-history":[{"count":5,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1232\/revisions"}],"predecessor-version":[{"id":1238,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/posts\/1232\/revisions\/1238"}],"wp:attachment":[{"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1232"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haleyai.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}