$ cat Shull.pl
bord(португалия,испания).
bord(испания,франция).
bord(X,Y) :- bord(Y,X).
$ swipl Shull.pl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.4.1)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- bord(испания,A).
A = франция
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import pandas as pd
import matplotlib.dates as dates
df = pd.read_csv("/tmp/DATA.csv")
fig = plt.figure()
ax = Axes3D(fig)
d = np.array(df["date"], dtype="datetime64")
x = [dates.date2num(i) for i in d]
y = np.array(df["y_axis"])
z = np.array(df["z_axis"])
ax.scatter(x, y, z)
plt.show()
import Integral.Implicits._
object Main {
def half[T:Integral](a:T) : T = a match {
case i: Int => (i / 2).asInstanceOf[T]
case b: BigInt => (b / 2).asInstanceOf[T]
}
def odd[T:Integral](a:T) : Boolean = a match {
case i: Int => i % 2 == 1
case b: BigInt => b % 2 == 1
}
def mult_acc11[T:Integral](n:T, a:T, r:T = 0) : T = (odd(n), n) match {
case (true, 1) => r + a
case (true, _) => mult_acc11(half(n), a + a, r + a)
case (_,_) => mult_acc11(half(n), a + a, r)
}
def main(args: Array[String]): Unit = {
println(mult_acc11(BigInt(700000000), BigInt(500000000), BigInt(0)))
}
}
import Integral.Implicits._
object Main {
def half[T:Integral](a:T) : T = a / 2.asInstanceOf[T]
def odd[T:Integral](a:T) : Boolean = a % 2.asInstanceOf[T] == 1.asInstanceOf[T]
def mult_acc11[T:Integral](n:T, a:T, r:T = 0) : T = (odd(n), n) match {
case (true, 1) => r + a
case (true, _) => mult_acc11(half(n), a + a, r + a)
case (_,_) => mult_acc11(half(n), a + a, r)
}
def main(args: Array[String]): Unit = {
def f(n: Int) = (BigInt(1) to BigInt(n)).product
println(mult_acc11(7,5))
}
}