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
Metadata
Release files for clag 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clag-1.0.0.tar.gz | 2.0 MB | Without provenance | Details for clag-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clag-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for clag-1.0.0-py3-none-any.whl |
Total release size: 4.0 MB
Release files / clag-1.0.0.tar.gz
| Download URL | clag-1.0.0.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1eb32a2ea5754107c00f0171fe3086ce4305f6a5f801c87ef7f3c30930150c43
|
|
BLAKE2b-256 checksum How to use checksums |
10ade2c428f66111c88b0f48cccf6e9703b82c9c8b47bddf2a2e6342d1d957fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / clag-1.0.0-py3-none-any.whl
| Download URL | clag-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27bf5be3e83d93b2c33f185e8f5d34782a2060c7f5643621e748ceae24111974
|
|
BLAKE2b-256 checksum How to use checksums |
33de97e70f09f99d9e9d47160d0cd73b14aed4dd55ebcd0518ac29b8125c68e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for clag 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.