Diff for ''

Revision 9
Author:
black
Time:
2022-10-16 02:30
Revision 1
Time:
2024-06-13 22:31
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
<includeonly><div class="thumb {{#switch: {{{align|}}} | left = tleft | center | centre = tnone | tright}} {{#if: {{{noclear|}}} | no-clear }}" style="width:{{#ifeq: {{{direction|horizontal}}} | vertical | {{#expr: {{#if: {{{width|}}} | {{{width}}} | {{{width1}}} }} + 12}} | {{#if: {{{width|}}} | {{#expr: 8 + ({{{width|0}}} + 4) * {{#if: {{{image5|}}} | 5 | {{#if: {{{image4|}}} | 4 | {{#if: {{{image3|}}} | 3 | 2 }} }} }} }} | {{#expr: 16 + {{{width1}}} + {{{width2}}} + {{{width3|0}}} + {{{width4|0}}} + {{{width5|0}}} + {{#if: {{{image5|}}} | 12 | {{#if: {{{image4|}}} | 8 | {{#if: {{{image3|}}} | 4 | 0 }} }} }} }} }} }}px;{{#switch: {{{align|}}} | center | centre = margin: 0 auto;}}">
<div class="thumbinner">
{{#if: {{{header|}}} | <div style="clear:both;font-weight:bold;text-align:{{{header_align|center}}};background:{{{header_background|transparent}}};">{{{header}}}</div> }}
<div style="{{#ifeq: {{{direction|horizontal}}} | horizontal | float:left;}}margin:1px;width:{{#expr: 2 + {{#if: {{{width|}}} | {{{width}}} | {{{width1}}} }} }}px;"><div class="thumbimage">[[Image:{{{image1}}}|{{#if: {{{width|}}} | {{{width}}} | {{{width1}}} }}px|{{{caption1|{{{box_caption}}}}}}]]</div>{{#if: {{{caption1|}}} | <div class="thumbcaption" style="clear:left;">{{{caption1}}}</div>}}</div>
<div style="{{#ifeq: {{{direction|horizontal}}} | horizontal | float:left;}}margin:1px;width:{{#expr: 2 + {{#if: {{{width|}}} | {{{width}}} | {{{width2}}} }} }}px;"><div class="thumbimage">[[Image:{{{image2}}}|{{#if: {{{width|}}} | {{{width}}} | {{{width2}}} }}px|{{{caption2|{{{box_caption}}}}}}]]</div>{{#if: {{{caption2|}}} | <div class="thumbcaption" style="clear:left;">{{{caption2}}}</div>}}</div>
{{#if: {{{image3|}}} | <div style="{{#ifeq: {{{direction|horizontal}}} | horizontal | float:left;}}margin:1px;width:{{#expr: 2 + {{#if: {{{width|}}} | {{{width}}} | {{{width3}}} }} }}px;"><div class="thumbimage">[[Image:{{{image3}}}|{{#if: {{{width|}}} | {{{width}}} | {{{width3}}} }}px|{{{caption3|{{{box_caption}}}}}}]]</div>{{#if: {{{caption3|}}} | <div class="thumbcaption" style="clear:left;">{{{caption3}}}</div>}}</div>
{{#if: {{{image4|}}} | <div style="{{#ifeq: {{{direction|horizontal}}} | horizontal | float:left;}}margin:1px;width:{{#expr: 2 + {{#if: {{{width|}}} | {{{width}}} | {{{width4}}} }} }}px;"><div class="thumbimage">[[Image:{{{image4}}}|{{#if: {{{width|}}} | {{{width}}} | {{{width4}}} }}px|{{{caption4|{{{box_caption}}}}}}]]</div>{{#if: {{{caption4|}}} | <div class="thumbcaption" style="clear:left;">{{{caption4}}}</div>}}</div>
{{#if: {{{image5|}}} | <div style="{{#ifeq: {{{direction|horizontal}}} | horizontal | float:left;}}margin:1px;width:{{#expr: 2 + {{#if: {{{width|}}} | {{{width}}} | {{{width5}}} }} }}px;"><div class="thumbimage">[[Image:{{{image5}}}|{{#if: {{{width|}}} | {{{width}}} | {{{width5}}} }}px|{{{caption5|{{{box_caption}}}}}}]]</div>{{#if: {{{caption5|}}} | <div class="thumbcaption" style="clear:left;">{{{caption5}}}</div>}}</div>}}}}}}
{{#if: {{{footer|}}} | <div class="thumbcaption" style="clear:left;text-align:{{{footer_align|left}}};background:{{{footer_background|transparent}}};">{{{footer}}}</div> }}</div></div></includeonly><noinclude>
{{documentation}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
</noinclude>
# uloha v prologu

<{ForumPost(poster="msokol3", timestamp=2010-06-14 21:38:55)}>
Ahoj. potreboval by som trochu helfnut s ulohou v prologu. potrebujem overit konecnu binarnu mnozinu, ci je antisymetricka a tranzitivna. ak mi niekto mozete pomoct, budem velmi rad. dakujem.
<{/ForumPost}>

<{ForumPost(poster="venca", timestamp=2010-06-15 17:40:10)}>
co je binární množina?
<{/ForumPost}>

<{ForumPost(poster="msokol3", timestamp=2010-06-17 09:11:34)}>
G(\[1,2],\[1,3]) napr.
  
pre antisymetriu mam spracovany kod:
  
antisym(\[]).
antisym(\[\[X,Y]|R]):-
    najdi(\[Y,X],R, \[Y,X]),!,fail.
antisym(\[\[X,Y]|R]):-
    antisym(R)
  
najdi(A,\[A|_],A).
najdi(A,\[B|S],Out):-
najdi(A,S,Out).
  
malo by to fungovat. akurat mam problem s tranzitivitou.
<{/ForumPost}>

<{ForumPost(poster="thc", timestamp=2010-06-20 21:49:48)}>

 > msokol3 wrote:G(\[1,2],\[1,3]) napr.
 >
 > pre antisymetriu mam spracovany kod:
 >
 > antisym(\[]).
 > antisym(\[\[X,Y]|R]):-
 > najdi(\[Y,X],R, \[Y,X]),!,fail.
 > antisym(\[\[X,Y]|R]):-
 > antisym(R)
 >
 > najdi(A,\[A|_],A).
 > najdi(A,\[B|S],Out):-
 > najdi(A,S,Out).
 >
 > malo by to fungovat. akurat mam problem s tranzitivitou.

V ramci pripravy na zkousku (samozrejme bez zaruky):

    binary_set( [(1,1),(1,2),(3,3),(2,3)] ).
    
    non_member(X,[Y|T]) :- X \== Y, non_member(X,T).
    non_member(X,[]).
    
    antisymetrie([]).
    antisymetrie([(A,B)|XS]) :- A == B, antisymetrie(XS).
    antisymetrie([(A,B)|XS]) :- A \== B, non_member((B,A), XS), antisymetrie(XS).
    
    % binary_set(A),tranzitivita(A).
    tranzitivita([]).
    tranzitivita(XS) :- tranzitivita(XS, XS).
    
    tranzitivita([], _).
    tranzitivita([(A,B)|XS], YS) :- (member((B,C), YS) -> member((A,C), YS)), tranzitivita(XS, YS).
    


<{/ForumPost}>

<{ForumPost(poster="msokol3", timestamp=2010-06-22 20:19:49)}>
diky moc za pomoc:)
<{/ForumPost}>