Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prolog_test_less_simple
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
%commands to the interpreter are submitted from stdin input ('show input' box below) %'halt.' will be automatically appended to stdin input. %swi-prolog 7.2.3 program :- write('Hello, world!'), nl. parent(amy, bob). parent(bob, cathy). grandparent(X, Z) :- parent(X, Y), parent(Y, Z). ancestor(X, Y) :- parent(X, Y). ancestor(X, Y) :- parent(X, Z), ancestor(Z, Y). printqueries :- forall(query(Q), (Q -> writeln(yes:Q) ; writeln(no:Q))). query(parent(amy, cathy)). query(parent(bob, cathy)). query(grandparent(amy, cathy)). query(ancestor(amy, cathy)). :- program. :- printqueries.
[
+
]
Show input
Absolute running time: 0.07 sec, cpu time: 0.02 sec, memory peak: 3 Mb, absolute service time: 0,07 sec
latest
|
history