{"id":3814,"date":"2024-09-07T18:28:46","date_gmt":"2024-09-07T18:28:46","guid":{"rendered":"https:\/\/workhouse.sweetdishy.com\/?p=3814"},"modified":"2024-09-07T18:28:47","modified_gmt":"2024-09-07T18:28:47","slug":"shift-operation","status":"publish","type":"post","link":"https:\/\/workhouse.sweetdishy.com\/index.php\/2024\/09\/07\/shift-operation\/","title":{"rendered":"Shift Operation"},"content":{"rendered":"\n<p id=\"Arti00011967\">Shift operation is used to shift one element of a list to the left rotationally. For example, given a list [a,b,c,d], then after shifting, it will be [b,c,d,a]. To implement shifting operation in Prolog, copy the following rule in kb5.pl and execute the instructions as given below. The clause list_shift(L1, L2) takes an input list in the form [Head|Tail] and then recursively concatenates Head after the Tail.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9789357053778\/files\/images\/img_p582.png\" alt=\"images\"\/><\/figure>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/learning.oreilly.com\/api\/v2\/epubs\/urn:orm:book:9789357053778\/files\/images\/img_p582-2.png\" alt=\"images\" width=\"607\" height=\"342\"><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shift operation is used to shift one element of a list to the left rotationally. For example, given a list [a,b,c,d], then after shifting, it will be [b,c,d,a]. To implement shifting operation in Prolog, copy the following rule in kb5.pl and execute the instructions as given below. The clause list_shift(L1, L2) takes an input list [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3341,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[464],"tags":[],"class_list":["post-3814","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-language-prolog"],"jetpack_featured_media_url":"https:\/\/workhouse.sweetdishy.com\/wp-content\/uploads\/2024\/08\/programming.png","_links":{"self":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3814","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/comments?post=3814"}],"version-history":[{"count":1,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3814\/revisions"}],"predecessor-version":[{"id":3815,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/posts\/3814\/revisions\/3815"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media\/3341"}],"wp:attachment":[{"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/media?parent=3814"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/categories?post=3814"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workhouse.sweetdishy.com\/index.php\/wp-json\/wp\/v2\/tags?post=3814"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}