PROLOG LISTs 1. Definition: - an ordered set - i.e. the order of - TopicsExpress



          

PROLOG LISTs 1. Definition: - an ordered set - i.e. the order of list elements matters - access is indexed: 1st element, 2nd element, 3rd element and so on.. - Other named access: last element, all but the first element and so on.. 2. Prolog has two ways for writing a list - both can be used or mixed - “comma-separated” notation - head/tail notation 3. Comma-separated list notation 4. Examples: - [1,2,3,4,5] : a list of the numbers from 1 to 5 in ascending order - [5,4,3,2,1]: a different list from [1,2,3,4,5] - [the,cat,sat,on,the,mat]: a list of the 6 words in the sentence the cat sat on the mat in left to right order - []: the empty list - a list with no members
Posted on: Thu, 18 Jul 2013 19:44:42 +0000

Trending Topics



Recently Viewed Topics




© 2015