首页 \ 问答 \ Łukasiewicz谓词逻辑?(Łukasiewicz predicate logic?)

Łukasiewicz谓词逻辑?(Łukasiewicz predicate logic?)

有没有办法用Java API模拟Łukasiewicz的三值逻辑?

更具体地说,我想模仿Łukasiewicz''M' (“这不是假的......”)运算符。

例如,我需要构造这个Predicate<String> ,它给出了以下结果:

predicate.test("0") = false
predicate.test(null) = true
predicate.test("1") = true

当否定时,给出:

predicate.negate().test("0") = true
predicate.negate().test(null) = true
predicate.negate().test("1") = false

如果要测试的值是A ,则我的谓词计算MAnegate()做的是计算¬MA而我希望它计算M¬A

PS不要用三值替换boolean值来解决使用三值替换Predicate的答案,因为我非常清楚自己如何做到这一点。 我问这个问题是为了找出纯Java8是否有可能,只需要很少的额外编码工作。


Is there a way to emulate Łukasiewicz' three-valued logic with the Java API?

More concretely, I want to emulate Łukasiewicz' 'M' ("it is not false that...") operator.

For example I need to construct this Predicate<String> which gives the following results:

predicate.test("0") = false
predicate.test(null) = true
predicate.test("1") = true

which when negated, gives:

predicate.negate().test("0") = true
predicate.negate().test(null) = true
predicate.negate().test("1") = false

If the value to test is A, my predicate calculates MA. What negate() does is calculate ¬MA whereas I want it to calculate M¬A.

P.S. Don't bother working out an answer with a three-valued replacement for Predicate with a three-valued replacement of boolean, because I know well enough how to do that myself. I'm asking this question to find out if it's possible with pure Java8 with minimal extra coding effort.


原文:https://stackoverflow.com/questions/33982052
更新时间:2020-02-10 19:35

最满意答案

是的你应该。 .gitmodules文件由其他文件(如.gitignore文件)进行版本控制。 它还与项目的其余部分一起推拉。

你可以做$ git diff --cached --submodule更清楚

当您提交这些更改时,您将看到诸如create mode 160000 comms类的消息

160000模式是Git中的一种特殊模式,这意味着您将提交记录为目录条目而不是子目录或文件


Yes, you should. The .gitmodules file is version-controlled with the other files, like the .gitignore file. It’s also pushed and pulled with the rest of the project.

you can do $ git diff --cached --submodule to be more clear

when you commit these changes you will see message like create mode 160000 comms

The 160000 mode is a special mode in Git which means you’re recording a commit as a directory entry rather than a subdirectory or a file

相关问答

更多
  • 你可能想要尝试git子树 ( alt link )。 在我的项目中,我使用了远程回馈和干净(无历史记录)分支机构,运气很好。 You may want to try git subtree (alt link) instead. I’ve had a lot of luck with it, using both remote repos and clean (untied to master history) branches in my project.
  • 您可以使用与git submodule init一样使用的机制,即查看.gitmodules 。 该文件枚举每个子模块路径及其引用的URL。 例如,从repo的根, cat .gitmodules将打印内容到屏幕(假设你有cat )。 编辑: 因为.gitmodule文件具有git配置格式,可以使用git config来解析这些文件: git config --file .gitmodules --name-only --get-regexp path 将显示所有子模块条目,并与 git config - ...
  • 是的,你可以rm -rf .git/modules/XXX 。 Yes, you can rm -rf .git/modules/XXX.
  • 可以在子模块的存储库中本地检查子模块的更改。 它们不需要被推回到子模块的原始位置。 但是,如果您要在团队外部共享父项目,则需要公开显示子模块更改。 例: 本地存储库“foo” foo中的子模块称为“bar” 在bar内进行更改,最好在新分支内进行 在bar内本地提交这些更改 在本地提交foo 只要您不在外部共享此存储库,这很好。 否则,您必须将更改推送到子模块,以便其他团队成员可以看到您对子模块的更改。 Changes to submodules can be checked in locally with ...
  • 还没有:该补丁中提出的配置“ push.recurseSubmodules ”没有通过。 即使它有,这意味着每个用户都需要配置他/她的克隆。 唯一的其他解决方案是定义一个别名(如“ git - default push to --recurse-submodules=check ”)。 同样,这是一个按用户的解决方案(没有简单的方法将该设置从一个中央仓库传播到其所有克隆)。 Not yet: the config "push.recurseSubmodules" proposed in that patch ...
  • 内部git跟踪文件夹不存在于s中,而是列出了类似链接的条目,其中包含像sha哈希的字母数字 那些不是子模块,而是简单的gitlink ( 索引中的特殊条目 ),代表嵌套的git repo SHA1。 请参阅“ 嵌套git repos和子模块之间的区别 ”。 有什么方法可以从我的主要git仓库中恢复我的更改,还是他们永远丢失了? 至少克隆你的repo(你推送gitlinks +你的代码的那个):你会在那里找到你的变化。 然后从一个新的回购开始,并强制推动。 有没有办法让内部仓库(现在是一个链接)到我将代码推送 ...
  • 在Erlang应用程序的代码中添加其他应用程序以允许其他开发人员轻松更新而不使用git子模块的正确方法是什么? 将该应用添加到rebar.config并使用: ./rebar update-deps 用于更新。 第一次,你需要使用: ./rebar get-deps 请参阅: https : //github.com/basho/rebar/wiki/Rebar-commands 现在,回到你的错误。 我的感觉是,您的代码中有一个(几乎)空的mochiweb目录,可能是因为使用了Git子模块。 当您运行 ...
  • 是的你应该。 .gitmodules文件由其他文件(如.gitignore文件)进行版本控制。 它还与项目的其余部分一起推拉。 你可以做$ git diff --cached --submodule更清楚 当您提交这些更改时,您将看到诸如create mode 160000 comms类的消息 160000模式是Git中的一种特殊模式,这意味着您将提交记录为目录条目而不是子目录或文件 Yes, you should. The .gitmodules file is version-controlled wi ...
  • -dirty后缀表示子模块已更改。 做这个: cd wp-content/plugins/advanced-custom-fields 然后 git status 并且您将看到哪些更改导致您的子模块变脏。 the -dirty suffix means the submodule has changed. do this: cd wp-content/plugins/advanced-custom-fields then git status and you'll see what changes ...
  • 是的,你可以使用orphan分支。 orphan分支将从新父分支重新开始,因此它不会与任何其他分支进行任何共同提交。 这样,您可以拥有多个分支,每个分支对应于相应菜谱的不同提交历史记录。 所以你需要做的就是: git checkout --orphan newbranch 从git checkout手册页 : --orphan 创建一个名为的新孤立分支,从启动并切换到它。 在这个新分支上进行的第一次提交将没有父项,它将成为与所有其 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。