RELEASE NOTES
=============

Enhancements:

* Higher order:

  - Approximation degree calculation for higher order predicates:
    - call/1, once/1, ignore/1, time/1
    - apply/2, maplist/2
    - catch/3

  - Higher order calls with runtime compilations when needed:
    - not/1, (\+)/1
    - =>/2
    - call/1, once/1, ignore/1, time/1
    - apply/2, maplist/2
    - catch/3

  - Higher order built-in predicates and operators admit partial goals, delaying the compilation until run-time, including all previous higher order hypothetical calls plus:
    - truth_degree/2
    - forall/2
    - findall/3
    - bagof/3
    - setof/3

  - Dynamic database predicates accept partial rules, which will be compiled at run-time:
    - assert/1
    - retract/1

  - Variables are allowed as goals.

  - Higher order goals can be any compound goal, not only an atom as in previous version.
  

* Hypothetical reasoning:

  - Hypothetical reasoning following:

    "Planning for an Efficient Implementation of Hypothetical 
     Bousi-Prolog", 
    P. Julian-Iranzo and F. Saenz-Perez, 
    Theory and Practice of Logic Programming, 21(5), pp. 680-697, 
    Special Issue, 2021.
    
  - Interactive assumptions at the system prompt.
  
  - Program directive :- hypothetical(<Boolean>) for enabling or disabling hypothetical mode.

  - Command hy <Boolean> for changing between normal and hypothetical reasoning modes.
  

* Other enhancements:

  - Added higher order predicate truth_degree(+Goal, -Degree) to accessing the approximation degree of each solution of the goal. If Goal fails, Degree is 0.

  - Added 150 new tests for higher order calls, hypothetical reasoning programs, goals and commands (from 830 to 980).
  
  - Crisp (\+) and fuzzy (not) negations are also allowed as prefix operators.
  
  - Under the filtering optimisation, unification problems for single-occurrence variables at the head are not built, therefore saving one unification problem for multiple-occurrence variables at the head. 
  
  - Assert and retract also accept rules, not only facts.
  
  - Command st for displaying the current status of Bousi~Prolog.
  
  - Command sp <predicate> (intended for system implementors) sets a spy point on the given Prolog predicate for debugging the Bousi-Prolog system implementation.
  
  - Extended set of SWI-Prolog built-in predicates are detected.
  
  - The command ts includes the tests "additional queries" in its final statistics.

  - Weak unification built-in predicates now support degree accumulator optimization.

  - Simplified implementation for both weak and crisp negations.

  - not/1 enhanced to deliver as many solutions as can be derived. For example, for the program:

    p with 0.3. 
    p with 0.4.

    the following is the new result:

      BPL> not(p)
      true
      With approximation degree: 0.7 ;
      true
      With approximation degree: 0.6.

    while for the last version, only one solution was found:

      BPL> not(p)
      true
      With approximation degree: 0.7.


Changes:

- Block identifiers start with 0 for the Prolog-based implementation to match the C-based implementation.


Fixed bugs:

- Sometimes, "With approximation degree: 1" was displayed instead of simply "true".

- Negation did not appropriately comunicate the block constraints as in the following program:

  a ~ b = 0.3.
  b ~ c = 0.5.
  eq(X,X).
  p :- not(eq(a,b)), eq(b,c).
  
  with the goal p, which should fail and it succeeded otherwise. While not(eq(a,b)) succeeds, a-b is in a block. Next, eq(b,c) should not succeed because it would be forming another block b-c, so that b would be in two different blocks, which is not allowed.

- Unsupported interactive action responses at the top-level gave an error.

- sim/4 entries for algorithm a3 were not retracted when computing the new ones.

- Recomputing block constraints could yield different block identifiers. While the process was correct, recomputing during a derivation might lead to incorrect unification results.

- The name of an undefined predicate name might be incorrectly returned when its name starts with the program prefix (file name without extension).

- The expansion of rules for a3 was incomplete: it only used the first entry in RB.

- Translations of rules with disjunctions did not appropriately connect degree and constraint variables in the expanded program.

