当前位置:网站首页>Downloading and using SWI Prolog
Downloading and using SWI Prolog
2022-06-12 12:29:00 【Great sunflower Princess】
Catalog
3, Example ( The problem of map coloring )
1, download
First search in the browser swi prolog, Find and access the official website .

Click on download SWI-Prolog


Here, you can choose the version to download according to your needs 
Check I Understand After clicking on download download 
2, Use
After installation, you can start to use . First, right-click to create a new text document , Then write code in it . Save and exit after writing , Then change the suffix of the file to .pl.. Then open the SWI-Prolog, Here are options file, Click Select consult, Then select the one generated in the previous step .pl file . Then enter the corresponding statement and press enter , You can get the result . Pay attention to writing .. Or just type in consult(' The path of the file '). , For example, next :
consult('C:\\Users\\Yan\\Desktop\\prolog\\test.pl').Notice the double slash here , You can also use a single backslash . namely :
consult('C:/Users/Yan/Desktop/prolog/test.pl').3, Example ( The problem of map coloring )
Adjacent areas of the map cannot use the same color . Now there are three colors : red 、 green 、 blue . Please tell me how to color the map above ?

.pl Enter... In the file :
%map.pl
% Define three colors
color(red).
color(green).
color(blue).
% Define the coloring rules
colorrule(A,B,C,D,E):-color(A),color(B),color(C),color(D),color(E),\+A=B,\+A=C,\+A=D,\+A=E,\+B=C,\+C=D,\+D=E.
stay swi-prolog Input in consult sentence , Then input colorrule(A,B,C,D,E). You get the result .

边栏推荐
- 导航中,添加边框影响布局的解决方法
- JS convert string to array object
- [JS] some handwriting functions: deep copy, bind, debounce, etc
- 从小白入手,从已经训练好的模型中取出weight权重参数绘制柱状图
- Dom and BOM in JS
- 【Leetcode】221. Largest Square
- LDAP和SSO集成能实现什么效果?
- 轻量化---Project
- TRON-api-波场转账查询接口-PHP版本-基于ThinkPHP5封装-附带接口文档-20220602版本-接口部署好适用于任何开发语言
- KDD2022 | 边信息增强图Transformer
猜你喜欢

开源项目-(ERP+酒店+电商)后台管理系统

Beyondcompare 4 uses PJ
![[JS] some handwriting functions: deep copy, bind, debounce, etc](/img/f8/cf51a24450a88abb9e68c78e0e3aa8.jpg)
[JS] some handwriting functions: deep copy, bind, debounce, etc

In depth anatomy of C language - key words & supplementary contents

VGg small convolution instead of large convolution vs deep separable convolution

JS attribute operation and node operation

A. Prefix range

Lightweight ---project

Introduction and test of MySQL partition table

NDT配准原理
随机推荐
C语言进阶篇——万字详解指针和qsort函数
AutoLock 解决加锁后忘记解锁问题
About message
Introduction and test of MySQL partition table
Beyondcompare 4 uses PJ
Influxdb2.x benchmark tool - influxdb comparisons
B. Wall painting (C language)
LDAP和SSO集成能实现什么效果?
Micro task, macro task and event loop of JS
你不会只会用console.log()吧?
[译] QUIC Wire Layout Specification - Packet Types and Formats | QUIC协议标准中文翻译(2) 包类型和格式
Quic wire layout specification - packet types and formats | quic protocol standard Chinese translation (2) package type and format
Click to generate 4-bit random number and verify code setting
【Leetcode】637. Layer average of binary tree
什么是模块化?模块化的好处
Cocktail sort
Differences between server-side rendering and client-side rendering (advantages and disadvantages)
用vector保存对象时保存指针的优点, 以及reserve的使用
时序数据库 - InfluxDB2 docker 安装
爱可可AI前沿推介(6.12)