For handling subgrids the following function may be useful:
For now I just give these hints:
transpose/2
from library(lists)
append/2
from library(lists)
maplist/3
from library(lists)
chop/3
from homework 7
If you are using SWI Prolog, you can load the transpose from this file, or simply use :- library(clpfd).
chop/3
is called exactly twice.
You may find useful some predicates in SICStus Prolog library(lists), e.g. transpose/2 and sublist/5. In solving this assignment you can freely use predicates from this library.
In SWI Prolog transpose/2 is part of library(clpfd). You can load this library for the purpose of using transpose/2, but no other predicates should be used from library(clpfd). Also, sublist/5 is not available in SWI, you can use list_sub/5 from Homework P4 instead.
Ask the instructors if you would like to use other libraries.
Some predicates you wrote for earlier homework may be re-used here, such as chop/3 from Homework P4, and pairings/2 from Homework P4.
Please send an email if you need further clarification or help.
Last modified by Péter Szeredi, szeredi@cs.bme.hu, on 11.11.2018.