Build scripts as prolog state