This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
male(alex). | |
male(romeo). | |
male(peter). | |
male(oscar). | |
male(bruno). | |
male(georg). | |
male(otto). | |
male(pascal). | |
male(jean). | |
f(lina). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |