jagomart
digital resources
picture1_Hello World Pdf 191187 | Lp1 Item Download 2023-02-04 03-28-02


 193x       Filetype PDF       File size 0.09 MB       Source: www.inf.ed.ac.uk


File: Hello World Pdf 191187 | Lp1 Item Download 2023-02-04 03-28-02
getting started we ll use sicstus prolog logic programming free for uofe students can request through windows support lecture 1 getting started available on all dice machines tutorials exams will ...

icon picture PDF Filetype PDF | Posted on 04 Feb 2023 | 2 years ago
Partial capture of text on file.
                                                                                Getting started
                                                                      • We’ll use SICStus Prolog
            Logic Programming                                            • Free for UofE students
                                                                         • Can request through Windows support
                     Lecture 1: Getting started                       • Available on all DICE machines
                                                                         • Tutorials, exams will be based on this version
                                                                      • Online documentation
                                                                         http://www.sics.se/isl/sicstuswww/site/index.html
                   Hello World                                                     Hello World
       • Prolog is an interactive language.                           • Prolog is an interactive language.
          $ sicstus                                                      $ sicstus
                                                                         ?- 
                   Hello World                                                   Hello World
       • Prolog is an interactive language.                          • Prolog is an interactive language.
          $ sicstusPrompt                                               $ sicstus
          ?-                                                            ?- print(’hello world’).
                   Hello World                                                   Hello World
       • Prolog is an interactive language.                          • Prolog is an interactive language.
          $ sicstus                            Goal                     $ sicstus
          ?- print(’hello world’).                                      ?- print(’hello world’).
                                                                        hello world
                                                                        yes
                   Hello World                                                   Hello World
       • Prolog is an interactive language.                          • Prolog is an interactive language.
          $ sicstus                                                     $ sicstus
          ?- print(’hello world’).                                      ?- print(’hello world’).
                                     Output                                                        Output
          hello world                                                   hello world
          yes                                                           yes
                                                                                    response
                         Atoms                                                      Variables
       • An atom is                                                  • A variable is a sequence of alphanumeric 
          • a sequence of alphanumeric characters                       characters
             • usually starting with lower case letter                  • usually starting with an uppercase letter 
          • or, a string enclosed in single quotes                   • Examples:
       • Examples:                                                      X  Y  Z  Parent Child Foo 
          homer   marge   lisa   bart
          ‘Mr. Burns’ ’Principal Skinner’
                       Predicates                                                        Predicates (2)
        • A predicate has the form                                             • Predicates have a name
                             p(t1,...,tn)                                        • = atom p in p(t1,...,tn)
           where p is an atom and t1...tn are terms                            • and an arity
           (For now a term is just an atom or variable)                          • = number of arguments (n)
        • Examples: 
                                                                               • Predicates with same name but different arity 
           father(homer, bart)                                                    are different
           mother(marge, bart)                                                 • We write foo/1, foo/2, ... to refer to these 
                                                                                  different predicates
                             Facts                                                                 Facts
           A fact is an assertion that a predicate is                           A fact is an assertion that a predicate is 
        •                                                                    •                                   Punctuation is 
           true:                                                                true:                              important!
           father(homer, bart).                                                 father(homer, bart).
           mother(marge, bart).                                                 mother(marge, bart).
        • A collection of facts is sometimes called a                        • A collection of facts is sometimes called a 
           knowledge base (or database).                                        knowledge base (or database).
The words contained in this file might help you see if this file matches what you are looking for:

...Getting started we ll use sicstus prolog logic programming free for uofe students can request through windows support lecture available on all dice machines tutorials exams will be based this version online documentation http www sics se isl sicstuswww site index html hello world is an interactive language sicstusprompt print goal yes output response atoms variables atom a variable sequence of alphanumeric characters usually starting with lower case letter uppercase or string enclosed in single quotes examples x y z parent child foo homer marge lisa bart mr burns principal skinner predicates predicate has the form have name p t tn where and are terms arity now term just number arguments n same but different father mother write to refer these facts fact assertion that punctuation true important collection sometimes called knowledge base database...

no reviews yet
Please Login to review.