Skip to content

Instantly share code, notes, and snippets.

@ncollins
ncollins / proplogic.ml
Last active March 15, 2016 13:59 — forked from raoprasadv/proplogic.ml
Rewrite based resolution for computing well-founded semantics of a propositional logic program.
(** proplog.ml:
* Author: Prasad Rao
* Email: raoprasadv AT gmail DOT com
* use propositional logic to show principles of
* prolog resolution
* using SLG (http://link.springer.com/chapter/10.1007/3-540-63255-7_33#page-1)
* for computing Well-founded semantics of a propositional logic program
*
* Intended for use as a teaching tool.
*)
class Celery
def initialize(grid)
@grid = grid
@height = grid.length
@width = grid[0].length
end
def self.mini
[[ 0, 1, 2, 3, 4],
[10,11,12,13,14],
[20,21,22,23,24],