1 / 4

PROLOG PROGRAMLAMA DİLİNDE LİSTELER

PROLOG PROGRAMLAMA DİLİNDE LİSTELER. Yılmaz KILIÇASLAN. Sunu Planı. Liste yapısının tanımı Örnekler. Prolog’ta Liste Yapısı. Liste, özyinelemeli bir yapıya sahiptir.

robbin
Download Presentation

PROLOG PROGRAMLAMA DİLİNDE LİSTELER

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PROLOG PROGRAMLAMA DİLİNDE LİSTELER Yılmaz KILIÇASLAN

  2. Sunu Planı • Liste yapısının tanımı • Örnekler

  3. Prolog’ta Liste Yapısı • Liste, özyinelemeli bir yapıya sahiptir. • Bildirimsel Açıdan:Listenin ilk bileşeni listenin ilk elemanıdır ve ikinci bileşeni geriye kalan elemanları barındıran bir başka listedir. • Prosedürel Açıdan: • Özyinelemenin tabanı (base) boş listedir. Bir çift köşeli parantez ile gösterilir: []. • Boş olmayan bir listenin elemanları şu iki yoldan birisiyle gösterilirler: • Köşeli parantezler içerisinde virgülle ayrılarak sıralanırlar (örn: [a, b, c, d, e]). • Liste başında yer alanların birkaçı virgülle ayrılarak sıralanır ve geriye kalanlar bir | sembolünün ardından: • ya bir başka listenin içinde (örn: [a,b,c | [d, e]]) • ya da • değer alabilir bir değişkenle (örn: [a,b,c | Rest]) veya • anonim bir değişkenle (örn: [a,b,c | _] ) gösterilir.

  4. Örnekler • Eşitlenebilir liste örnekleri • Liste elemanı • Listeleri ekleme • Ön liste, art liste, alt liste • Listeyi tersine çevirme • Listenin son elemanını bulma • Listenin uzunluğunu bulma • ...

More Related