Controlled Natural Language for Agents
Project description
CLAG - Controlled Natural Language for Agents
CLAG é uma linguagem natural controlada (LNC) baseada em inglês que permite especificar sistemas multiagentes de forma intuitiva e estruturada. Como uma LNC, o CLAG restringe a gramática e o vocabulário do inglês para eliminar ambiguidades e facilitar o processamento automático, mantendo a legibilidade para humanos.
O que é uma Linguagem Natural Controlada?
Uma Linguagem Natural Controlada é um subconjunto de uma língua natural que:
- Restringe a gramática e o vocabulário
- Elimina ambiguidades
- Mantém a legibilidade para humanos
- Permite processamento automático confiável
No caso do CLAG, estas restrições são aplicadas especificamente para a especificação de agentes e seus comportamentos, utilizando o inglês como base.
Instalação
Para instalar CLAG, você pode usar o gerenciador de pacotes pip:
pip install clag
Para atualizar sua versão já instalada do CLAG para a mais recente, você pode usar:
pip install clag -U
CLAG requer Python 3.12+ para funcionar corretamente.
Como o CLAG Funciona
O CLAG utiliza uma sintaxe controlada em inglês para definir:
- Crenças dos agentes (o que eles sabem)
- Desejos dos agentes (o que eles querem alcançar)
- Planos dos agentes (como eles agem)
- Percepções do ambiente (o que os agentes podem perceber)
- Ações do ambiente (o que os agentes podem fazer)
Estrutura Básica
Agent AgentName
believes belief1, belief2
desires desire1, desire2
with plans
plan_name when condition then action.
Exemplos
Exemplo Básico: Hello World
Agent HelloAgent
believes hello
with plans
say_hello when believes hello then achieve nothing.
Exemplo de Comunicação: Envio e Recebimento
Agent Sender
believes is_sender
desires to send_info
using channel SimpleChannel
in environment SimpleEnv
with plans
send_message when achieve send_info then
send Receiver achieve hello via SimpleChannel.
Agent Receiver
believes is_receiver
with plans
receive_message when achieve hello then
achieve nothing.
Environment SimpleEnv
that perceives message
with actions
receive_message.
Exemplo de Interação com Ambiente: Estacionamento
Agent Driver
believes has_budget
desires to park
using channel ParkingChannel
in environment Parking
with plans
ask_price when achieve park then
send Manager achieve ask_price via ParkingChannel.
park_car when achieve price_received then
achieve park_car.
Agent Manager
believes spot_price
using channel ParkingChannel
in environment Parking
with plans
send_price when achieve ask_price then
send Driver achieve price_received via ParkingChannel.
Environment Parking
that perceives spot_available
with actions
park_car.
remove_car.
Vantagens do CLAG como CNL
- Legibilidade: A sintaxe é próxima do inglês natural, facilitando a compreensão
- Estruturação: Regras claras de formação de frases e expressões
- Sem ambiguidades: Cada construção tem um significado único e preciso
- Processamento automático: Fácil conversão para código Python executável
- Manutenibilidade: Código mais fácil de entender e modificar
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clag-1.0.0.tar.gz.
File metadata
- Download URL: clag-1.0.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eb32a2ea5754107c00f0171fe3086ce4305f6a5f801c87ef7f3c30930150c43
|
|
| MD5 |
ddc84fe091b6bf3ba85e438d9c96a19e
|
|
| BLAKE2b-256 |
10ade2c428f66111c88b0f48cccf6e9703b82c9c8b47bddf2a2e6342d1d957fa
|
File details
Details for the file clag-1.0.0-py3-none-any.whl.
File metadata
- Download URL: clag-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27bf5be3e83d93b2c33f185e8f5d34782a2060c7f5643621e748ceae24111974
|
|
| MD5 |
d1e3cd0480a0bd4e6ef934b8909f267c
|
|
| BLAKE2b-256 |
33de97e70f09f99d9e9d47160d0cd73b14aed4dd55ebcd0518ac29b8125c68e0
|