<commit_before># Compiler

This is the compiler that produces files to the
[DIMACS](http://www.satcompetition.org/2009/format-benchmarks2009.html) format.

## Grammar

Input language grammar

TODO

## Example

File `foo.touistl`:
```
;; this is a comment
;; comment MUST be preceded by TWO semicolons
begin sets
  $A = [a, b, c]
  $B = card($A)
end sets

begin formula
  bigand $i in $A do
    A($i) and B($i)
  end

  bigand $i in $A when ($B > 2) do
    not B($i) and C($i)
  end
end formula
```

There will be two output file:
- a DIMACS file
- a mapping of the variables' name to their DIMACS representation (a number)

`foo.cnf`:
```
c CNF format file
p cnf 9 12
9 0
6 0
8 0
4 0
7 0
2 0
-6 0
5 0
-4 0
3 0
-2 0<commit_msg>Added explanations for running the example<commit_after># Compiler

This is the compiler that compiles files from the `touisl` language to the well-known [DIMACS](http://www.satcompetition.org/2009/format-benchmarks2009.html) format.

`touisl` is the high-level logic langage for expressing succintly complex formulas in propositionnal logic (and more).

## Grammar

Input language grammar

TODO

## Example

### The input file
File `foo.touistl`:
```
;; this is a comment
;; comment MUST be preceded by TWO semicolons
begin sets
  $A = [a, b, c]
  $B = card($A)
end sets

begin formula
  bigand $i in $A do
    A($i) and B($i)
  end

  bigand $i in $A when ($B > 2) do
    not B($i) and C($i)
  end
end formula
```
### Running the example 
```
touistc.native foo.touistl
```
### Understanding the output files
There will be two output file:
- a DIMACS file
- a mapping of the variables' name to their DIMACS representation (a number)

`foo.cnf`:
```
c CNF format file
p cnf 9 12
9 0
6 0
8 0
4 0
7 0
2 0
-6 0
5 0
-4 0
3 0
-2 0
{'fraction_non_alphanumeric': 0.1095890410958904, 'fraction_numerical': 0.03881278538812785, 'mean_word_length': 3.339108910891089, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1502179', 'n_tokens_mistral': 718, 'n_tokens_neox': 645, 'n_words': 277}