Skip to content

Instantly share code, notes, and snippets.

View anmousyon's full-sized avatar

Super Turkey anmousyon

View GitHub Profile
/* prolog tutorial 2.19 Actions and plans */
:- dynamic on/2.
on(a,b).
on(b,c).
on(c,table).
put_on(A,B) :-
A \== table,
conn(A,B) :- path(A,B,[]).
path(A,B,V) :- edge(A,X), not(member(X,V)),(B = X; path(X,B,[A|V])).
edge(a,b).
edge(b,a).
edge(a,c).
edge(b,d).
edge(b,e).
edge(c,e).
male(alex).
male(romeo).
male(peter).
male(oscar).
male(bruno).
male(georg).
male(otto).
male(pascal).
male(jean).
f(lina).
module fsm(clk, in, reset, out);
input clk, in, reset;
output [2:0] out;
reg [2:0] out;
reg [1:0] state;
parameter S0=0, S1=1, S2=2, S3=3, S4=4;