Has anyone seen a good open source Prolog implementation to test the SATCHMO theorem?

I have seen many works on the proof of the SATCHMO theorem, which talk about the implementation of Prolog. But the only source code implementation that I have found so far was in the book, and it was really limited and intended only to give an example of how the rules were evaluated and run. Has anyone seen a good open source SATCHMO implementation in Prolog?

Please note: I don't mean the Python language tool for Django called Satchmo, so I did not include Satchmo in the tags, as this is what Qaru shows as the dominant definition for this tag.

+5
source share
2 answers

I once knew that someday I would regret it when I discarded all the papers that I collected for my master's thesis a month ago. Since my thesis was about expanding SATCHMO with restrictions, there have been several SATCHMO works showing various implementations ...

, : Lehr- und Forschungseinheit für Programmier- und Modellierungssprachen, LMU Munich. , , SATCHMO, . SATCHMO. PMS , . .

SATCHMO ( ), :

p >
+4

Satchmo ( " " ) -

. SATCHMO: , Prolog. 9- , . 415-434. Springer-Verlag, 1988.

Prolog Satchmo . . Satchmo, RACE Attempto Controlled English:

:- op(1200, xfx, '--->').
:- unknown(_, fail).

satisfiable :-
  setof(Clause, violated_instance(Clause), Clauses),
  !,
  satisfy_all(Clauses),
  satisfiable.
satisfiable.

violated_instance((B ---> H)) :-
  (B ---> H),
  B,
  \+ H.

satisfy_all([]).

satisfy_all([(_B ---> H) | RestClauses]) :-
  H,
  !,
  satisfy_all(RestClauses).
satisfy_all([(_B ---> H) | RestClauses]) :-
  satisfy(H),
  satisfy_all(RestClauses).

/*
satisfy((A,B)) :-
  !,
  satisfy(A),
  satisfy(B).  
*/

satisfy((A;B)) :-
  !,
  (satisfy(A) ; satisfy(B)).  

satisfy(Atom) :-
  \+ Atom = untrue,
  (
    predicate_property(Atom, built_in)
    ->
    call(Atom)
  ;
    assume(Atom)
  ).

assume(Atom) :-
%  nl, write(['Asserting  ': Atom]),
  asserta(Atom).

assume(Atom) :-
%  nl, write(['Retracting ': Atom]),
  retract(Atom),
  !,
  fail.         
+5

All Articles