Skip to content

Commit

Permalink
Improv intro. Move .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Jul 29, 2024
1 parent 4cb8760 commit 0400fad
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build/
node_modules/
package-lock.json
Manifest.toml

.DS_Store
.vscode/

.gitignore
4 changes: 0 additions & 4 deletions docs/.gitignore

This file was deleted.

3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ makedocs(;
],
"Modeling Toolkit" => [
"Introduction" => "constraints/intro.md",
"Variables and Domains" => "constraints/constraint_domains.md",
"Variables and Domains" => "constraints/variables_and_domains.md",
"Constraints" => [
"Basics" => "constraints/constraints.md",
"Generic Constraints" => "constraints/generic_constraints.md",
Expand All @@ -76,6 +76,7 @@ makedocs(;
"Model Catalog" => "constraints/constraint_models.md",
"Internals" => [
"ConstraintCommons.jl" => "constraints/constraint_commons.md",
"ConstraintDomains.jl" => "constraints/constraint_domains.md",
],
],
"Learning" => [
Expand Down
12 changes: 7 additions & 5 deletions docs/src/constraints/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

Constraint programming (CP) is a high-level paradigm for solving combinatorial problems, and Julia Constraints provides an efficient and flexible framework for developing constraint-based models.

All along this documentation, we will present code example base on the syntaxes of *Julia Constraints* internals (`JC-API`), of *Julia for Mathematical Programming* (`JuMP` ), of *MathOptInterface* (`MOI`), and, when relevant, of other standards such as `XCSP`.

## Terminology

!!! warning
Terminology in Optimization varies strongly between different methods and communities. In this doc we try to be consistent with the following principles (in bold).
- **Constraint:** A general mathematical predicate involving variables.
- **Constraint Instantiation:** The application of a constraint to specific variables.
- **Configuration:** A specific assignment of values to the variables.
- **Constraint Satisfaction/Violation:** Whether a configuration meets or fails to meet a constraint.
- **Constraint Satisfaction/Violation:** Whether a configuration meets or fails a constraint.

### Constraint

Expand All @@ -27,7 +29,7 @@ Constraint programming (CP) is a high-level paradigm for solving combinatorial p

**Definition:** A configuration, also known as an assignment, is a specific set of values assigned to the variables in their respective domains. It represents a possible state of the variables.

**Example:** For variables ``x`` and ``y`` with domains ``[0, 5]``, a configuration could be ``x = 3`` and ``y = 2``.
**Example:** For variables ``x`` and ``y`` with domains ``[0, 10]``, a configuration could be ``x = 3`` and ``y = 2``.

### Constraint Satisfaction or Violation by a Configuration

Expand All @@ -39,11 +41,11 @@ Constraint programming (CP) is a high-level paradigm for solving combinatorial p

In CP, variables are defined through their domain. `ConstraintDomains.jl` supports various types of domains such as discrete ones (sets, range, etc.), or continuous intervals, and custom domains.

## `Constraints.jl`: A versatile API
## A versatile constraints' API

It implements a wide range of generic and core constraints, ensuring compatibility with XCSP3-core standards and providing a user-friendly interface. It includes features extracted from the learning blocks of Julia Constraints to leverage most of each constraint characteristics.
`Constraints.jl` implements a wide range of generic and core constraints, ensuring compatibility with XCSP3-core standards and providing a user-friendly interface. It includes features extracted from the learning blocks of Julia Constraints to leverage most of each constraint characteristics.

## Models Through `ConstraintModels.jl`
## A collection of models

The `ConstraintModels.jl` catalog offers a collection of predefined models and templates for constructing complex constraint satisfaction problems (CSPs) and optimization models. This resource provides reusable components to streamline the modeling process.

Expand Down
131 changes: 131 additions & 0 deletions docs/src/constraints/variables_and_domains.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Defining Variables and Exploring Domains

```@meta
CurrentModule = ConstraintDomains
```

*ConstraintDomains.jl* stands as a critical package within the *Julia Constraints* ecosystem, focusing on the definition and manipulation of variable domains that underpin the search spaces of constraint programming problems. This package provides the infrastructure necessary for specifying both discrete and continuous domains, thereby enabling a broad range of constraint programming applications.

## Key Features and Functionalities

- **AbstractDomain Super Type**: At the foundation of ConstraintDomains.jl is the AbstractDomain type, an abstract supertype for all domain types. Implementations of AbstractDomain must provide methods for checking membership (∈), generating random elements (rand), and determining the domain's size or range (length). These functionalities are essential for defining the behavior and properties of variable domains within constraint models.

- **Domain Types**: The package distinguishes between various domain types to cater to different needs:

- *ContinuousDomain*: A supertype for domains representing continuous ranges of real numbers.
- *DiscreteDomain*: Serves as a supertype for domains defined by discrete sets or ranges of numbers.
- *EmptyDomain*: Handles yet-to-be-defined domains, facilitating dynamic problem formulation.
- *Intervals and RangeDomain*: Represent continuous intervals and discrete ranges, respectively, providing flexible domain specification options.
- **Dynamic Domain Manipulation**: ConstraintDomains.jl supports dynamic changes to domains, allowing for the addition (add!) and deletion (delete!) of elements, crucial for problems where domain definitions evolve based on the search process or external inputs.

- **Exploration Settings and Methods**: The package offers ExploreSettings to configure the exploration of search spaces, including parameters for complete searches, maximum samplings, and solution limits. This feature is pivotal for tailoring the search process to the problem's characteristics and the computational resources available.

- **Support for Advanced Modeling**: Beyond basic domain definition and manipulation, ConstraintDomains.jl integrates with learning and parameter exploration tools. For instance, FakeAutomaton facilitates the generation of pseudo-automata for parameter exploration, while the package also provides functions for generating random parameters (generate_parameters), accessing domain internals (get_domain), and merging or intersecting domains (merge_domains, intersect_domains).

## Empowering Constraint Programming in Julia

ConstraintDomains.jl embodies the versatility and power of the JuliaConstraints ecosystem, offering users a comprehensive toolkit for defining and exploring variable domains. By abstracting complex domain manipulations and providing a rich set of functionalities, ConstraintDomains.jl enhances the ease and efficiency of modeling constraint programming problems. Whether for educational purposes, research, or practical applications, this package lays the groundwork for advanced problem-solving strategies in the realm of constraint programming.

## Commons

```@docs; canonical=false
AbstractDomain
EmptyDomain
domain
domain_size
get_domain
to_domains
```

### Extension to Base module

```@docs; canonical=false
Base.in
Base.rand
Base.isempty
Base.rand
Base.string
```

### Performances

## Continuous

```@docs; canonical=false
ContinuousDomain
Intervals
domain
domain_size
merge_domains
intersect_domains
intersect_domains!
size
```

### Extension to Base module

```@docs; canonical=false
Base.length
Base.rand
Base.in
Base.string
```

## Discrete

```@docs; canonical=false
DiscreteDomain
SetDomain
RangeDomain
ArbitraryDomain
domain
domain_size
add!
merge_domains
intersect_domains
size
```

### Extension to Base module


```@docs; canonical=false
Base.delete!
Base.length
Base.rand
Base.in
Base.string
```

## General

```@docs; canonical=false
Base.eltype
Base.convert
```

## Exploration

```@docs; canonical=false
ExploreSettings
_explore
explore
```

## Parameters

```@docs; canonical=false
BoolParameterDomain
DimParameterDomain
IdParameterDomain
FakeAutomaton
ConstraintCommons.accept
fake_automaton
LanguageParameterDomain
OpParameterDomain
PairVarsParameterDomain
ValParameterDomain
ValsParameterDomain
Base.rand
generate_parameters
```
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ hero:
alt: JuliaConstraints
actions:
- theme: brand
text: Constraint Programming ?!
link: /cp/intro
text: Model, Learn, and Solve!
link: /constraints/intro
- theme: alt
text: View on Github
link: https://github.com/JuliaConstraints/JuliaConstraints.github.io
Expand Down

0 comments on commit 0400fad

Please sign in to comment.