Skip to content

Instantly share code, notes, and snippets.

@jrdmcgr
Created August 24, 2015 00:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrdmcgr/5e8a0363c82c695e7218 to your computer and use it in GitHub Desktop.
Save jrdmcgr/5e8a0363c82c695e7218 to your computer and use it in GitHub Desktop.
:- dynamic people/1.
:- dynamic portray_message/2.
:- use_module(library(prosqlite)).
set_gender(_, []).
set_gender(Sex, [Name|Names]) :-
sex(Name, Sex),
set_gender(Sex, Names).
main :-
DBPath = '/Users/jared2/Desktop/learn-prolog/family-tree',
sqlite_connect(DBPath, Connection, [
alias(db),
as_predicates(true),
arity(palette)
]),
findall(Name, people([name=Name, sex='M']), Names),
set_gender('M', Names),
sqlite_disconnect(Connection).
@jrdmcgr
Copy link
Author

jrdmcgr commented Aug 24, 2015

?- main.
ERROR: set_gender/2: Undefined procedure: sex/2
ERROR:   However, there are definitions for:
ERROR:         see/1
   Exception: (9) sex('M', 'Jared McGuire') ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment