2 Star 8 Fork 2

hiwii / hiwiiLang

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

介绍

  海微语言是介于人们日常使用的自然语言和计算机语言之间的一种语言。目标是建立一种适合于人机语言交互的语言。
  海微系统是以海微语言作为沟通方式。目前的计算机系统并没有基于语言交互设计,需要从一个全新的视角设计一种机器系统,能够在人与计算机、计算机与计算机之间进行语言交互。由于该系统以海微语言作为沟通方式,因此称系统为海微系统。

背景

    在计算机使用方面,大部分计算机用户都是通过鼠标或触摸来完成和计算机的交互,如果需要输入一些信息给计算机,我们通常是通过一个输入框实现。通过鼠标或屏幕的点击,加上文字输入框,我们可以实现很多应用,比如购物、游戏、新闻、社交等。各种不同的应用满足了我们当前的生活需求。

但是鼠标、触摸加输入框的方式只是一种图形交互方式,我们缺少一种真正的人机交互语言,通过人机交互语言,人和计算机能够像两个人交谈一样,进行语言的交互。

    造成人类不能和计算机顺利进行人机语言交互的原因主要有以下两点:
    (1)目前缺少一种人机交互语言。
    (2)目前的计算机不支持语言交互式应用。
    自然语言普通存在歧义、一词多义、语法复杂、习惯性用法多、不够严谨等多方面的问题。因为这些问题,当前情况下,自然语言并不适合作为一种人机交互语言。
    计算机语言涉及计算机原理,一般使用者较难掌握。且计算机语言大都是指令性语言,难以完成事实的陈述功能。因此计算机语言不能作为一种人机交互语言使用。
    基于以上原因,本文提出了一种全新的人机交互语言和适于进行人机交互的系统(以下简称本语言和本系统)。

基本思想

​ 本文所提出的新系统和新语言,其设计和现有的大部分计算机系统和计算机语言是不同的。本系统和本语言的基本设计思想需要从哲学角度,从客观世界和语言的认识开始分析。

世界有什么

对象

万物皆对象,对象是该项目的核心之一。世界由对象构成,对象和世界都是本文的研究对象,世界是一个特殊的对象。

状态

对象具有状态。

动作

动作是状态的变化。

关系

对象与对象之间会存在某种关系,这种关系可以是暂时的,也可以是长久的。比如:父母和子女的关系、同事和朋友关系、河流与河床的关系等。

世界的动态模型

对象接收信息,然后响应信息。信息引起对象动作。

信息

所有对象都在接受信息、处理信息、发送或反馈信息。

信息响应

世界是动态不断变化的。任何事物的任何变化的根本原因都是对象接受了信息。

对象收到信息,然后做出响应。这是本文的理论基础。

计算/判定/动作

对于一般对象,收到信息后的响应可以分为以下三种 1)动作。通常的响应就是完成一个动作。 2)计算。对象接到一个名词性信息,把该信息关联到一个具体对象,或者解释为真实的意义,称为计算。 3)判定。对象接到一个状态信息,然后对该状态进行真假判断。

抽象

抽象是语言中最重要的表示方法。抽象用于表示具有相同特征的对象集合。语言中,更多的表示对象的词汇都是抽象名词,用于描述集合对象,比如:高山、河流、星星等。

与对象的客观存在不同,抽象是另一种存在。它可以脱离客观存在而存在。比如数字3,即使没有属性3的对象存在,没有三个苹果或三只松鼠,"3"仍然存在。

原子对象和复杂的世界

世界由一些原子对象组成,原子对象具有各自的状态和动作。原子对象是不能再分解为更小对象的。

原子对象通过不同的形式组合在一起形成了组合对象。人们通常所见的对象都是复合对象,比如:大楼由多个楼层组成,楼层由砖瓦组成,而砖瓦又是水泥等建筑材料组成,建筑材料由各种基本粒子组成。

对象的组合在决定了对象的同时,也同时决定了复合后的状态和动作。

客观世界由有限的基本对象,通过各种的组合方式和关联关系,组成了多姿多彩的世界。

程序

计算/判定/动作按照逻辑顺序组合可以构成复杂的计算/判定/动作。同样,计算/判定/动作可以分解为更小颗粒度的计算/判定/动作。不能继续分割的,只由自身组成的计算/判定/动作,称作原子计算、原子判定和原子动作。组成复杂计算/判定/动作的过程就是程序。

方法论

关于对象的理解从信息和响应角度看,包括: 1、对象能够进行哪些计算。 2、对象有哪些状态。 3、对象能够进行哪些动作。

语言

语言是信息的一种形式。

语言世界和客观世界是不同的两个世界。

语言由基本符号组成。基本符号组成了词汇,词汇又构成了语句,语句组合形成了段落和章节。

表达式

表达式是能够表示特定意义的符号组合。语言是表达式的有序组合,表达式是语言的组成部分。

一个词、一句话、一段话、一个章节、一本书都可以认为是一个表达式。

自然语言最初必定是以口语形式出现的,随着字符的确定,才出现了书面语言。在人类有记录以来的数千年文明中,书面语言并没有进化出和口语太大不同的 地方。因此,自然语言无论口语还是书面语言,仍然以词汇作为基本组成部分。而计算机语言中,除了词汇,函数也是基本表达式,此外,小括号、中括号、大括号等进一步完善了计算机语言的表达能力。 比如:

f(x)

这个表达式是数学和计算机语言中最常见的表达式之一,但是在自然语言中却难以见到。

函数提供了一种更加合理的表达式组合方式。通过函数表达式或其它组合表达式,比如中括号、大括号等表达式,语言不仅可以没有歧义的组合表达式,形成新的表达式,而且可以按照层次组合。这在仅仅由词汇组成的自然语言中是难以实现的。

自然语言的词汇是一维的,这种组合方式带来了三种缺陷:

1)必须理解全部词汇的含义才能根据含义来组合表达式。

2)容易产生歧义。词汇组合的顺序不同,词汇的含义不同。比如:两个大学的/学生,两个/大学的学生。

3)为了达到描述目的,不得不使得自然语言语法变得很复杂,比如:主谓宾,定语、状语、补语、表语、不定时等等。

表达式分类

对象、状态、动作是描述客观对象的三个基本要素,这三者构成了名词、形容词和动词。

语言表示的对象可能是最早出现于人类语言中的。"太阳"、"月亮"是语言中比较常见的表示对象的词汇。

状态是描述的对象的主要词汇。高的、矮的、宽阔的、明亮的.....这些都是描述状态的词汇。

语言中描述对象的状态变化的词汇也很多,比如:生长、流动、上升、照亮等。

综上,表达式可以分为对象表达式、状态表达式和动作表达式。三种表达式与三种动作响应计算、判定和动作相对应。

自然语言中,词语可以分为名词、形容词和动词。词语是一种表达式,简单的词语可以这样分类,是从表达式的使用目的方面划分的,因此表达式也可以分为名词表达式、形容词表达式和动词表达式,分别就是:对象表达式、状态表达式和动作表达式。

描述世界

我们用语言来表示客观世界。语言表示客观世界存在的一切。客观世界存在什么,那么语言就表示什么。 语言世界和客观世界存在一种映射关系,正如数学中两个集合的映射关系。

语言的功能可以分为三种:指代、描述和触发动作。

从指代功能方面,可以用语言表述对象,也可以表示状态和动作,表示我们还不知道的任何事物。比如:即使我们不认识袋鼠,我们仍然可以用动物来指代它。

世界多姿多态,无论如何变化,我们总能够用语言来描述。

简单的对象通过有限的关系关联在一起,构成了这个世界。而语言可以通过有限的词汇和有限的表达式语法描述这个世界的一切。

世界可以像搭积木一样,用有限的原子、有限的构成类型组成这样精彩的世界,语言也可以用有限的表达式、有限的语法,像搭积木一样,描述这多样的世界。

系统

当我们确定了对象接受信息然后进行响应的机制,确定了语言如何描述世界、描述对象,我们就可以设定我们的系统。

根据前面提到的世界观,系统首先是一个对象,因此系统的首要特征是接受信息、信息响应、发送信息。语言交互是接受信息和发送信息的一种形式。语言交互是系统最重要的一项功能,因此接受语言信息和发送语言信息是系统最基本的一项基本功能。

信息交互不仅是通过语言交互形式,图形和影音方式也是信息交互方式。因此,发展语言交互方式并不影响目前的图形影音交互方式的发展。语言交互是系统应该具有的基本交互方式,影音等多媒体交互方式使交互方式更加丰富。

系统特征如下:

信息收发中心

首先系统是一个信息发送和接收的中心。系统控制有一些计算机外设,通过信息交互控制外设的工作。这些外设都可以看作是系统的信息交互对象。系统和外设系统的交互不一定采用用户理解的语言交互形式,可以是任何二进制形式。

从系统视角,用户和系统控制的外设是类似的,只是用户的主要交互形式是语言。

符号运算中心

系统最重要的功能之一是符号运算。符号运算的本质就是表达式的映射,通过一个表达式运算得到另外一个表达式。

表达式运算的前提是一些表达式可以映射成另外一些表达式。另外,系统中的一些表达式是原始表达式,这些表达式于系统本身是无意义的,但是对于人类用户是有意义的。比如:数(包括整数、小数等)对于计算机就是无意义的二进制符号,于人类用户则有具体的含义。

没有意义的表达式并不影响系统进行符号运算。如何计算机和人类找到相同的原始符号,使用相同的符号运算规则,则在计算机知识范围内,人类和计算机具有相同的运算能力。而且在运算速度上,人类将无法与计算机相抗衡。

存储信息和提取信息

系统处理的信息包括语言信息和系统信息交互需要的其它信息。 系统存储信息主要包括: 1、符号的意义。一个有意义的符号必然是三种表达式之一:对象表达式、状态表达式和动作表达式。 2、系统中存在的对象。 3、对象描述。

前面讲到,语言描述的对象包括:对象、状态、动作、关系和抽象。系统存储和提取的信息内容也是语言描述的内容。 语言描述的基本要求是不能存在矛盾,比如:一方面说这件衬衫是蓝色的,另一方面又说这件衬衫不是蓝色的。

执行程序

系统作为一个对象,系统的程序执行就是信息响应的过程。系统收到信息后的响应动作包括计算、判定和动作。

简单的响应过程是原子的,无法分解的。而复杂的响应过程是由多个动作按照逻辑顺序依次执行的。这个逻辑执行过程就是程序。

前面已经讲过,信息响应分为三种:计算、判定和动作。因此程序可以分为三种:计算程序、判定程序和动作程序。

设计系统

当明确了语言和系统的相关概念后,并且确定了语言的表达式规则后,系统设计就是以下几点内容: 1、基本对象 系统管理的对象有哪些?找到这些基本对象的表达式。 2、基本状态 确定系统能够进行判定的基本状态有哪些. 3、基本动作 确定系统及管理对象能够完成的基本动作有哪些。

系统执行

有三种方式可以执行系统,然后和系统进行语言交互:

1、在eclipse中,找到net.hiwii.obj.Console,然后运行会出现命令行交互界面。 2、访问https://gitee.com/hiwii/hiwiiLang/releases ,下载可执行java包,在命令行执行:java -jar hiwiiV0.5.jar 3、在微信关注“海微语言”公众号,在公众号中发送语言信息,就可以执行海微语言指令。

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

海微语言是介于人们日常使用的自然语言和计算机语言之间的一种语言。目标是建立一种适合于人机语言交互的语言。 展开 收起
Java 等 3 种语言
Apache-2.0
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/hiwii/hiwiiLang.git
git@gitee.com:hiwii/hiwiiLang.git
hiwii
hiwiiLang
hiwiiLang
master

搜索帮助