OpenLLM-France/wikimedia huggingface dataset:
# Prolog

Welcome to the Prolog book. This book can serve as a textbook or tutorial for anyone who wants to learn the Prolog programming language. No prior programming experience is required. Some basic knowledge of logic can come in handy. For those new to the subject, a short introduction to logic is given, but this is not required reading.
The first chapters of the book (under Basics) describe the central syntax and features of the language. The next section, Programming, explores additional concepts that are useful when programming in Prolog. The chapters under Basics and Programming are meant to be read in order.
The section Built-in Predicates deals with the functions available in many Prolog compilers. These and other chapters can be read in any order.

## Special pages

* What is Prolog?
* History of Prolog
* Introduction to logic
* Glossary
* Built-in predicates
* Frequently Asked Questions
* Exercises (external link)

## Table of contents
### Beginning Prolog

Basics:
    Introduction
    Rules
    Recursive Rules
    Variables
    Lists
    Math, Functions and Equality
    Putting it Together
    Solving a Logic Puzzle
Programming:
    Cuts and Negation
    Reading and Writing code
    Difference Lists
    Definite Clause Grammars
    Inference Engines
Built-in Predicates:
    Testing Terms
    Bagof, Setof and Findall
    Modifying the Database
    Input and Output

### Advanced Prolog

    Associative map
    Search techniques
    Sorting
    Graphics: XPCE

### Prolog and beyond

    Higher Order Programming
    Constraint Logic Programming
    Definite Clause Grammars
    Combining Languages
    A selection of interesting usergroup topics
    External Links
# Prolog/Combining Languages

Prolog programs are rarely used standalone, they are usually embedded in imperative programming languages like in Java, C or C++. It's usually easier to embed it in languages, which support OOP than in C, because the Prolog types are very different from the ones used in imperative languages, and objects can encapsulate their specific behaviour quite well. (e.g. the "not instantiated" state of a variable)

### SWI-Prolog

You can find the documentation about Java-Prolog interface here:
Interfacing with Perl:
# Prolog/Definite Clause Grammars

Prolog has a mechanism for defining certain grammars called Definite Clause Grammar notation. This makes it easy to write parsers. Note that while DCG syntax is part of the ISO standard, DCG semantics are not.
Grammar rules can be written in the form:
For example:
Which will be translated to:
It means, that the sentence clause will receive L0 as input, and after parsing from a sentence from L0, it will give back LREMAINDER. Let's assume that your start symbol is sentence. Then LREMAINDER is expected to be [ ] after a successful parsing. The interpretation of the body of this clause is: if we parse a noun_phrase and a verb_phrase from our sentence, we will get back an empty list.
You can also call prolog predicates using braces.

## Example

An example DCG program, which can parse numbers:
Note: 0'9 means the character 9 (or more precisely, the character code of 9, because there's no distinct character datatype in SWI).
If you try to consult this program, you might get a warning, because we redefined the built-in number/2 predicate.
Running the program:
We get back one "result": it means that the parsing wasn't ambiguous. (There's only one possible parsing tree of the input.)
One of the earlier examples, revappend, can be written using DCG:

## External links

Chomsky hierarchy of grammars on Wikipedia
# Prolog/Built-in predicates

List of built-in predicates in ISO Prolog.

## Term unification
### =/2

    Prolog unification

### (\=)/2

    Not Prolog unifiable

## Type testing
### var/1

    True if term currently is a variable

### atom/1

    True if term is bound to an atom

### integer/1

    True if term is bound to an integer

### float/1

    True if term is bound to a floating point number

### atomic/1

    True if term is bound to an atom, integer or floating point number

### compound/1

    True if term is bound to a compound term

### nonvar/1

    True if term is not a variable

### number/1

    True if term is bound to an integer or floating point number

## Term comparison
### (@=<)/2

    Term less than or equal to

### (==)/2

    Term identical

### (\==)/2

    Term not identical

### (@<)/2

    Term less than

### (@>)/2

    Term greater than

### (@>=)/2

    Term greater than or equal to

## Arithmetic comparison
### '=:='/2

    Arithmetic equal

### '=\='/2

    Arithmetic not equal

### '<'/2

    Arithmetic less than

### '=<'/2

    Arithmetic less than or equal to

### '>'/2

    Arithmetic greater than

### '>='/2

    Arithmetic greater than or equal to

## Input and output
### Stream selection and control
#### open/4, open/3

    Opening a stream

#### close/1, close/2

    Closing a stream

#### set_stream_position/2
### Character input-output
#### nl/0, nl/1
### Reading from binary streams
#### put_byte/2, put_byte/1
### Term input and output
#### read/1, read/2
### Writing terms
#### write_canonical/1, write_canonical/2
## Operators
### current_op/3
## Character conversion
### current_char_conversion/2
## Logic and control
### (\+)/1

    Not provable

### repeat/0
## Atom processing
### number_codes/2
## Implementation defined hooks
### halt/0, halt/1
## Functors
### Evaluable functors
#### (+)/2

    Addition

#### (-)/2

    Subtraction

#### (*)/2

    Multiplication

#### (//)/2

    Integer division

#### (/)/2

    Division

#### (rem)/2

    Remainder

#### (mod)/2

    Modulus

#### (-)/1

    Negation

#### (abs)/1

    Absolute value

#### (sign)/1

    Sign

#### (float_integer_part)/1

    Integer part

#### (float_fractional_part)/1

    Fractional part

#### (float)/1

    Float coercion

#### (floor)/1

    Floor

#### (truncate)/1

    Truncate

#### (round)/1

    Round

#### (ceiling)/1

    Ceiling

### Other arithmetic and bitwise functors
#### (**)/2

    Power

#### sin/1

    Sine

#### cos/1

    Cosine

#### atan/1

    Arc tangent

#### exp/1

    Exponentiation

#### log/1

    Log

#### sqrt/1

    Square root

#### (>>)/2

    Bitwise right shift

#### (<<)/2

    Bitwise left shift

#### (/\)/2

    Bitwise and

#### (\/)/2

    Bitwise or

#### (\)/1

    Bitwise complement
# Prolog/External Links
## Prolog Compilers

* Visual Prolog is a successor of the Turbo Prolog compiler created in 1980s that was the first Prolog compiler. Since that time the Prolog Development Center has been developing and improving its compiler. Currently Visual Prolog compiler is a powerful and efficient compiler that can create object files for creating standalone executables or DLLs, resolve cross references among declarations, validate predicate mode, perform powerful type checking, validate facts initialization in constructors, perform predicate resolution. Download Visual Prolog.
* Strawberry Prolog is used mainly in education. This compiler is very close to ISO-Prolog syntax but it has many extensions which are not part from the standard. For example, in Strawberry Prolog you can find global variables, arrays, objects and many predicates which are specific only for this compiler. The main idea of Strawberry Prolog is to be very easy for use. That is why it includes Development environment, visual debugger and free Light edition. Download Strawberry Prolog.

## Prolog Tutorials

When learning Prolog, it's always a good idea to use more than one text. Viewing a subject from more than one perspective can help to clarify it. These are only some of the free Prolog tutorials out there.
* Learn Prolog Now! A full introduction to Prolog, including DCG's.
* James Power's Prolog Tutorial (with edits from Alex Monaghan)
* Visual Prolog Tutorials
* Strawberry Prolog Help, online help
* Strawberry Prolog Tutorial by Dimitar Gelev
Downloadables
* Prolog A Tutorial Introduction by James Lu and Jerud J. Mead PDF
* Prolog And Natural Language Analysis (©) PDF
* An Introduction to Logic Programming through Prolog (©) PS\PDF
* Prolog Programming Contests PS/HTML − Advanced exercises.

## Other texts on Prolog

* Prolog Programming for AI by Professor Ivan Bratko
* comp.lang.prolog FAQs

## Links2links

* Prolog at Curlie
* PCAI's Prolog Programming Links
# Prolog/Bagof, Setof and Findall

Bagof, Setof and Findall are so called metapredicates, because they take a ":Goal" as an argument. Metapredicates are the equivalent of higher order functions from functional programming languages.

## What is a :Goal?

A :Goal is anything that you can feed in to the top level interpreter. For example the simplest metapredicate is call/1.
Call/1 is similar to "eval" in other scripting languages.
We mark goals with the prefix ":" in header comments. It's just a convention we use in documentation, and comments. The Prolog interpreter knows nothing about this convention.
The header comment for call/1 is:
Examples:
From the SICSTUS manual:
All metapredicates call "call/1" on one way or other.

## Finding all the solutions without pushing ";" all the time

Sometimes we want to restrict the standard Prolog backtracking to a block of code, and put all solutions that the backtracking found in to a list that we can use outside of that block. That's when we use "findall/3".
Example: (SWI prolog)
We need modulo division for this example. "mod/2" works the following way:
We also need numlist/3, which simply generates a list of successing integers.
Now comes the meat: we want to filter the odd numbers from the above list. We use findall/3 for this:
As you see, the middle argument is a simple goal. If copy it and feed it to the toplevel interpreter you get the following:
The first argument of findall/3 denotes the variable we want to collect in the list in the third argument.
You can read the above example as: find all X where X satisfies :Goal.
Bagof is very similar to this, but you can also use the existential quantifier "^" in the +Template. The variable on which the existential quantifier is applied won't be collected in the resulting list.
Setof is like bagof but the resulting list is ordered and doesn't contain repetitions.

## Further examples

Find divisor pairs:
The same, but we don't care about Y.
Filtering out repetition:
# Semiconductor Electronics/Field Effect Transistor

* Introduction
* Construction and Characteristics of JFET
* Transfer Characteristics
* Specification Sheet
* Instrumentation
* Important Relationships
* Depletion-Type MOSFET
* Enhancement-Type MOSFET
* MOSFET Handling
* VMOS
* CMOS
* Software
# Semiconductor Electronics/Field Effect Transistor/Construction and Characteristics of JFET

At the right you can see a schematic of how a JFET is constructed. There are two types of JFET 1. N-channel JFET and 2. P-channel JFET. Let's see how N-channel JFET is constructed. Take a N-type silicon, cut two slots at its left and right and pop in P-type semiconductor in those slots. What results is a N-channel JFET. Ohmic contacts are attached to the top and bottom and they serve as Drain and Source terminals. Ohmic contacts are attached to the P-type material too and they are both tied together and this is called as the gate.
P-Channel JFET has a similar construction where N and P regions of N-Channel JFET are swapped.
# Semiconductor Electronics/Diode Applications/Polarity Detector

Polarity detector is a device used to detect polarity of an applied voltage. One can determine if the voltage that's present in a given line is positive or negative. The polarity tester has a circuit diagram as shown. When we connect a pair of wires one at point A and other at B, if the line at A has a greater sufficient positive voltage than B then the lamp connected in the circuit glows. Else A has negative potential compared to B. If the lamp does not glow even if lines are swapped than it indicates the lines are dead, that is they have no voltage in them.
# Semiconductor Electronics/Discrete Components Manufacture/Making Ingots

Silicon ingots are necessary for the manufacture of IC's. To make an ingot we need nearly 100% silicon which has impurities at a concentration of only few parts per million. To make the mono crystalline silicon ingot, modern industry employs Czochralski process which is explained below.

## Melting Pure Silicon

Nearly 100% pure silicon is taken in a quartz crucible that can handle very high temperatures. The entire operation is carried out in a very clean environment so that almost no contamination takes place. The silicon in the Quartz crucible is subjected heat or in other words heated high enough for the silicon to melt to form a molten mass.

## Introducing Seed

After obtaining silicon melt, dopant's of pentavalent or trivalent atoms may be added to make the silicon N-type or P-type. Once impurities are added, its made sure the mix is homogeneous so that no error arises when the semiconductor is fabricated. The temperature of the molten mass is maintained at a constant preferable temperature so that crystallization can take place easily. A chuck is lowered into the molten mix, the chuck has a piece of mono-crystalline silicon at its grip.

## Crystal Formation

The chuck is maneuvered so that the crystalline silicon touches the molten mix. The molten silicon then solidifies around the crystal making it larger and larger. The chuck is rotated so that the crystal maintains a cylindrical shape.

## Controlled Crystal Growth

Slowly and steadily the chuck is rotated at a constant rate and lifted up so that the crystal grows at a steady rate. By this process we can get a mono-crystalline cylindrical silicon ingot thats perfect for making semiconductors.

## Final output

The final crystal looks as shown above. A cone atop of a cylinder. This is the raw material used to make silicon wafers.
# Semiconductor Electronics/Discrete Components Manufacture

* Mining Raw Materials
* Making Ingots
* Discrete Diode
* Discrete Transistor
# Semiconductor Electronics/Field Effect Transistor/Introduction

FET or Field effect transistors are device that find applications just as BJT does but vary on how they operate. BJT is a current controlled device, that is the current that flows via the collector terminal is a function of base current $I_{c}=f(I_{b})\,$. Whereas in FET, the current flowing in it is controlled by the voltage.
FET is similar to BJT. It has a source which is analogous to emitter BJT. It has a drain which is analogous to collector in BJT and has a gate which is similar to base in BJT. The current in FET flows from source to drain, and is a function of voltage applied between gate and source $I_{FET}=f(V_{GS})\,$.
FET's normally have very high input impedance that ranges from few ohms to mega ohms. It has simpler construction and is easy to put in Integrated Circuits. FET's have more temperature stability than BJT. There are different type's of FET's as follows
* JFET (Junction Field Effect Transistor)
* MOSFET (Metal Oxide Semiconductor Field Effect Transistor)
# Semiconductor Electronics/Integrated Circuits

* Introduction
* Semiconductor Materials
* Discrete Diodes
* Transistor Fabrication
* Integrated Circuits
# Semiconductor Electronics/Reference
## Books

1.Electronic Devices and Circuit Theory-Sixth Edition- Robert L.Boylestad, Louis Nashelsky - Prentice Hall
2.Semiconductors

## Web Links

1. History of Transistor
2. Introduction to Semiconductor Technology
3. How Stuff Works
4. Semiconductor Subway
5. MIT's Open course ware
6. How Chips are made
# DESCRIPTION:

Decode a URL into an object.
DECODE-URL is a function value.

# ARGUMENTS

* url -- (Type: any)
# DESCRIPTION:

Decompresses a binary series back to a string.
DECOMPRESS is a native value.

# ARGUMENTS

* data -- Data to decompress (Type: binary)
# DESCRIPTION:

Set a word to a default value if it hasn't been set yet.
DEFAULT is a function value.

# ARGUMENTS

* word -- The word (use :var for word! values) (Type: word set-word lit-word)
* value -- The value (Type: any)
# DESCRIPTION:

Deletes the specified file(s).
DELETE is a function value.

# ARGUMENTS

* target -- the file to delete (Type: file url)

# REFINEMENTS

* /any -- allow wild cards

# (SPECIAL ATTRIBUTES)

* catch
# DESCRIPTION:

Deletes a directory including all files and subdirectories.
DELETE-DIR is a function value.

# ARGUMENTS

* dir -- (Type: file url)
# DESCRIPTION:

Converts string terminators to standard format, e.g. CRLF to LF. (Modifies)
DELINE is a function value.

# ARGUMENTS

* string -- (Type: any-string)

# REFINEMENTS

* /lines -- Convert to block of lines (does not modify)
# DESCRIPTION:

Delta-time - returns the time it takes to evaluate the block.
DELTA-TIME is a function value.

# ARGUMENTS

* block -- (Type: block)
# DESCRIPTION:

Converts URL-style hex encoded (%xx) strings.
DEHEX is a native value.

# ARGUMENTS

* value -- The string to dehex (Type: any-string)
# DESCRIPTION:

Converts CGI argument string to a block of set-words and value strings.
DECODE-CGI is a function value.

# ARGUMENTS

* args -- Starts at first argument word. (Type: any-string)
# DESCRIPTION:

Clears a flag in a VID face.
DEFLAG-FACE is a function value.

# ARGUMENTS

* face -- (Type: object)
* flag -- (Type: any)
# Contributors to this Introduction to Sumerian

The initial module was created by Mike Carlson in February of 2006.
I (MC) have done some reorganizing and additions. It's currently June 2007.
Just added a lesson on cuneiform and added a bunch of free pics from mediacommons! Mike.the.kitty (talk) 17:20, 16 June 2009 (UTC)
I (David Ackroyd) have added some revision phrases to chapter 4. I would like someone to make sure that they are correct.
Mušen.gig here, I added (some) Cuneiform to lesson 3 and corrected a few romanizations, also added the Sumerian Cuneiform spelling of Uruk to Lesson 2. Added link to a Cuneiform Keyboard on the main page.
# Quick Quiz Answers
## Posessives

Sumerian to English:
til.zu = your life
bad.bi = its wall
nin.ani =his/her queen
bad Uruk.ak =the wall of Uruk
English to Sumerian:
for her child = dumu.ani.ir
my king = lugal.ĝu
his house = e.ani
the queen of your temple = nin e.zu.ak
The .ir suffix is explained in the next section.
Back to Lesson Two - Posessives

## The Case System
### Case System Preliminaries

The subject of the quiz sentence is the phrase "The quick brown fox", and the object is the phrase "the lazy dog".
Back to Lesson Eight - The Case System

### The Genitive Case

igi.ene nin.ak = the eyes of the queen lugal Urim.ak = the king of Urim amar ses.zu.ak = the calf of your brother
the brother of the king = ses lugal.ak the sister of my mother = nin ama.ğa
Back to Lesson Eight - The Case System

### Case System Quiz

Sumerian to English:
lugal Uruk.ak = the king of Uruk
nin.ir = for the queen
e lugal.ak = the house of the king
dumu nin.ak.ir = for the lady's child
English to Sumerian:
the son of the king = dumu lugal.ak
for the queen of Uruk = nin Uruk.ak.ir
the child of Uruk = dumu Uruk.ak
Back to Lesson Eight - The Case System
Back to the main Sumerian page
# Sumerian/Grammar

Last page: none :: This page: Grammar Contents :: Next page: Lesson 1

# Sumerian Grammar

In the lessons below, you'll be introduced to aspects of Sumerian grammar in (hopefully) bite sized chunks. If any of the lessons are confusing, don't hesitate to edit them for style, or use the discussion boards for suggestions! That's the spirit of the wiki, after all.

## The Lessons

Lesson One - The Plural Marker -- This lesson introduces us to some simple nouns and how to mark them as plural.
Lesson Two - Possessives -- Here we learn how suffixed particles can modify the meaning of a noun, like "house", to be possessive, like "my house".
Lesson Three - The Genitive -- The basics of the Sumerian case system for nouns is outlined here.
Lesson Four - The Copula -- Before introducing verbs in general, the copula is introduced, along with simple predicative sentences.
Lesson Five - The Verb Chain -- The Sumerian verb is discussed in simple situations.
Lesson Six - A Sumerian Sentence -- Putting it all together, we translate a complete Sumerian sentence.
Lesson Seven - Ergativity in Sumerian -- A discussion of ergativity and how it is used in Sumerian.
Lesson Eight - The Case System -- Discussion of the cases used in Sumerian
Lesson Nine - Cuneiform -- Some introductory comments about the system of writing used by the ancient Sumerians
Up (Sumerian Main Page)
# Weblog as basis for a project

To keep a project blog is part of the basic setup in the university context. Although many different materials have been created in our project (see: Link Content-Buffet, see Podcast), the upkeep of a "project homepage" in the form of a weblog is of central importance, because basic information about the project or the "day-to-day" events is easier to present and find in this form.

# Weblog as development possibility?

No blog statistics were collected for the OERlabs blog and in terms of interaction we were able to provide a function to comment (see OERLabs Podcast Episode 5). In the beginning we also experimented with an inquiry or contact option in the form of a "doorbell". We also mentioned and discussed this OERlabs doorbell in some podcast episodes, because we considered it a good possibility to offer interested people a contact point, especially for questions about OER. It has to be mentioned that interest was more often expressed (be it information or questions about OER) "offline", no remedy can be created by the provision of an "online" system.
Due to the work processes during the project, it is not easy to regularly upload to the blog. On the one hand we could offer a lot of other content in the OERlabs, but on the other hand the flow of information on the blog was sometimes too little. This raises the question of the format in which project information is displayed and what kind of project information is requested by interested parties, cooperation partners and the public. In the future, one consideration might be to offer a kind of landing page, from which certain target groups can be directly addressed and forwarded, so that participation opportunities are made more present.

## Interactivity and privacy policy

Finally, a word about GDPR, which has also affected the project and the blog since the beginning of 2018. If a certain interaction is desired, demanded or wanted, there will be additional work in some cases. Because as soon as forms or entries by visitors are necessary, you have to communicate in detail what happens with these entries.
Ultimately, the question of how to handle products - be it student products or materials from teachers - may remain unanswered for some time. Should they be made available on your own weblog? Should there be possibilities for this from the side of the own university? And how do you communicate such publications (especially in the field of teaching, trainee teachers and young teachers)?