forked from SWI-Prolog/swish
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:friguzzi/swish into tutorial
- Loading branch information
Showing
16 changed files
with
344 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
node_modules | ||
bower_components | ||
passwd | ||
storage | ||
log | ||
*.log | ||
*~ | ||
*.swp |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
Probabilities computation in the body of probabilistic clauses. | ||
*/ | ||
|
||
a:0.2:- | ||
prob(b,P), | ||
P>0.2. | ||
|
||
b:0.5:- | ||
c. | ||
|
||
c. | ||
|
||
:- end_cplint. | ||
|
||
/** <examples> | ||
|
||
?- a. | ||
|
||
*/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
Probabilities computation in the body of probabilistic clauses. | ||
*/ | ||
:- use_module(library(pita)). | ||
|
||
:- if(current_predicate(use_rendering/1)). | ||
:- use_rendering(c3). | ||
:- endif. | ||
|
||
:- cplint. | ||
|
||
a:0.2:- | ||
prob(b,P), | ||
P>0.2. | ||
|
||
b:0.5:- | ||
c. | ||
|
||
c. | ||
|
||
:- end_cplint. | ||
|
||
/** <examples> | ||
?- prob(a,Prob). | ||
?- prob_bar(a,Prob). | ||
*/ |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* Part of SWI-Prolog | ||
Author: Jan Wielemaker | ||
E-mail: [email protected] | ||
WWW: http://www.swi-prolog.org | ||
Copyright (C): 2014, VU University Amsterdam | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
As a special exception, if you link this library with other files, | ||
compiled with a Free Software compiler, to produce an executable, this | ||
library does not by itself cause the resulting executable to be covered | ||
by the GNU General Public License. This exception does not however | ||
invalidate any other reasons why the executable file might be covered by | ||
the GNU General Public License. | ||
*/ | ||
|
||
:- module(swish_render_url, | ||
[ term_rendering//3 % +Term, +Vars, +Options | ||
]). | ||
:- use_module(library(http/html_write)). | ||
:- use_module('../render'). | ||
|
||
:- register_renderer(url, "Make URLs clickable"). | ||
|
||
/** <module> SWISH url renderer | ||
Renders a URL as a clickable link | ||
*/ | ||
|
||
%% term_rendering(+URL, +Vars, +Options)// | ||
% | ||
% Renders a URL as a clickable link. | ||
|
||
term_rendering(URL, _Vars, _Options) --> | ||
{ ( atom(URL) | ||
-> true | ||
; string(URL) | ||
), | ||
uri_is_global(URL) | ||
}, | ||
html(a(href(URL), URL)). |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.