# Установка и запуск

## Установка

Открываем терминал и пишем:

```
sudo add-apt-repository ppa:swi-prolog/stable
sudo apt-get update
sudo apt-get install swi-prolog
```

## Создание и запуск программы

Создадим файл с именем "**myprog.pl**"

Пишем в файле:

```
boy(maxim).
boy(george).
girl(nina).
girl(ann).
```

Для запуска программы пишем в терминале:

```
swipl -s myprog.pl
```

После этого введём в терминал вопрос: является ли Георгий мальчиком

Пишем в терминале:

```
boy(george).
```

Далее введём в терминал вопрос: является ли Аня мальчиком

Пишем в терминале:

```
boy(ann).
```

## Ввод вопросов в систему из файла

Создадим файл с именем "**questions.txt**"

Пишем в файле вопросы к системе:

```
boy(george).
boy(ann).
```

Заставляем систему читать вопросы из файла

Пишем в терминале:

```
swipl -s myprog.pl < questions.txt
```

После этого ответы на вопросы будут выведены в терминале.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://maxim218.gitbook.io/prolog/chapter1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
