<commit_before># logen
LOGEN is an offline partial evaluation system for Prolog written using the so called "cogen approach".
Basically, the cogen is a system which: based upon an annotated version of the program to be specialised produces a specialised partial evaluator for that program.
This partial evaluator is called a generating extension the generating extension can be used to specialise the program in a very efficient manner.

# Building and running logen
Once downloaded you can test the installation with:
 make cogen
 make test

This should finish without errors.

To compile:
 make

To specialise:
 bin/logen PlFile "goal(A,B)"
You should also set the LOGEN_DIR (or LOGEN_HOME) environment variable to point to this
directory (i.e., the one containing this README file). Alternatively, you can pass
the --logen_dir D switch to logen.

For help:
 bin/logen --help

Output gx files should be standalone ciao executables.  So after
specialising match.pl, match.pl.gx.cpx should be the executable.
 ./match.pl.gx.cpx --help
 ./match.pl.gx.cpx "match([a,a,b],R)"

Logen requires annotation files (ending with .ann) for every Prolog source file that has to be specialised.
To generate annotation files you may want to use the binding-time analysis provided in another project: https://github.com/leuschel/logen-bta.
You can use the -w switch for logen to supervise specialisation and provide better error feedback.

# Usage

logen [Options] File.pl ["Atom."]
  Possible Options are:
      --help: Prints this message
      -w: watch mode (supervise specialization); equivalent to -wb -wu -wm -wc
      -W: watch mode; like -w option but halt at first alarm (-w -w1)
      -wb:   watch built-ins
      -wp:   watch for back-propagation of bindings onto non-declarative builtins
      -wc:   watch connectives (if,or) for back-propagation of bindings<commit_msg>update formatting<commit_after># logen
LOGEN is an offline partial evaluation system for Prolog written using the so called "cogen approach".
Basically, the cogen is a system which: based upon an annotated version of the program to be specialised produces a specialised partial evaluator for that program.
This partial evaluator is called a generating extension the generating extension can be used to specialise the program in a very efficient manner.

# Building and running logen
Once downloaded you can test the installation with:
    make cogen
    make test

This should finish without errors.

To compile:
    make

To specialise:
    bin/logen PlFile "goal(A,B)"
You should also set the LOGEN_DIR (or LOGEN_HOME) environment variable to point to this
directory (i.e., the one containing this README file). Alternatively, you can pass
the --logen_dir D switch to logen.

For help:
    bin/logen --help

Output gx files should be standalone ciao executables.  So after
specialising match.pl, match.pl.gx.cpx should be the executable.
    ./match.pl.gx.cpx --help
    ./match.pl.gx.cpx "match([a,a,b],R)"

Logen requires annotation files (ending with .ann) for every Prolog source file that has to be specialised.
To generate annotation files you may want to use the binding-time analysis provided in another project: https://github.com/leuschel/logen-bta.
You can use the -w switch for logen to supervise specialisation and provide better error feedback.

# Usage

    logen [Options] File.pl ["Atom."]
      Possible Options are:
      --help: Prints this message
      -w: watch mode (supervise specialization); equivalent to -wb -wu -wm -wc
      -W: watch mode; like -w option but halt at first alarm (-w -w1)
      -wb:   watch built-ins
      -wp:   watch for back-propagation of bindings onto non-declarative builtins
      -wc:   watch connectives (if,or) for back-propagation of bindings
{'fraction_non_alphanumeric': 0.06629541235746486, 'fraction_numerical': 0.0005303632988597189, 'mean_word_length': 3.7091136079900124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2664315', 'n_tokens_mistral': 1069, 'n_tokens_neox': 1034, 'n_words': 518}