Postingan

Menampilkan postingan dari Januari, 2018

Session 13(Last) : Logic Programming Languages

Introduction Logic programs are declarative rather than procedural, which means that only the specifications of the desired results are stated rather than detailed procedures for producing them. Programs in logic programming languages are collections of facts and rules. Programming that uses a form of symbolic logic as a programming language is often called logic programming, and languages based on symbolic logic are called logic programming languages, or declarative languages. We have chosen to describe the logic programming language Prolog, because it is the only widely used logic language. A proposition can be thought of as a logical statement that may or may not be true. It consists of objects and the relationships among objects. Formal logic was developed to provide a method for describing propositions, with the goal of allowing those formally stated propositions to be checked for validity. The simplest propositions, which are called atomic propositions, consist of compoun...

Session 10 : Concurrency

Gambar
Concurrency in software execution can occur at four different levels: - Machine instruction level - High-level language statement level - Unit level - Program level Subprogram-Level Concurrency * A task or process or thread is a program unit that can be in concurrent execution with other program units * Tasks differ from ordinary subprograms in that:   - A task may be implicitly started   - When a program unit starts the execution of a task, it is not necessarily suspended   - When a task’s execution is completed, control may not return to the caller * Tasks usually work together Two General Categories of Tasks * Heavyweight tasks execute in their own address space * Lightweight tasks all run in the same address space – more efficient * A task is disjoint if it does not communicate with or affect the execution of any other task in the program in any way Task Synchronization * A mechanism that controls the order in which tasks execute * Two kinds of sync...

Session 12 : Function Programming Language

Mathematical Functions A mathematical function is a mapping of members of one set, called the domain set, to another set, called the range set. One of the fundamental characteristics of mathematical functions is that the evaluation order of their mapping expressions is controlled by recursion and conditional expressions, rather than by the sequencing and iterative repetition that are common to the imperative programming languages. Another important characteristic of mathematical functions is that because they have no side effects and cannot depend on any external values, they always map a particular element of the domain to the same element of the range. However, a subprogram in an imperative language may depend on the current values of several nonlocal or global variables. This makes it difficult to determine statically what values the subprogram will produce and what side effects it will have on a particular execution. A mathematical function maps its parameter(s) to a value (or v...