我运行以下命令:
git cherry-pick SHA --strategy-option theirs
Run Code Online (Sandbox Code Playgroud)
并得到这样的冲突等待手动解决:
deleted by us: SOME_FILE
Run Code Online (Sandbox Code Playgroud)
有没有办法让git通过添加我们删除的文件自动解决此类冲突?
如何识别没有算术的Prolog中的A ^ n B ^ n语言以及任何A,B,其中A!= B?
有了已知的A = a和B = b,我们就可以写了
% For each 'a' save 'b' in a list, then check
% whether constructed list is equal to the rest of input list
anbn(L) :- anbn(L, []).
anbn(L, L).
anbn([a|L],A) :- anbn(L, [b|A]).
Run Code Online (Sandbox Code Playgroud)
对于任何A和BI都在考虑一个解决方案
anbn(L) :- anbn(L, []).
anbn([H|L],[]) :- anbn(L,[H]). % save an element
anbn([H|L], [H|A]) :- anbn(L, [H,H|A]). % make sure front elements are the same
Run Code Online (Sandbox Code Playgroud)
所以第一个元素都是相同的,但是我没有看到一个优雅的方法来检查列表其余部分中的所有元素是否与前面的元素相同和不同.
我可以检查剩下的是否与存储的列表一样长,然后它是否只包含第二个类型的元素,但我相信我的问题过于复杂,并且存在一个简短的解决方案.