# Probabilistic DSL (PDSL) Documentation
## Welcome to PDSL
PDSL is a domain-specific language designed for expressing probabilistic knowledge in an intuitive, natural way. It bridges the gap between natural language probabilistic statements and formal ProbLog programs.
## Quick Navigation
### Getting Started
- **[Quickstart Guide](PROBABILISTIC_DSL_QUICKSTART.md)** - 5-minute tutorial to get you started
- **[Examples Collection](PROBABILISTIC_DSL_EXAMPLES.md)** - 20+ real-world examples
### Reference Documentation
- **[Language Specification](PROBABILISTIC_DSL_SPECIFICATION.md)** - Complete PDSL grammar and semantics
- **[Parser Design](PROBABILISTIC_DSL_PARSER_DESIGN.md)** - Parser architecture and implementation
- **[ProbLog Translation](PROBABILISTIC_DSL_PROBLOG_TRANSLATION.md)** - PDSL to ProbLog conversion patterns
### Project Information
- **[Design Summary](PROBABILISTIC_DSL_SUMMARY.md)** - Design decisions, rationale, and timeline
## What is PDSL?
PDSL makes probabilistic reasoning accessible by providing:
1. **Natural Syntax** - Write probabilistic statements as they sound
2. **Type Safety** - Catch errors before execution
3. **ProbLog Backend** - Full power of ProbLog inference
4. **LLM-Friendly** - Designed for 90%+ LLM generation success
## Example
```pdsl
# Medical diagnosis example
probabilistic_model MedicalDiagnosis {
# Prior probabilities
0.01 :: flu
0.001 :: covid
# Symptoms given diseases
0.9 :: fever :- flu
0.95 :: fever :- covid
0.3 :: fever # Background rate
# Observations
observe fever
# Query
query flu
query covid
}
```
## Key Features
### Probabilistic Facts
```pdsl
0.3 :: rain # 30% chance of rain
0.7 :: sunny :- summer # 70% chance of sun in summer
```
### Conditional Probabilities
```pdsl
0.9 :: flies(X) :- bird(X), not penguin(X)
```
### Evidence and Queries
```pdsl
observe symptom(fever)
query disease(flu)
```
### Annotated Disjunctions
```pdsl
0.3 :: weather(rainy); 0.5 :: weather(cloudy); 0.2 :: weather(sunny)
```
### Parameter Learning
```pdsl
learn parameters from dataset("medical_records.csv")
```
## Use Cases
- Medical diagnosis
- Risk assessment
- Weather prediction
- Fault diagnosis
- Natural language understanding
- Sensor fusion
- Game AI
- Financial forecasting
## Project Status
**Version:** 0.1.0 (Design Phase)
**Phase:** Phase 2 - Probabilistic Reasoning
**Status:** Documentation Complete, Implementation Pending
## Getting Help
1. Start with the [Quickstart Guide](PROBABILISTIC_DSL_QUICKSTART.md)
2. Browse the [Examples](PROBABILISTIC_DSL_EXAMPLES.md)
3. Reference the [Specification](PROBABILISTIC_DSL_SPECIFICATION.md)
4. Check the [Parser Design](PROBABILISTIC_DSL_PARSER_DESIGN.md) for implementation details
## Design Philosophy
PDSL follows these principles:
1. **Readability First** - Code should read like structured English
2. **Safety** - Catch probability errors (sum > 1.0) at parse time
3. **Expressiveness** - Support full ProbLog capabilities
4. **LLM-Friendly** - Optimize for LLM generation from natural language
5. **Bidirectional** - Support PDSL ↔ ProbLog conversion
## Next Steps
1. Read the [Quickstart Guide](PROBABILISTIC_DSL_QUICKSTART.md)
2. Try the examples from [Examples Collection](PROBABILISTIC_DSL_EXAMPLES.md)
3. Review the [Language Specification](PROBABILISTIC_DSL_SPECIFICATION.md)
4. Implement the parser using [Parser Design](PROBABILISTIC_DSL_PARSER_DESIGN.md)
---
*Built on the success of CSDL (95% LLM generation rate), PDSL aims for 90%+ success in probabilistic reasoning tasks.*