Skip to content

Instantly share code, notes, and snippets.

@hsk
hsk / SortOfWhile.pro
Last active October 13, 2016 23:47
hoare.pl
/* Syntax of SortOfWhile */
% Statements
stm(skip()).
stm((S1; S2)) :- stm(S1), stm(S2).
stm(X = E) :- atom(X), aexp(E).
stm(if(E, S1, S2)) :- bexp(E), stm(S1), stm(S2).
stm(while(E; S)) :- bexp(E), stm(S).
stm(or(S1, S2)) :- stm(S1), stm(S2).
stm(par(S1, S2)) :- stm(S1), stm(S2).