CS262 Logic and Verification Prolog 3: Lists
CS262 Logic and Verification 1 / 2
Lists in Prolog
Copyright By PowCoder代写 加微信 powcoder
List notation [a,b,c]
Lists in lists [a,b,[c,d,e]]
Access first element of list and the rest by [Head|Tail] Can be iterated: [H1,H2|Tail]
Placeholder for arbitrary expression:
Test membership: member(El,List)
Get nth entry (1-based): nth1(Idx,List,El)
Prolog cut operator: !
CS262 Logic and Verification
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com